1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

Merge pull request #3946 from kaspar030/add_lpc3287_spi_conf_pins

cpu: lpc2387: add spi_conf_pins()
This commit is contained in:
Hauke Petersen 2015-09-23 22:49:30 +02:00
commit 7d38a18060

View File

@ -105,9 +105,7 @@ int spi_init_master(spi_t dev, spi_conf_t conf, spi_speed_t speed)
PCONP |= PCSSP0; /* Enable power for SSP0 (default is on)*/
/* PIN Setup*/
PINSEL3 |= BIT8 + BIT9; /* Set CLK function to SPI*/
PINSEL3 |= BIT14 + BIT15; /* Set MISO function to SPI*/
PINSEL3 |= BIT16 + BIT17; /* Set MOSI function to SPI*/
spi_conf_pins(dev);
/* Interface Setup*/
SSP0CR0 = 7;
@ -194,4 +192,17 @@ void spi_poweroff(spi_t dev)
{
}
int spi_conf_pins(spi_t dev)
{
switch (dev) {
case 0:
PINSEL3 |= BIT8 + BIT9; /* SCLK */
PINSEL3 |= BIT14 + BIT15; /* MISO */
PINSEL3 |= BIT16 + BIT17; /* MOSI */
return 0;
default:
return -1;
}
}
#endif /* SPI_0_EN */