Преглед изворни кода

加入注释for GPIOB8 pin for SP700

Signed-off-by: huhui <huhui@sharkgulf.com>
huhui пре 5 година
родитељ
комит
2fdd1bab7d
2 измењених фајлова са 7 додато и 3 уклоњено
  1. 5 3
      Application/bsp/gpio.c
  2. 2 0
      Application/bsp/shark_bsp.h

+ 5 - 3
Application/bsp/gpio.c

@@ -23,8 +23,10 @@ void gpio_init(void){
 	//CS1180 cs
 	gpio_mode_output(GPIOA, GPIO_PUPD_NONE, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_9);
 	cs1180_cs(1);
+#ifdef SHARK_BOARD_SP700_OLD_CS1180
+    //老的sp700+cs1180上,GPIOA8和GPIOB15连在一起,为了不影响B15 pin的spi 功能,A8pin需要设置为输入
 	gpio_mode_analog_input(GPIOA, GPIO_PIN_8);
-	
+#endif
 #elif (CONFIG_BOARD_TYPE==SHARK_BOARD_SP600)
 	//rs485 INT ,this can be used detect rs485 in/out, then open rs485 power, and then detect GPIOF0
 	gpio_mode_input(GPIOC, GPIO_PUPD_NONE, GPIO_PIN_13);
@@ -57,7 +59,7 @@ void gpio_init(void){
 	gpio_mode_output(GPIOA, GPIO_PUPD_NONE, GPIO_OTYPE_PP, GPIO_OSPEED_10MHZ, GPIO_PIN_11);
 	//DC-DC power good indicat
 	gpio_mode_input(GPIOF, GPIO_PUPD_NONE, GPIO_PIN_7);
-	//ms5238 irq
+	//ms5238 irq, This pin is a NMOS open drain output pin and output is “L” level if interrupted
 	gpio_mode_input(GPIOA, GPIO_PUPD_NONE, GPIO_PIN_12);
 	//ML5238 cs
 	gpio_mode_output(GPIOA, GPIO_PUPD_NONE, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_15);
@@ -83,7 +85,7 @@ void charger_detect_irq_enable(int enable){
 void ml5238_irq_enable(int enable){
 	if (enable){
 		syscfg_exti_line_config(EXTI_SOURCE_GPIOA, EXTI_SOURCE_PIN12);
-		exti_init(EXTI_12, EXTI_INTERRUPT, EXTI_TRIG_BOTH);
+		exti_init(EXTI_12, EXTI_INTERRUPT, EXTI_TRIG_FALLING);
 		nvic_irq_enable(EXTI4_15_IRQn, 4U, 0U);
 		exti_interrupt_flag_clear(EXTI_12);
 		exti_interrupt_enable(EXTI_12);

+ 2 - 0
Application/bsp/shark_bsp.h

@@ -3,6 +3,8 @@
 #define SHARK_BOARD_SP600	1
 #define SHARK_BOARD_SP700	2
 
+#define SHARK_BOARD_SP700_OLD_CS1180 1
+
 #define true				TRUE
 #define false				FALSE