aboutsummaryrefslogtreecommitdiffstats
path: root/src/atsam/serial.c
diff options
context:
space:
mode:
authorAlex Maclean <monkeh@monkeh.net>2021-08-18 20:01:59 +0100
committerKevin O'Connor <kevin@koconnor.net>2022-03-26 11:59:27 -0400
commit80492432210f1cf7817b7808245d196f3420021e (patch)
treea3c7f6222ce51c5a7f7ac2ab77dce1506a5ddfbf /src/atsam/serial.c
parent99c2bf0dede623264777812fd324499325babc48 (diff)
downloadkutter-80492432210f1cf7817b7808245d196f3420021e.tar.gz
kutter-80492432210f1cf7817b7808245d196f3420021e.tar.xz
kutter-80492432210f1cf7817b7808245d196f3420021e.zip
atsam: Add support for SAM E70
Signed-off-by: Alex Maclean <monkeh@monkeh.net>
Diffstat (limited to 'src/atsam/serial.c')
-rw-r--r--src/atsam/serial.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/atsam/serial.c b/src/atsam/serial.c
index 75ab36d2..c7c0dc75 100644
--- a/src/atsam/serial.c
+++ b/src/atsam/serial.c
@@ -17,19 +17,29 @@
static Uart * const Port = UART;
static const uint32_t Pmc_id = ID_UART;
static const uint32_t rx_pin = GPIO('A', 8), tx_pin = GPIO('A', 9);
+static const char uart_periph = 'A';
DECL_CONSTANT_STR("RESERVE_PINS_serial", "PA8,PA9");
#elif CONFIG_MACH_SAM4S
#define UARTx_IRQn UART1_IRQn
static Uart * const Port = UART1;
static const uint32_t Pmc_id = ID_UART1;
static const uint32_t rx_pin = GPIO('B', 2), tx_pin = GPIO('B', 3);
+static const char uart_periph = 'A';
DECL_CONSTANT_STR("RESERVE_PINS_serial", "PB2,PB3");
#elif CONFIG_MACH_SAM4E
#define UARTx_IRQn UART0_IRQn
static Uart * const Port = UART0;
static const uint32_t Pmc_id = ID_UART0;
static const uint32_t rx_pin = GPIO('A', 9), tx_pin = GPIO('A', 10);
+static const char uart_periph = 'A';
DECL_CONSTANT_STR("RESERVE_PINS_serial", "PA9,PA10");
+#elif CONFIG_MACH_SAME70
+#define UARTx_IRQn UART2_IRQn
+static Uart * const Port = UART2;
+static const uint32_t Pmc_id = ID_UART2;
+static const uint32_t rx_pin = GPIO('D', 25), tx_pin = GPIO('D', 26);
+static const char uart_periph = 'C';
+DECL_CONSTANT_STR("RESERVE_PINS_serial", "PD25,PD26");
#endif
void
@@ -57,8 +67,8 @@ serial_enable_tx_irq(void)
void
serial_init(void)
{
- gpio_peripheral(rx_pin, 'A', 1);
- gpio_peripheral(tx_pin, 'A', 0);
+ gpio_peripheral(rx_pin, uart_periph, 1);
+ gpio_peripheral(tx_pin, uart_periph, 0);
// Reset uart
enable_pclock(Pmc_id);