altos/lpc: Support UART on pio1_13/pio1_14
authorKeith Packard <keithp@keithp.com>
Tue, 28 Mar 2023 04:26:41 +0000 (21:26 -0700)
committerKeith Packard <keithp@keithp.com>
Tue, 28 Mar 2023 04:26:41 +0000 (21:26 -0700)
This is an alternate configuration for this chip.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/lpc/ao_serial_lpc.c
src/lpc/lpc.h

index db0e0b0c55a3f2e22513439a4acf2a8a961b239c..1a833b3860d22d3268a772124dd01cff5ddbf016 100644 (file)
@@ -157,6 +157,18 @@ ao_serial_init(void)
                              (0 << LPC_IOCONF_INV) |
                              (0 << LPC_IOCONF_OD));
 #endif
+#if SERIAL_1_13_14
+       lpc_ioconf.pio1_13 = ((LPC_IOCONF_FUNC_PIO1_13_TXD << LPC_IOCONF_FUNC) |
+                             (LPC_IOCONF_MODE_INACTIVE << LPC_IOCONF_MODE) |
+                             (0 << LPC_IOCONF_HYS) |
+                             (0 << LPC_IOCONF_INV) |
+                             (0 << LPC_IOCONF_OD));
+       lpc_ioconf.pio1_14 = ((LPC_IOCONF_FUNC_PIO1_14_RXD << LPC_IOCONF_FUNC) |
+                             (LPC_IOCONF_MODE_INACTIVE << LPC_IOCONF_MODE) |
+                             (0 << LPC_IOCONF_HYS) |
+                             (0 << LPC_IOCONF_INV) |
+                             (0 << LPC_IOCONF_OD));
+#endif
 
        /* Turn on the USART */
        lpc_scb.sysahbclkctrl |= (1 << LPC_SCB_SYSAHBCLKCTRL_USART);
index be0dc021d7a7cf6e12629349b8398d0543161ef4..a234e24b3f1bd52d606915417c6110ac29934655 100644 (file)
@@ -280,7 +280,7 @@ extern struct lpc_ioconf lpc_ioconf;
 #define  LPC_IOCONF_FUNC_PIO1_14       0
 #define  LPC_IOCONF_FUNC_DSR           1
 #define  LPC_IOCONF_FUNC_PIO1_14_CT16B0_MAT1   2
-#define  LPC_IOCONF_FUNC_PIO1_13_RXD           3
+#define  LPC_IOCONF_FUNC_PIO1_14_RXD           3
 
 /* PIO1_15 */
 #define  LPC_IOCONF_FUNC_PIO1_15       0