define LEDs for octsimtest

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
This commit is contained in:
Kevin Redon 2019-10-01 20:03:42 +02:00 committed by laforge
parent 9acff5ee5a
commit 3feadfa910
1 changed files with 16 additions and 0 deletions

View File

@ -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}