systick.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef __SYSTICK_H
  2. #define __SYSTICK_H
  3. #include <stdbool.h>
  4. #include "yc_drv_common.h"
  5. //#include "core_cm0.h"
  6. typedef int32_t vs32;
  7. typedef int16_t vs16;
  8. typedef int8_t vs8;
  9. #define TICK_PER_SECOND 1000
  10. #define TICK_US (1000)
  11. #define IMU_LOOP_TIME 2000 //单位为uS
  12. #define PID_INNER_LOOP_TIME 2000 //单位为us
  13. #define PID_OUTER_LOOP_TIME 5000 //单位为us
  14. #define GYRO_CF_TAU 8.5f
  15. #define ACC_LPF_CUT 30.0f //加速度低通滤波器截止频率
  16. #define GYRO_LPF_CUT 25.0f //陀螺仪低通滤波器截止频率
  17. //#define GYRO_CF_TAU 1.2f
  18. /*---------------------------------------------*/
  19. /*-------------------无线数据发送方式选择-----------------*/
  20. //#define ANO_DT_USE_Bluetooth
  21. //#define ANO_DT_USE_NRF24l01
  22. /*--------------------------------------------------------*/
  23. extern uint32_t tick_count;
  24. /**
  25. * @brief Initialize systick and start systick
  26. * @retval none
  27. */
  28. void systick_init(void);
  29. void delay_us(uint32_t us);
  30. void delay_10ms(uint32_t ms);
  31. uint32_t systick_get_us(void);
  32. uint32_t systick_get_ms(void);
  33. #endif