fm62429.h 762 B

123456789101112131415161718192021222324252627282930
  1. #ifndef __FM62429__H__
  2. #define __FM62429__H__
  3. #include "stm32f10x.h"
  4. #define VOLUEM_DEFAULT 7
  5. #define VOLUME_MAX 10
  6. #define VOLUME_MIN 1
  7. typedef enum
  8. {
  9. VOLUME_NORMAL,
  10. VOLUME_RESTORE,
  11. VOLUME_ADD,
  12. VOLUME_DECREASE
  13. }VOLUME_DEF;
  14. #define FM_CLK_PIN GPIO_Pin_5
  15. #define FM_CLK_PORT GPIOB
  16. #define FM_CLK(bit) bit?(FM_CLK_PORT->BSRR=FM_CLK_PIN):(FM_CLK_PORT->BRR=FM_CLK_PIN)
  17. #define FM_SDA_PIN GPIO_Pin_4
  18. #define FM_SDA_PORT GPIOB
  19. #define FM_SDA(bit) bit?(FM_SDA_PORT->BSRR=FM_SDA_PIN):(FM_SDA_PORT->BRR=FM_SDA_PIN)
  20. #define FM_SDA_Read GPIO_ReadInputDataBit(FM_SDA_PORT,FM_SDA_PIN)
  21. void FM_Init(void);
  22. void FMSetVolume(unsigned char volume,char needSave);
  23. void FMVolumeChange(VOLUME_DEF add_dicrease,char needSave);
  24. void SaveCurrentVolume(void);
  25. #endif