M5UnitUnified 0.0.5 git rev:3b942a7
Loading...
Searching...
No Matches
m5::unit::Adapter Class Reference

Adapters to treat M5HAL and TwoWire in the same way. More...

#include <adapter.hpp>

Public Member Functions

 Adapter (const Adapter &)=delete
 
 Adapter (Adapter &&) noexcept=default
 
Adapteroperator= (const Adapter &)=delete
 
Adapteroperator= (Adapter &&) noexcept=default
 
uint8_t address () const
 
uint32_t clock () const
 
void setClock (const uint32_t clock)
 
int16_t scl () const
 
int16_t sda () const
 
Adapterduplicate (const uint8_t addr)
 Dupicate adapter.
 
m5::hal::error::error_t generalCall (const uint8_t *data, const size_t len)
 write to address zero (general call)
 
Constructor
 Adapter (const uint8_t addr)
 
 Adapter (TwoWire &wire, const uint8_t addr)
 
 Adapter (m5::hal::bus::Bus *bus, const uint8_t addr)
 
 Adapter (m5::hal::bus::Bus &bus, const uint8_t addr)
 
R/W
m5::hal::error::error_t readWithTransaction (uint8_t *data, const size_t len)
 Reading data with transactions.
 
m5::hal::error::error_t writeWithTransaction (const uint8_t *data, const size_t len, const bool stop=true)
 Writeing data with transactions *‍/.
 
m5::hal::error::error_t writeWithTransaction (const uint8_t reg, const uint8_t *data, const size_t len, const bool stop=true)
 Writeing data with transactions (reg8)*‍/.
 
m5::hal::error::error_t writeWithTransaction (const uint16_t reg, const uint8_t *data, const size_t len, const bool stop=true)
 Writeing data with transactions (reg16) *‍/.
 
Temporary API
Warning
Functionality required for a specific unit
Will be improved when integrated with M5HAL
bool begin ()
 
bool end ()
 
void pinMode (uint8_t pin, uint8_t mode)
 
void digitalWrite (uint8_t pin, uint8_t val)
 
bool pushPin ()
 
bool popPin ()
 

Protected Attributes

std::unique_ptr< Impl > _impl {}
 
gpio::pin_backup_t _backupSCL {-1}
 
gpio::pin_backup_t _backupSDA {-1}
 

Detailed Description

Adapters to treat M5HAL and TwoWire in the same way.