Change USART1 to LEDs for T0/T1 presence indication (@ Tcalc_screen_ver2)

This commit is contained in:
eddyem
2019-09-18 16:41:35 +03:00
parent 4bd57d704a
commit 8491f4bf90
13 changed files with 42 additions and 309 deletions

View File

@@ -36,6 +36,12 @@
#define LED1_port GPIOA
#define LED1_pin (1<<15)
// LEDs for T0/T1 (PA9/PA10)
#define LEDT0_port GPIOA
#define LEDT0_pin (1<<9)
#define LEDT1_port GPIOA
#define LEDT1_pin (1<<10)
#define CONCAT(a,b) a ## b
#define STR_HELPER(s) #s
#define STR(s) STR_HELPER(s)
@@ -46,6 +52,9 @@
#define LED_blink(x) pin_toggle(x ## _port, x ## _pin)
#define LED_on(x) pin_clear(x ## _port, x ## _pin)
#define LED_off(x) pin_set(x ## _port, x ## _pin)
#define LEDT_on(x) pin_set(LEDT ## x ## _port, LEDT ## x ## _pin)
#define LEDT_off(x) pin_clear(LEDT ## x ## _port, LEDT ## x ## _pin)
#define LEDT_blink(x) pin_toggle(LEDT ## x ## _port, LEDT ## x ## _pin)
// PA1 - USB On (in)
#define USBisOn() (GPIOA->IDR & 1<<1)