Skip to content

Commit 9e110f1

Browse files
committed
mimxrt10xx: busio: cap SPI baudrate at 30MHz per datasheet
1 parent 155b61f commit 9e110f1

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
@@ -234,6 +234,10 @@ void common_hal_busio_spi_deinit(busio_spi_obj_t *self) {
234234
bool common_hal_busio_spi_configure(busio_spi_obj_t *self,
235235
uint32_t baudrate, uint8_t polarity, uint8_t phase, uint8_t bits) {
236236

237+
if (baudrate > 30000000) {
238+
baudrate = 30000000; // "Absolute maximum frequency of operation (fop) is 30 MHz" -- IMXRT1010CEC.pdf
239+
}
240+
237241
LPSPI_Enable(self->spi, false);
238242
uint32_t tcrPrescaleValue;
239243
self->baudrate = LPSPI_MasterSetBaudRate(self->spi, baudrate, LPSPI_MASTER_CLK_FREQ, &tcrPrescaleValue);

0 commit comments

Comments
 (0)