Skip to content

Commit d04430b

Browse files
committed
mimxrt10xx: busio: cap SPI baudrate at 30MHz per datasheet
1 parent 144532e commit d04430b

File tree

1 file changed

+4
-0
lines changed
  • ports/mimxrt10xx/common-hal/busio

1 file changed

+4
-0
lines changed

ports/mimxrt10xx/common-hal/busio/SPI.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ void common_hal_busio_spi_deinit(busio_spi_obj_t *self) {
237237
bool common_hal_busio_spi_configure(busio_spi_obj_t *self,
238238
uint32_t baudrate, uint8_t polarity, uint8_t phase, uint8_t bits) {
239239

240+
if (baudrate > 30000000) {
241+
baudrate = 30000000; // "Absolute maximum frequency of operation (fop) is 30 MHz" -- IMXRT1010CEC.pdf
242+
}
243+
240244
LPSPI_Enable(self->spi, false);
241245
uint32_t tcrPrescaleValue;
242246
self->baudrate = LPSPI_MasterSetBaudRate(self->spi, baudrate, LPSPI_MASTER_CLK_FREQ, &tcrPrescaleValue);

0 commit comments

Comments
 (0)