diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2019-01-14 18:21:50 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2019-01-28 20:02:16 -0500 |
commit | 8cd83b4c2dcaeac1fe68f18eadd7f25ff42476c2 (patch) | |
tree | 780a7aa17ffd41969e5e6d63751b0efe7a9d108c /src/atsamd/spi.c | |
parent | f6ce875818a1341ff7a0279699505453d8ca0db4 (diff) | |
download | kutter-8cd83b4c2dcaeac1fe68f18eadd7f25ff42476c2.tar.gz kutter-8cd83b4c2dcaeac1fe68f18eadd7f25ff42476c2.tar.xz kutter-8cd83b4c2dcaeac1fe68f18eadd7f25ff42476c2.zip |
atsamd: Initial support for SAMD51
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/atsamd/spi.c')
-rw-r--r-- | src/atsamd/spi.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/atsamd/spi.c b/src/atsamd/spi.c index e0860576..2037f312 100644 --- a/src/atsamd/spi.c +++ b/src/atsamd/spi.c @@ -1,13 +1,12 @@ -// spi support on samd21 +// spi support on samd // -// Copyright (C) 2018 Kevin O'Connor <kevin@koconnor.net> +// Copyright (C) 2018-2019 Kevin O'Connor <kevin@koconnor.net> // // This file may be distributed under the terms of the GNU GPLv3 license. #include "internal.h" // enable_pclock #include "command.h" // shutdown #include "gpio.h" // spi_setup -#include "samd21.h" // SERCOM4 #include "sched.h" // sched_shutdown static void @@ -41,7 +40,7 @@ spi_setup(uint32_t bus, uint8_t mode, uint32_t rate) if (bus) shutdown("Invalid spi bus"); - uint32_t ctrla = (SERCOM_SPI_CTRLA_MODE_SPI_MASTER + uint32_t ctrla = (SERCOM_SPI_CTRLA_MODE(3) | (mode << SERCOM_SPI_CTRLA_CPHA_Pos) | SERCOM_SPI_CTRLA_DIPO(0) | SERCOM_SPI_CTRLA_DOPO(1) |