aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-01-12 19:29:08 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-01-12 19:29:08 +0100
commit350a1b29044684d6256004905733572fd51a0614 (patch)
treebb248cfe19e1d91e6d324a93dbc66df5c82e9085
parent29ba09dae14a1fcf5e8f0d5cf6547360db23482f (diff)
downloadglutte-o-matic-350a1b29044684d6256004905733572fd51a0614.tar.gz
glutte-o-matic-350a1b29044684d6256004905733572fd51a0614.tar.bz2
glutte-o-matic-350a1b29044684d6256004905733572fd51a0614.zip
Change TX_n to TX
-rw-r--r--src/fsm/pio.c8
-rw-r--r--src/fsm/pio.h8
-rw-r--r--src/fsm/pio.txt2
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
------------------------------------