aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKévin Redon <kredon@sysmocom.de>2019-10-01 20:03:42 +0200
committerlaforge <laforge@osmocom.org>2019-10-04 15:55:02 +0000
commit3feadfa910bf29e304ab9d11490cad11ee013fdb (patch)
treeb8fa285d14ce0602fd6ad1df4b0bd3055794181e
parent9acff5ee5a960100ec78408328331c630bda782c (diff)
define LEDs for octsimtestHEADmaster
the OctSIM tester has only one amber LED. this is now mapped to the normally green LED, used for activity. because the LED is driven by an NPN transistor (as open collector) instead of being directly connected to the pin (as open collector) like on the other boards, the logic is inverted. since normally the LED is on on idle and blinks during activity, it will now be off on idle an only blink on activity (unless the code is extended to cope with the possible inverted logic). because there is no second LED but the current code requires one, I mapped is to an unused pin. the octosimtest target still does not compile completely, but at least the LED issue is fixed. Change-Id: I1296833bef2804c611640fcf4756e47905660e7b
-rw-r--r--firmware/libboard/octsimtest/include/board.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/firmware/libboard/octsimtest/include/board.h b/firmware/libboard/octsimtest/include/board.h
index 2effc02..2e0f3c4 100644
--- a/firmware/libboard/octsimtest/include/board.h
+++ b/firmware/libboard/octsimtest/include/board.h
@@ -31,6 +31,22 @@
#define BOARD_MCK 58982400 // 18.432 * 16 / 5
/** Pin configuration **/
+
+/** there is no red LED, but the code needs this second LED, thus we provide an unused pin */
+#define PIO_LED_RED PIO_PB13
+/** MCU pin connected to green LED, which is actually amber, and the logic is inverted since it is connected to an NPN transistor (used as open drain) */
+#define PIO_LED_GREEN PIO_PA4
+/** red LED pin definition */
+#define PIN_LED_RED {PIO_LED_RED, PIOB, ID_PIOB, PIO_OUTPUT_1, PIO_DEFAULT}
+/** green LED pin definition */
+#define PIN_LED_GREEN {PIO_LED_GREEN, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT}
+/** LEDs pin definition */
+#define PINS_LEDS PIN_LED_RED, PIN_LED_GREEN
+/** index for red LED in LEDs pin definition array */
+#define LED_NUM_RED 0
+/** index for green LED in LEDs pin definition array */
+#define LED_NUM_GREEN 1
+
/* Button to force bootloader start (shorted to ground when pressed */
#define PIN_BOOTLOADER_SW {PIO_PA5, PIOA, ID_PIOA, PIO_INPUT, PIO_PULLUP}