You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.2 KiB
49 lines
1.2 KiB
#pragma once
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
#define LITTLE_DATA_BLOCK_FRAME_NUM 4 // 每四帧回调一次
|
|
|
|
typedef enum {
|
|
kevent_sensor_drop = 0, // 导联连接事件
|
|
kevent_tmr_scheduler, // 定时器调度事件
|
|
kevent_capture_data_block_event, // 每采集一定数据后回调一次
|
|
kevent_capture_little_data_block_event, // 传感器小数据块回调事件
|
|
kevent_button_push_event, // 按键按下事件
|
|
kevent_button_release_event, // 按键释放事件
|
|
|
|
kevent_start_sample_event, // 开始采集事件
|
|
kevent_stop_sample_event, // 停止采集事件
|
|
|
|
kevent_ble_connect_event, // 蓝牙连接事件
|
|
kevent_ble_disconnect_event, // 蓝牙断开事件
|
|
|
|
} app_event_type_t;
|
|
|
|
typedef struct {
|
|
uint32_t data0;
|
|
uint32_t data1;
|
|
uint32_t data2;
|
|
} one_frame_data_t;
|
|
|
|
typedef struct {
|
|
app_event_type_t eventType;
|
|
union {
|
|
struct {
|
|
uint32_t frameIndex;
|
|
one_frame_data_t data[LITTLE_DATA_BLOCK_FRAME_NUM];
|
|
} little_data_block;
|
|
|
|
struct {
|
|
uint8_t* data; // 不保证数据对齐
|
|
int len;
|
|
} block_sensor_data;
|
|
|
|
struct {
|
|
uint8_t drop0;
|
|
uint8_t drop1;
|
|
} sensor_drop;
|
|
} val;
|
|
} app_event_t;
|
|
|
|
void app_event_process_cb(void* p_event_data, uint16_t event_size);
|