123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- #ifndef AEM_ADAPTER_DEV_H
- #define AEM_ADAPTER_DEV_H
- #include <stdint.h>
- #include "aem_core_if.h"
- typedef void (*aem_disp_set_brightness_api_t)(uint8_t value);
- typedef uint8_t (*aem_disp_get_brightness_api_t)(void);
- typedef int (*aem_get_bt_mac_addr_api_t)(uint8_t *mac, uint8_t len);
- typedef int (*aem_get_ble_mac_addr_api_t)(uint8_t *mac, uint8_t len);
- typedef int (*aem_get_sn_api_t)(uint8_t *sn, uint8_t len);
- typedef uint8_t (*aem_get_battery_percentage_api_t)(void);
- typedef uint16_t (*aem_get_battery_vol_api_t)(void);
- typedef uint8_t (*aem_get_charge_status_api_t)(void);
- typedef uint8_t (*aem_get_rtc_time_api_t)(aem_time_t *time);
- typedef int (*aem_set_rtc_time_api_t)(aem_time_t *time);
- typedef aem_motor_level_e (*aem_motor_get_level_api_t)(void);
- typedef void (*aem_motor_set_level_api_t)(aem_motor_level_e level);
- typedef void (*aem_motor_start_api_t)(void);
- typedef void (*aem_motor_stop_api_t)(void);
- typedef void (*aem_motor_control_api_t)(uint16_t run_ms, uint8_t run_cnt);
- typedef void (*aem_motor_set_freq_api_t)(unsigned int freq);
- typedef void (*aem_bat_charge_upate_evt_api_t)(uint8_t evt);
- typedef bool (*aem_check_bat_is_lowpower_api_t)(void);
- typedef aem_dev_info_t (*aem_get_device_info_api_t)(void);
- typedef struct
- {
- aem_disp_set_brightness_api_t disp_set_brightness;
- aem_disp_get_brightness_api_t disp_get_brightness;
- aem_get_bt_mac_addr_api_t get_bt_mac_addr;
- aem_get_ble_mac_addr_api_t get_ble_mac_addr;
- aem_get_battery_percentage_api_t get_battery_percentage;
- aem_get_battery_vol_api_t get_battery_vol;
- aem_get_charge_status_api_t get_charge_status;
- aem_get_rtc_time_api_t get_rtc_time;
- aem_set_rtc_time_api_t set_rtc_time;
- aem_motor_get_level_api_t motor_get_level;
- aem_motor_set_level_api_t motor_set_level;
- aem_motor_control_api_t motor_control;
- aem_motor_start_api_t motor_start;
- aem_motor_stop_api_t motor_stop;
- aem_motor_set_freq_api_t motor_set_freq;
- aem_get_device_info_api_t get_device_info;
- aem_get_sn_api_t get_sn_str;
- aem_check_bat_is_lowpower_api_t check_bat_is_lowpower;
- } aem_device_ops_t;
- const aem_device_ops_t *aem_get_device_ops(void);
- /**
- * @description: 注册battery charge事件回调
- * @param [aem_bat_charge_upate_evt_api_t] cb
- * @return 0 success
- * @notes:
- */
- uint8_t aem_bat_charge_upate_evt_cb_register(aem_bat_charge_upate_evt_api_t cb);
- void aem_adapter_dev_update_bat_charge_event(uint16_t cmd);
- aem_dev_info_t get_device_info(void);
- #endif /* AEM_DEV_ADAPT_H */
|