SPI.begin() SPI.setClockDivider(divider) SPI.setDataMode(mode) SPI.setBitOrder(order) SPI.transfer(data);
SPI.begin() SPI.beginTransaction(SPISettings(speed, order, mode)) SPI.transfer(data); SPI.endTransaction()
SPI.begin() #if defined(SPI_HAS_TRANSACTION) SPI.beginTransaction(spiSettings); #endif uint8_t value = SPI.transfer(data); #if defined(SPI_HAS_TRANSACTION) SPI.endTransaction(); #endif
NRF24L01 (JP2) 1 GND 2 3V3 3 PB6 NRF_CE 4 PB7 NRF_CS 5 PB3 SPI1_SCK 6 PB5 SPI1_MOSI 7 PB4 SPI1_MISO 8 PB8 NRF_IRQ SPI Flash W25Q16 (U3) 1 PB0 F_CS 2 PB4 SPI1_MISO 3 WP 3V3 4 GND 5 PB5 SPI1_MOSI 6 PB3 SPI1_SCK 7 HOLD 3V3 8 VCC 3V3
/* * Nrf24l Mirf = Nrf24l(PB0, PB1); * * VCC 3.3V * MISO PB14 * MOSI PB15 * SCK PB13 * CE PB0 * CSN PB1 */ void setup() { SPI.setMOSI(PB15); SPI.setMISO(PB14); SPI.setSCLK(PB13); SPI.setSSEL(PB12); 以下略