12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- #include "GPIO_FM1288.h"
-
- unsigned char FM1288Led;
- void GPIO_FM1288_Init(void)
- {
- GPIO_InitTypeDef GPIO_InitStructure;
-
- FM1288_RST_RccOpen();
- FM1288_VADLED_RccOpen();
- FM1288_PWR_RccOpen();
- RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA,ENABLE);
- //================================================
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
- GPIO_InitStructure.GPIO_Pin = FM1288_RST_LINE;
- GPIO_Init(FM1288_RST_Port,&GPIO_InitStructure);
- GPIO_SetBits(FM1288_RST_Port,FM1288_RST_LINE);
- //================================================
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPD;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
- GPIO_InitStructure.GPIO_Pin = FM1288_VADLED_LINE;
- GPIO_Init(FM1288_VADLED_Port,&GPIO_InitStructure);
- //================================================
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
- GPIO_InitStructure.GPIO_Pin = FM1288_PWR_LINE;
- GPIO_Init(FM1288_PWR_Port,&GPIO_InitStructure);
- //================================================
- GPIO_SetBits(FM1288_PWR_Port,FM1288_PWR_LINE);
- /* FM1288 MUTE Input control, mutes Line-Out*/
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13;
- GPIO_Init(GPIOB,&GPIO_InitStructure);
- //================================================
- GPIO_SetBits(GPIOB,GPIO_Pin_13);
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12;
- GPIO_Init(GPIOA,&GPIO_InitStructure);
- //================================================
- GPIO_ResetBits(GPIOA,GPIO_Pin_12);
-
- }
- unsigned char GPIO_FM1288_LED(void)
- {
- FM1288Led=GPIO_ReadInputDataBit(FM1288_VADLED_Port,FM1288_VADLED_LINE); //0:FM1288工作正常,1表示不正常
- return FM1288Led;
- }
- void GPIO_FM1288_RST(U08 prm)
- {
- if (prm) {
- GPIO_SetBits(FM1288_RST_Port,FM1288_RST_LINE);
- } else {
- GPIO_ResetBits(FM1288_RST_Port,FM1288_RST_LINE);
- }
- }
- /* FM1288 MUTE Input control, mutes Line-Out*/
- void GPIO_FM1288_Mute(U08 prm)
- {
- if (prm) {
- GPIO_SetBits(GPIOB,GPIO_Pin_13);
- } else {
- GPIO_ResetBits(GPIOB,GPIO_Pin_13);
- }
- }
- void GPIO_PA12_BroadcastMute(U08 prm)
- {
- if (prm) {
- GPIO_SetBits(GPIOA,GPIO_Pin_12);
- } else {
- GPIO_ResetBits(GPIOA,GPIO_Pin_12);
- }
- }
|