ESPHome  2024.11.1
Data Structures | Enumerations | Functions
esphome::weikai_i2c Namespace Reference

Data Structures

class  WeikaiComponentI2C
 The WeikaiComponentI2C class stores the information to the WeiKai component connected through an I2C bus. More...
 
class  WeikaiRegisterI2C
 WeikaiRegisterI2C objects acts as proxies to access remote register through an I2C Bus. More...
 

Enumerations

enum  RegType { REG = 0, FIFO = 1 }
 

Functions

void print_buffer (const uint8_t *data, size_t length)
 Display a buffer in hexadecimal format (32 hex values / line). More...
 
const char * reg_to_str (int reg, bool page1)
 
uint8_t i2c_address (uint8_t base_address, uint8_t channel, RegType fifo)
 Computes the I²C bus's address used to access the component. More...
 

Enumeration Type Documentation

◆ RegType

Enumerator
REG 
FIFO 

Definition at line 44 of file weikai_i2c.cpp.

Function Documentation

◆ i2c_address()

uint8_t esphome::weikai_i2c::i2c_address ( uint8_t  base_address,
uint8_t  channel,
RegType  fifo 
)
inline

Computes the I²C bus's address used to access the component.

Parameters
base_addressthe base address of the component - set by the A1 A0 pins
channel(0-3) the UART channel
fifo(0-1) 0 = access to internal register, 1 = direct access to fifo
Returns
the i2c address to use

Definition at line 51 of file weikai_i2c.cpp.

◆ print_buffer()

void esphome::weikai_i2c::print_buffer ( const uint8_t *  data,
size_t  length 
)

Display a buffer in hexadecimal format (32 hex values / line).

Definition at line 13 of file weikai_i2c.cpp.

◆ reg_to_str()

const char* esphome::weikai_i2c::reg_to_str ( int  reg,
bool  page1 
)

Definition at line 35 of file weikai_i2c.cpp.