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.
|
|
#pragma once
#include <stdbool.h>
#include <stdint.h>
#include "board/board.h"
typedef enum { kplod_connected_event = 0, // ���������¼�
kplod_disconnected_event, // �����Ͽ��¼�
kplod_connecting_event, // �����������¼�
kbattery_start_charge_event, // �����¼�
kbattery_charging_event, // ������
kbattery_end_charge_event, // ���������¼�
kevent_tmr_scheduler_event, // ��ʱ�������¼�
kevent_capture_256data_event, // �������ݻص�
kevent_capture_little_data_block_event, // ���β������ݻص�
} app_event_type_t;
typedef struct { uint16_t data; } one_frame_data_t;
typedef struct { app_event_type_t eventType; union { uint32_t plod_connected_accumulation_time; // ���������ۼ�ʱ��
uint8_t* capture_data_cache; // ʵʱ�������ݣ����ݳ���Ϊ256�ֽ�
struct { uint32_t frameIndex; one_frame_data_t data[LITTLE_DATA_BLOCK_FRAME_NUM]; } little_data_block; } val; } app_event_t;
typedef enum { // ����
kdevice_state_standby = 0, // ����
kdevice_state_poweron, // ��ҳ
kdevice_state_home, // ��ʾ�û����־�ֹ
kdevice_state_keep_still, // �ɼ���
kdevice_state_sampling, // �ɼ�����
kdevice_state_sampling_complete, // �ɼ��쳣
kdevice_state_sampling_error, // ������
kdevice_state_charging, } device_state_t;
static const char* device_state_to_str(device_state_t ds) { switch (ds) { case kdevice_state_standby: return "standby"; case kdevice_state_poweron: return "poweron"; case kdevice_state_home: return "home"; case kdevice_state_keep_still: return "keep_still"; case kdevice_state_sampling: return "sampling"; case kdevice_state_sampling_complete: return "sampling_complete"; case kdevice_state_sampling_error: return "sampling_error"; case kdevice_state_charging: return "charging"; default: return "unknow"; } }
void app_event_process_cb(void* p_event_data, uint16_t event_size);
void ds_change_to_state(device_state_t state); uint32_t ds_cur_state_haspassed_ms(); device_state_t ds_now_state();
typedef struct { bool is_over30s; } sample_capture_state_t;
sample_capture_state_t* sample_capture_state_get();
void sample_capture_state_reset(); void sample_capture_state_set_is_over30s(bool over30s);
|