123456789101112131415161718192021222324252627282930 |
- #ifndef __FM62429__H__
- #define __FM62429__H__
- #include "stm32f10x.h"
- #define VOLUEM_DEFAULT 7
- #define VOLUME_MAX 10
- #define VOLUME_MIN 1
- typedef enum
- {
- VOLUME_NORMAL,
- VOLUME_RESTORE,
- VOLUME_ADD,
- VOLUME_DECREASE
- }VOLUME_DEF;
- #define FM_CLK_PIN GPIO_Pin_5
- #define FM_CLK_PORT GPIOB
- #define FM_CLK(bit) bit?(FM_CLK_PORT->BSRR=FM_CLK_PIN):(FM_CLK_PORT->BRR=FM_CLK_PIN)
- #define FM_SDA_PIN GPIO_Pin_4
- #define FM_SDA_PORT GPIOB
- #define FM_SDA(bit) bit?(FM_SDA_PORT->BSRR=FM_SDA_PIN):(FM_SDA_PORT->BRR=FM_SDA_PIN)
- #define FM_SDA_Read GPIO_ReadInputDataBit(FM_SDA_PORT,FM_SDA_PIN)
- void FM_Init(void);
- void FMSetVolume(unsigned char volume,char needSave);
- void FMVolumeChange(VOLUME_DEF add_dicrease,char needSave);
- void SaveCurrentVolume(void);
- #endif
|