main.h 666 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef __MAIN_H
  2. #define __MAIN_H
  3. #include "nrf_delay.h"
  4. #include "twi_master.h"
  5. #define DEX_NUM 0
  6. enum _cmd{
  7. CMD_HEART = 0,
  8. CMD_MOTION,//主机上报给link——pc用
  9. CMD_UPDATA,//主机上报给link——pc用
  10. };
  11. enum _CMD_MOTION{
  12. MOTION_STOP = 0,
  13. MOTION_RUN,
  14. MOTION_JUMP,
  15. MOTION_DOWN,
  16. MOTION_LEFT,
  17. MOTION_RIGHT,
  18. MOTION_FRONT,
  19. MOTION_BACK,
  20. NUMBERS_OF_MOTION,
  21. };
  22. enum _CMD_UPDATE{
  23. UPDATE_NONE = 0,
  24. UPDATE_RUN,
  25. UPDATE_BASEINFO,
  26. NUMBERS_OF_UPDATE,
  27. };
  28. void send_to_ble_nus(uint8_t index,uint8_t cmd,uint8_t* dat,uint8_t datLen);
  29. int Send_bytes_to_Ble(unsigned char *bytes,int len);
  30. void advertising_start(void);
  31. void uart_init(void);
  32. #endif