main.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #ifndef __main_h__
  2. #define __main_h__
  3. /**************************** 系统头文件 ********************************/
  4. #include <stdio.h>
  5. #include <stdbool.h>
  6. #include <stdint.h>
  7. #include <string.h>
  8. #include <math.h>
  9. #include "sdk_common.h"
  10. #include "app_error.h"
  11. #include "app_uart.h"
  12. #include "ble_db_discovery.h"
  13. #include "app_timer.h"
  14. #include "app_util.h"
  15. #include "bsp_btn_ble.h"
  16. #include "ble.h"
  17. #include "ble_gap.h"
  18. #include "ble_hci.h"
  19. #include "nrf_sdh.h"
  20. #include "nrf_sdh_ble.h"
  21. #include "nrf_sdh_soc.h"
  22. #include "ble_nus_c.h"
  23. #include "nrf_ble_gatt.h"
  24. #include "nrf_pwr_mgmt.h"
  25. #include "nrf_ble_scan.h"
  26. #include "nrf_log.h"
  27. #include "nrf_log_ctrl.h"
  28. #include "nrf_log_default_backends.h"
  29. #include "SEGGER_RTT.h"
  30. #include "ble_dfu.h"
  31. #include "nrf_dfu_ble_svci_bond_sharing.h"
  32. #include "nrf_svci_async_function.h"
  33. #include "nrf_svci_async_handler.h"
  34. #include "nrf_power.h"
  35. #include "peer_manager.h"
  36. #include "peer_manager_handler.h"
  37. /**************************** 自定义头文件 ********************************/
  38. #include "usr_config.h"
  39. //#pragma pack(1) //1字节对齐
  40. //typedef struct _IMU_H{
  41. // int16_t acc[3];
  42. // int16_t gyr[3];
  43. // int16_t mag[3];
  44. // uint16_t press;
  45. // int16_t temperature;
  46. // uint16_t ts;
  47. //}IMU_H_t;
  48. //typedef struct _IMU_S{
  49. // int32_t pos[3];
  50. // int16_t att[3];
  51. // int16_t acc[3];
  52. // uint16_t press;
  53. // uint8_t zupt;
  54. // uint8_t rssi;
  55. // uint16_t ts;
  56. //}IMU_S_t;
  57. //typedef struct _IMU_DAT{
  58. // IMU_H_t h;
  59. // IMU_S_t s;
  60. //}IMU_DAT_t;
  61. //#pragma pack() //1字节对齐成对用
  62. void process_motion(int16_t* _acc, int16_t* _gry, int16_t* front_mag, int16_t* back_mag, uint8_t _rssi); //__weak 函数 可重新定义
  63. void send_protocol(uint8_t index,uint8_t cmd,uint8_t* p,uint8_t datLen);
  64. void gpio_mt_run(uint32_t tim);
  65. #endif