10 static const char *
const TAG =
"ens160_spi.sensor";
12 inline uint8_t
reg_read(uint8_t reg) {
return (reg << 1) | 0x01; }
14 inline uint8_t
reg_write(uint8_t reg) {
return (reg << 1) & 0xFE; }
16 void ENS160SPIComponent::setup() {
21 void ENS160SPIComponent::dump_config() {
22 ENS160Component::dump_config();
23 LOG_PIN(
" CS Pin: ", this->
cs_);
34 bool ENS160SPIComponent::write_byte(uint8_t a_register, uint8_t data) {
42 bool ENS160SPIComponent::read_bytes(uint8_t a_register, uint8_t *data,
size_t len) {
50 bool ENS160SPIComponent::write_bytes(uint8_t a_register, uint8_t *data,
size_t len) {
void transfer_array(uint8_t *data, size_t length)
Write the array data, replace with received data.
void spi_setup() override
uint8_t transfer_byte(uint8_t data)
uint8_t reg_read(uint8_t reg)
void read_array(uint8_t *data, size_t length)
Implementation of SPI Controller mode.
uint8_t reg_write(uint8_t reg)