M5Unified
m5::I2C_Device Class Reference

#include <I2C_Class.hpp>

Inheritance diagram for m5::I2C_Device:
Collaboration diagram for m5::I2C_Device:

Public Member Functions

 I2C_Device (std::uint8_t i2c_addr, std::uint32_t freq, I2C_Class *i2c=&In_I2C)
 
void setPort (I2C_Class *i2c)
 
bool writeRegister8 (std::uint8_t reg, std::uint8_t data) const
 
std::uint8_t readRegister8 (std::uint8_t reg) const
 
bool writeRegister8Array (const std::uint8_t *reg_data_array, std::size_t length) const
 
bool writeRegister (std::uint8_t reg, const std::uint8_t *data, std::size_t length) const
 
bool readRegister (std::uint8_t reg, std::uint8_t *result, std::size_t length) const
 
bool bitOn (std::uint8_t reg, std::uint8_t bit) const
 
bool bitOff (std::uint8_t reg, std::uint8_t bit) const
 
bool isEnabled (void) const
 

Protected Attributes

I2C_Class_i2c
 
std::uint32_t _freq
 
std::uint8_t _addr
 
bool _init
 

Detailed Description

Definition at line 148 of file I2C_Class.hpp.

Constructor & Destructor Documentation

◆ I2C_Device()

m5::I2C_Device::I2C_Device ( std::uint8_t  i2c_addr,
std::uint32_t  freq,
I2C_Class i2c = &In_I2C 
)
inline

Definition at line 151 of file I2C_Class.hpp.

Member Function Documentation

◆ bitOff()

bool m5::I2C_Device::bitOff ( std::uint8_t  reg,
std::uint8_t  bit 
) const
inline

Definition at line 187 of file I2C_Class.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bitOn()

bool m5::I2C_Device::bitOn ( std::uint8_t  reg,
std::uint8_t  bit 
) const
inline

Definition at line 182 of file I2C_Class.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isEnabled()

bool m5::I2C_Device::isEnabled ( void  ) const
inline

Definition at line 192 of file I2C_Class.hpp.

Here is the caller graph for this function:

◆ readRegister()

bool m5::I2C_Device::readRegister ( std::uint8_t  reg,
std::uint8_t *  result,
std::size_t  length 
) const
inline

Definition at line 177 of file I2C_Class.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readRegister8()

std::uint8_t m5::I2C_Device::readRegister8 ( std::uint8_t  reg) const
inline

Definition at line 165 of file I2C_Class.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setPort()

void m5::I2C_Device::setPort ( I2C_Class i2c)
inline

Definition at line 158 of file I2C_Class.hpp.

◆ writeRegister()

bool m5::I2C_Device::writeRegister ( std::uint8_t  reg,
const std::uint8_t *  data,
std::size_t  length 
) const
inline

Definition at line 172 of file I2C_Class.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeRegister8()

bool m5::I2C_Device::writeRegister8 ( std::uint8_t  reg,
std::uint8_t  data 
) const
inline

Definition at line 160 of file I2C_Class.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeRegister8Array()

bool m5::I2C_Device::writeRegister8Array ( const std::uint8_t *  reg_data_array,
std::size_t  length 
) const

Definition at line 109 of file I2C_Class.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _addr

std::uint8_t m5::I2C_Device::_addr
protected

Definition at line 197 of file I2C_Class.hpp.

◆ _freq

std::uint32_t m5::I2C_Device::_freq
protected

Definition at line 196 of file I2C_Class.hpp.

◆ _i2c

I2C_Class* m5::I2C_Device::_i2c
protected

Definition at line 195 of file I2C_Class.hpp.

◆ _init

bool m5::I2C_Device::_init
protected

Definition at line 198 of file I2C_Class.hpp.


The documentation for this class was generated from the following files: