Skip to content

Commit 7e29ffc

Browse files
committed
Merge pull request #557 from toyowata/master
HAL: LPC824 - Correct SPI delay value
2 parents 07722e7 + 0c3d630 commit 7e29ffc

File tree

1 file changed

+1
-1
lines changed
  • libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC82X

1 file changed

+1
-1
lines changed

libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC82X/spi_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ void spi_init(spi_t *obj, PinName mosi, PinName miso, PinName sclk, PinName ssel
110110
spi_format(obj, 8, 0, 1); // 8 bits, mode 0, slave
111111
}
112112
spi_frequency(obj, 1000000);
113+
obj->spi->DLY = 2; // 2 SPI clock times pre-delay
113114

114115
// enable the ssp channel
115116
ssp_enable(obj);
@@ -139,7 +140,6 @@ void spi_frequency(spi_t *obj, int hz)
139140

140141
// rise DIV value if it cannot be divided
141142
obj->spi->DIV = (SystemCoreClock + (hz - 1))/hz - 1;
142-
obj->spi->DLY = 0;
143143

144144
ssp_enable(obj);
145145
}

0 commit comments

Comments
 (0)