1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

cpu/lpc2387: Fixed broken SPI driver

In commit 513b20ffd3 the SPI API was changed to
power up an configure the SPI bus on spi_acquire(). Sadly, the lpc2387 SPI
apparently needs to be reconfigured after each power up. This commit moves
the initialization code required after each power up from spi_init() to
spi_acquire().
This commit is contained in:
Marian Buschsieweke 2018-05-19 18:12:25 +02:00
parent f307314959
commit 17a5101b40
No known key found for this signature in database
GPG Key ID: 61F64C6599B1539F

View File

@ -47,8 +47,6 @@ void spi_init(spi_t bus)
{
assert(bus == SPI_DEV(0));
/* interface setup */
SSP0CR0 = 7;
/* configure pins */
spi_init_pins(bus);
/* power off the bus (default is on) */
@ -81,6 +79,8 @@ int spi_acquire(spi_t bus, spi_cs_t cs, spi_mode_t mode, spi_clk_t clk)
mutex_lock(&lock);
/* power on */
PCONP |= (PCSSP0);
/* interface setup */
SSP0CR0 = 7;
/* configure bus clock */
lpc2387_pclk_scale(CLOCK_CORECLOCK / 1000, (uint32_t)clk, &pclksel, &cpsr);