user_driver.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef __USER_DRIVER_H
  2. #define __USER_DRIVER_H
  3. #include "yc11xx_pwm.h"
  4. #include "system.h"
  5. #define FREQUENCY_DIVISION_0 0x0 //48M
  6. #define FREQUENCY_DIVISION_1 0x1 //24M
  7. #define FREQUENCY_DIVISION_2 0x2 //12M
  8. #define FREQUENCY_DIVISION_3 0x3 //6M
  9. #define FREQUENCY_DIVISION_4 0x4 //3M
  10. #define FREQUENCY_DIVISION_5 0x5 //1.5M
  11. #define FREQUENCY_DIVISION_6 0x6 //0.75M
  12. #define FREQUENCY_DIVISION_7 0x7 //0.375
  13. #define IS_FREQUENCY_DIVISION(FREQUENCY) ((FREQUENCY <= FREQUENCY_DIVISION_7))
  14. //#define HAL_MIN_48M_MIN_FREQUENCY ((48000000)/65535)
  15. #define HAL_MIN_48M_MIN_FREQUENCY ((48000000)/60000)
  16. #define HAL_MAX_48M_MAX_FREQUENCY (48000000>>1)
  17. #define HAL_MIN_24M_MIN_FREQUENCY ((24000000)/60000)
  18. #define HAL_MAX_24M_MAX_FREQUENCY (24000000>>1)
  19. #define HAL_MIN_12M_MIN_FREQUENCY ((12000000)/60000)
  20. #define HAL_MAX_12M_MAX_FREQUENCY (12000000>>1)
  21. #define HAL_MIN_6M_MIN_FREQUENCY ((6000000)/60000)
  22. #define HAL_MAX_6M_MAX_FREQUENCY (6000000>>1)
  23. #define HAL_MIN_3M_MIN_FREQUENCY ((3000000)/60000)
  24. #define HAL_MAX_3M_MAX_FREQUENCY (3000000>>1)
  25. #define HAL_MIN_1500K_MIN_FREQUENCY ((1500000)/60000)
  26. #define HAL_MAX_1500K_MAX_FREQUENCY (1500000>>1)
  27. #define HAL_MIN_750K_MIN_FREQUENCY ((750000)/60000)
  28. #define HAL_MAX_750K_MAX_FREQUENCY (750000>>1)
  29. #define HAL_MIN_375K_MIN_FREQUENCY ((375000)/65535)
  30. #define HAL_MAX_375K_MAX_FREQUENCY (375000>>1)
  31. void UserSet_OutPWM(GPIO_NUM gpio, PWM_ChxTypeDef pwm_channel,uint32_t frequecy,uint32_t percent);
  32. void ADC_Configuration(void);
  33. void Audio_to_uart_start();
  34. void Audio_sampling_init();
  35. void light_set_color(uint32_t color_rgb);
  36. void u_ble_data_send(uint8_t *send_data, uint8_t send_len);
  37. uint32_t HW_Get_Native_Clk_Avoid_Race(void);
  38. void flash_write_data (uint8_t *buffer, uint32_t address, uint32_t len);
  39. void flash_read_data (uint8_t *buffer, uint32_t address, uint32_t len);
  40. void flash_erase_sector(uint32_t address);
  41. uint8_t Get_Audio_val(void);
  42. unsigned char ReverseByteBits(unsigned char num);
  43. #endif