Skip to content

Commit c07741b

Browse files
committed
fix: set LSB for spi
1 parent 3ecdf0d commit c07741b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: src/PN532_SPI.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ void PN532_SPI::begin()
2020
pinMode(_ss, OUTPUT);
2121

2222
_spi->begin();
23+
_spi->beginTransaction(SPISettings(1000000, LSBFIRST, SPI_MODE0));
2324
#if defined(ARDUINO_XIAO_RA4M1) || defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_ARCH_RP2350)
2425
#else
25-
_spi->setDataMode(SPI_MODE0); // PN532 only supports mode0
26-
_spi->setBitOrder(LSBFIRST);
26+
// _spi->setDataMode(SPI_MODE0); // PN532 only supports mode0
27+
// _spi->setBitOrder(LSBFIRST);
2728
#if defined __SAM3X8E__
2829
/** DUE spi library does not support SPI_CLOCK_DIV8 macro */
2930
_spi->setClockDivider(42); // set clock 2MHz(max: 5MHz)

0 commit comments

Comments
 (0)