|
@@ -15,16 +15,24 @@ void driver_cpld_init()
|
|
|
stGpio.GPIO_Speed = GPIO_Speed_50MHz;
|
|
|
stGpio.GPIO_PuPd = GPIO_PuPd_NOPULL;
|
|
|
|
|
|
+ // CPLD使能管脚
|
|
|
RCC_AHB1PeriphClockCmd(DRIVER_CPLD_CS_CLK, ENABLE);
|
|
|
stGpio.GPIO_Pin = DRIVER_CPLD_CS_PIN;
|
|
|
GPIO_DeInit(DRIVER_CPLD_CS_PORT);
|
|
|
GPIO_Init(DRIVER_CPLD_CS_PORT, &stGpio);
|
|
|
|
|
|
+ // 北斗GPS使能管脚
|
|
|
+ RCC_AHB1PeriphClockCmd(DRIVER_CPLD_BDGPS_CLK, ENABLE);
|
|
|
+ stGpio.GPIO_Pin = DRIVER_CPLD_BDGPS_PIN;
|
|
|
+ GPIO_DeInit(DRIVER_CPLD_BDGPS_PORT);
|
|
|
+ GPIO_Init(DRIVER_CPLD_BDGPS_PORT, &stGpio);
|
|
|
+
|
|
|
// 失能
|
|
|
- driver_cpld_cs_enable(0);
|
|
|
+ driver_cpld_cs_enable(Bit_RESET);
|
|
|
+ driver_cpld_bdgps_enable(Bit_RESET);
|
|
|
}
|
|
|
|
|
|
-// 片选使能
|
|
|
+// CPLD使能
|
|
|
// byEnable:0:失能,1:使能
|
|
|
void driver_cpld_cs_enable(uint8 byEnable)
|
|
|
{
|
|
@@ -37,3 +45,17 @@ void driver_cpld_cs_enable(uint8 byEnable)
|
|
|
GPIO_WriteBit(DRIVER_CPLD_CS_PORT, DRIVER_CPLD_CS_PIN, Bit_RESET);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+// 北斗GPS使能
|
|
|
+// byEnable:0:失能,1:使能
|
|
|
+void driver_cpld_bdgps_enable(uint8 byEnable)
|
|
|
+{
|
|
|
+ if (byEnable > 0)
|
|
|
+ {
|
|
|
+ GPIO_WriteBit(DRIVER_CPLD_BDGPS_PORT, DRIVER_CPLD_BDGPS_PIN, Bit_SET);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ GPIO_WriteBit(DRIVER_CPLD_BDGPS_PORT, DRIVER_CPLD_BDGPS_PIN, Bit_RESET);
|
|
|
+ }
|
|
|
+}
|