Skip to content

Commit 82a6f95

Browse files
SPI responds to clock with this change, data transfer still ununcertain and parameter passing has issues
1 parent c969a64 commit 82a6f95

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

  • ports/atmel-samd/common-hal/busio

ports/atmel-samd/common-hal/busio/SPI.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self,
5858
uint8_t dopo = 255;
5959

6060
if (half_duplex) {
61-
mp_raise_NotImplementedError(MP_ERROR_TEXT("Half duplex SPI is not implemented but true"));
61+
mp_raise_NotImplementedError(MP_ERROR_TEXT("Half duplex SPI is not implemented"));
6262
}
6363

6464
// Ensure the object starts in its deinit state.
@@ -146,11 +146,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self,
146146
// Pads must be set after spi_m_sync_init(), which uses default values from
147147
// the prototypical SERCOM.
148148

149-
// hri_sercomspi_write_CTRLA_MODE_bf(sercom, slave_mode ? 2 : 3); // this line makes circuitpython crash on a call to "mySpi.write()"
150-
// uint32_t SPI_CONFIG_OFFSETS[] = {0x40003000, 0x40003400, 0x43000000, 0x43000400, 0x43000800, 0x43000C00};
151-
// if (slave_mode) {
152-
// *((uint32_t*) SPI_CONFIG_OFFSETS[sercom_index]) &= ~(1<<2);
153-
// }
149+
hri_sercomspi_write_CTRLA_MODE_bf(sercom, slave_mode ? 2 : 3);
154150
hri_sercomspi_write_CTRLA_DOPO_bf(sercom, dopo);
155151
hri_sercomspi_write_CTRLA_DIPO_bf(sercom, miso_pad);
156152

0 commit comments

Comments
 (0)