|
| SPIDevice () |
|
| SPIDevice (SPIComponent *parent, GPIOPin *cs_pin) |
|
void | spi_setup () override |
|
void | spi_teardown () override |
|
void | set_spi_parent (SPIComponent *parent) |
|
void | set_cs_pin (GPIOPin *cs) |
|
void | set_data_rate (uint32_t data_rate) |
|
void | set_bit_order (SPIBitOrder order) |
|
void | set_mode (SPIMode mode) |
|
uint8_t | read_byte () |
|
void | read_array (uint8_t *data, size_t length) |
|
void | write (uint16_t data, size_t num_bits) |
| Write a single data item, up to 32 bits. More...
|
|
void | write_cmd_addr_data (size_t cmd_bits, uint32_t cmd, size_t addr_bits, uint32_t address, const uint8_t *data, size_t length, uint8_t bus_width=1) |
|
void | write_byte (uint8_t data) |
|
void | transfer_array (uint8_t *data, size_t length) |
| Write the array data, replace with received data. More...
|
|
uint8_t | transfer_byte (uint8_t data) |
|
void | write_byte16 (uint16_t data) |
| Write 16 bit data. More...
|
|
void | write_array16 (const uint16_t *data, size_t length) |
| Write an array of data as 16 bit values, byte-swapping if required. More...
|
|
void | enable () |
|
void | disable () |
|
void | write_array (const uint8_t *data, size_t length) |
|
template<size_t N> |
void | write_array (const std::array< uint8_t, N > &data) |
|
void | write_array (const std::vector< uint8_t > &data) |
|
template<size_t N> |
void | transfer_array (std::array< uint8_t, N > &data) |
|
| SPIClient (SPIBitOrder bit_order, SPIMode mode, uint32_t data_rate) |
|
bool | spi_is_ready () |
|
template<SPIBitOrder BIT_ORDER, SPIClockPolarity CLOCK_POLARITY, SPIClockPhase CLOCK_PHASE, SPIDataRate DATA_RATE>
class esphome::spi::SPIDevice< BIT_ORDER, CLOCK_POLARITY, CLOCK_PHASE, DATA_RATE >
The SPIDevice is what components using the SPI will create.
- Template Parameters
-
BIT_ORDER | |
CLOCK_POLARITY | |
CLOCK_PHASE | |
DATA_RATE | |
Definition at line 391 of file spi.h.
template<SPIBitOrder BIT_ORDER, SPIClockPolarity CLOCK_POLARITY, SPIClockPhase CLOCK_PHASE, SPIDataRate DATA_RATE>
void esphome::spi::SPIDevice< BIT_ORDER, CLOCK_POLARITY, CLOCK_PHASE, DATA_RATE >::transfer_array |
( |
uint8_t * |
data, |
|
|
size_t |
length |
|
) |
| |
|
inline |
Write the array data, replace with received data.
- Parameters
-
Definition at line 447 of file spi.h.
template<SPIBitOrder BIT_ORDER, SPIClockPolarity CLOCK_POLARITY, SPIClockPhase CLOCK_PHASE, SPIDataRate DATA_RATE>
void esphome::spi::SPIDevice< BIT_ORDER, CLOCK_POLARITY, CLOCK_PHASE, DATA_RATE >::write |
( |
uint16_t |
data, |
|
|
size_t |
num_bits |
|
) |
| |
|
inline |
Write a single data item, up to 32 bits.
- Parameters
-
data | The data |
num_bits | The number of bits to write. The lower num_bits of data will be sent. |
Definition at line 423 of file spi.h.
template<SPIBitOrder BIT_ORDER, SPIClockPolarity CLOCK_POLARITY, SPIClockPhase CLOCK_PHASE, SPIDataRate DATA_RATE>
void esphome::spi::SPIDevice< BIT_ORDER, CLOCK_POLARITY, CLOCK_PHASE, DATA_RATE >::write_array16 |
( |
const uint16_t * |
data, |
|
|
size_t |
length |
|
) |
| |
|
inline |
Write an array of data as 16 bit values, byte-swapping if required.
Use of this should be avoided as it is horribly slow.
- Parameters
-
Definition at line 461 of file spi.h.