diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/fsm/pio.c | 8 | ||||
-rw-r--r-- | src/fsm/pio.h | 8 | ||||
-rw-r--r-- | src/fsm/pio.txt | 2 |
3 files changed, 10 insertions, 8 deletions
diff --git a/src/fsm/pio.c b/src/fsm/pio.c index 2a8aa40..a4033a9 100644 --- a/src/fsm/pio.c +++ b/src/fsm/pio.c @@ -47,12 +47,14 @@ void pio_init() GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_Init(GPIOC, &GPIO_InitStructure); +#if GPIOC_OPENDRAIN_PINS GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; GPIO_InitStructure.GPIO_Pin = GPIOC_OPENDRAIN_PINS; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; GPIO_InitStructure.GPIO_OType = GPIO_OType_OD; GPIO_Init(GPIOC, &GPIO_InitStructure); +#endif GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN; GPIO_InitStructure.GPIO_Pin = GPIOC_INPUT_PINS; @@ -92,12 +94,10 @@ void pio_set_tx(int on) { // Led is active high, TX_n is inverted logic if (on) { - GPIO_SetBits(GPIOC, GPIO_PIN_LED_red); - GPIO_ResetBits(GPIOC, GPIO_PIN_TX_n); + GPIO_SetBits(GPIOC, GPIO_PIN_LED_red | GPIO_PIN_TX); } else { - GPIO_ResetBits(GPIOC, GPIO_PIN_LED_red); - GPIO_SetBits(GPIOC, GPIO_PIN_TX_n); + GPIO_ResetBits(GPIOC, GPIO_PIN_LED_red | GPIO_PIN_TX); } } diff --git a/src/fsm/pio.h b/src/fsm/pio.h index 7752e34..ed9fd9c 100644 --- a/src/fsm/pio.h +++ b/src/fsm/pio.h @@ -42,14 +42,16 @@ #define GPIO_PIN_U_n GPIO_Pin_8 #define GPIO_PIN_LED_grn GPIO_Pin_9 #define GPIO_PIN_D_n GPIO_Pin_11 -#define GPIO_PIN_TX_n GPIO_Pin_13 +#define GPIO_PIN_TX GPIO_Pin_13 #define GPIOC_OUTPUT_PINS GPIO_PIN_LED_red | \ GPIO_PIN_LED_yel | \ - GPIO_PIN_LED_grn + GPIO_PIN_LED_grn | \ + GPIO_PIN_TX + +#define GPIOC_OPENDRAIN_PINS 0 -#define GPIOC_OPENDRAIN_PINS GPIO_PIN_TX_n #define GPIOC_INPUT_PINS GPIO_PIN_QRP_n | \ GPIO_PIN_1750 | \ diff --git a/src/fsm/pio.txt b/src/fsm/pio.txt index c1326bc..eabc16f 100644 --- a/src/fsm/pio.txt +++ b/src/fsm/pio.txt @@ -3,7 +3,7 @@ Allocation of PIOs to functions Test logic ---------- -- out TX_OFF PC13 +- out TX_ON PC13 u-blox NEO-M8N GPS module connection ------------------------------------ |