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

Data Structures

class  WeikaiComponentSPI
 The WeikaiComponentSPI class stores the information to the WeiKai component connected through an SPI bus. More...
 
class  WeikaiRegisterSPI
 WeikaiRegisterSPI objects acts as proxies to access remote register through an SPI Bus. More...
 

Enumerations

enum  RegType { REG = 0, FIFO = 1 }
 
enum  CmdType { WRITE_CMD = 0, READ_CMD = 1 }
 

Functions

std::string i2s (uint8_t val)
 convert an int to binary representation as C++ std::string More...
 
uint32_t elapsed_ms (uint32_t &last_time)
 measure the time elapsed between two calls More...
 
const char * p2s (uart::UARTParityOptions parity)
 Converts the parity enum value to a C string. More...
 
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)
 

Enumeration Type Documentation

◆ CmdType

Enumerator
WRITE_CMD 
READ_CMD 

Definition at line 80 of file weikai_spi.cpp.

◆ RegType

Enumerator
REG 
FIFO 

Definition at line 79 of file weikai_spi.cpp.

Function Documentation

◆ elapsed_ms()

uint32_t esphome::weikai_spi::elapsed_ms ( uint32_t &  last_time)

measure the time elapsed between two calls

Parameters
last_timetime of the previous call
Returns
the elapsed time in microseconds

Definition at line 23 of file weikai_spi.cpp.

◆ i2s()

std::string esphome::weikai_spi::i2s ( uint8_t  val)
inline

convert an int to binary representation as C++ std::string

Parameters
valinteger to convert
Returns
a std::string

Definition at line 16 of file weikai_spi.cpp.

◆ p2s()

const char* esphome::weikai_spi::p2s ( uart::UARTParityOptions  parity)

Converts the parity enum value to a C string.

Parameters
parityenum
Returns
the string

Definition at line 32 of file weikai_spi.cpp.

◆ print_buffer()

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

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

Definition at line 47 of file weikai_spi.cpp.

◆ reg_to_str()

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

Definition at line 69 of file weikai_spi.cpp.