aem_adapter_dev.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef AEM_ADAPTER_DEV_H
  2. #define AEM_ADAPTER_DEV_H
  3. #include <stdint.h>
  4. #include "aem_core_if.h"
  5. typedef void (*aem_disp_set_brightness_api_t)(uint8_t value);
  6. typedef uint8_t (*aem_disp_get_brightness_api_t)(void);
  7. typedef int (*aem_get_bt_mac_addr_api_t)(uint8_t *mac, uint8_t len);
  8. typedef int (*aem_get_ble_mac_addr_api_t)(uint8_t *mac, uint8_t len);
  9. typedef int (*aem_get_sn_api_t)(uint8_t *sn, uint8_t len);
  10. typedef uint8_t (*aem_get_battery_percentage_api_t)(void);
  11. typedef uint16_t (*aem_get_battery_vol_api_t)(void);
  12. typedef uint8_t (*aem_get_charge_status_api_t)(void);
  13. typedef uint8_t (*aem_get_rtc_time_api_t)(aem_time_t *time);
  14. typedef int (*aem_set_rtc_time_api_t)(aem_time_t *time);
  15. typedef aem_motor_level_e (*aem_motor_get_level_api_t)(void);
  16. typedef void (*aem_motor_set_level_api_t)(aem_motor_level_e level);
  17. typedef void (*aem_motor_start_api_t)(void);
  18. typedef void (*aem_motor_stop_api_t)(void);
  19. typedef void (*aem_motor_control_api_t)(uint16_t run_ms, uint8_t run_cnt);
  20. typedef void (*aem_motor_set_freq_api_t)(unsigned int freq);
  21. typedef void (*aem_bat_charge_upate_evt_api_t)(uint8_t evt);
  22. typedef bool (*aem_check_bat_is_lowpower_api_t)(void);
  23. typedef aem_dev_info_t (*aem_get_device_info_api_t)(void);
  24. typedef struct
  25. {
  26. aem_disp_set_brightness_api_t disp_set_brightness;
  27. aem_disp_get_brightness_api_t disp_get_brightness;
  28. aem_get_bt_mac_addr_api_t get_bt_mac_addr;
  29. aem_get_ble_mac_addr_api_t get_ble_mac_addr;
  30. aem_get_battery_percentage_api_t get_battery_percentage;
  31. aem_get_battery_vol_api_t get_battery_vol;
  32. aem_get_charge_status_api_t get_charge_status;
  33. aem_get_rtc_time_api_t get_rtc_time;
  34. aem_set_rtc_time_api_t set_rtc_time;
  35. aem_motor_get_level_api_t motor_get_level;
  36. aem_motor_set_level_api_t motor_set_level;
  37. aem_motor_control_api_t motor_control;
  38. aem_motor_start_api_t motor_start;
  39. aem_motor_stop_api_t motor_stop;
  40. aem_motor_set_freq_api_t motor_set_freq;
  41. aem_get_device_info_api_t get_device_info;
  42. aem_get_sn_api_t get_sn_str;
  43. aem_check_bat_is_lowpower_api_t check_bat_is_lowpower;
  44. } aem_device_ops_t;
  45. const aem_device_ops_t *aem_get_device_ops(void);
  46. /**
  47. * @description: 注册battery charge事件回调
  48. * @param [aem_bat_charge_upate_evt_api_t] cb
  49. * @return 0 success
  50. * @notes:
  51. */
  52. uint8_t aem_bat_charge_upate_evt_cb_register(aem_bat_charge_upate_evt_api_t cb);
  53. void aem_adapter_dev_update_bat_charge_event(uint16_t cmd);
  54. aem_dev_info_t get_device_info(void);
  55. #endif /* AEM_DEV_ADAPT_H */