lpc176x: Use enumerations for buses and reserve pins

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2019-04-01 00:11:23 -04:00
parent bc9fd03dab
commit 3e71a57f67
4 changed files with 18 additions and 7 deletions

View File

@@ -10,6 +10,9 @@
#include "internal.h" // gpio_peripheral
#include "sched.h" // sched_shutdown
DECL_ENUMERATION("spi_bus", "ssp0", 0);
DECL_CONSTANT_STR("BUS_PINS_ssp0", "P0.17,P0.18,P0.15");
static void
spi_init(void)
{
@@ -18,10 +21,10 @@ spi_init(void)
return;
have_run_init = 1;
// Configure SCK0, MISO0, MOSI0 pins
gpio_peripheral(GPIO(0, 15), 2, 0);
// Configure MISO0, MOSI0, SCK0 pins
gpio_peripheral(GPIO(0, 17), 2, 0);
gpio_peripheral(GPIO(0, 18), 2, 0);
gpio_peripheral(GPIO(0, 15), 2, 0);
// Setup clock
enable_pclock(PCLK_SSP0);