Skip to content

Class HardwareI2C

ClassList > HardwareI2C

Inherits the following classes: Stream

Public Functions

Type Name
virtual int available () = 0
bool begin ()
bool begin (uint8_t address)
virtual bool begin (int8_t sda, int8_t scl, uint32_t frequency=0) = 0
virtual bool begin (uint8_t address, int8_t sda, int8_t scl, uint32_t frequency=0) = 0
virtual void beginTransmission (uint8_t address) = 0
virtual bool end () = 0
virtual uint8_t endTransmission (bool stopBit) = 0
uint8_t endTransmission ()
virtual void flush () = 0
uint32_t getClock ()
void onReceive (void(*)(int) cb)
void onRequest (void(*)(void) cb)
virtual int peek () = 0
virtual int read () = 0
virtual size_t requestFrom (uint8_t address, size_t len, bool stopBit) = 0
size_t requestFrom (uint8_t address, size_t len)
virtual bool setClock (uint32_t freq) = 0
virtual bool setPins (int8_t sda, int8_t scl) = 0
virtual size_t write (const uint8_t * data, size_t len) = 0
virtual size_t write (uint8_t data)

Protected Attributes

Type Name
uint32_t _freq = = 0
int8_t _scl = = -1
int8_t _sda = = -1
void(* onReceiveCallback
void(* onRequestCallback

Public Functions Documentation

function available

virtual int HardwareI2C::available () = 0

function begin [1/4]

inline bool HardwareI2C::begin () 

function begin [2/4]

inline bool HardwareI2C::begin (
    uint8_t address
) 

function begin [3/4]

virtual bool HardwareI2C::begin (
    int8_t sda,
    int8_t scl,
    uint32_t frequency=0
) = 0

function begin [4/4]

virtual bool HardwareI2C::begin (
    uint8_t address,
    int8_t sda,
    int8_t scl,
    uint32_t frequency=0
) = 0

function beginTransmission

virtual void HardwareI2C::beginTransmission (
    uint8_t address
) = 0

function end

virtual bool HardwareI2C::end () = 0

function endTransmission [1/2]

virtual uint8_t HardwareI2C::endTransmission (
    bool stopBit
) = 0

function endTransmission [2/2]

inline uint8_t HardwareI2C::endTransmission () 

function flush

virtual void HardwareI2C::flush () = 0

function getClock

inline uint32_t HardwareI2C::getClock () 

function onReceive

inline void HardwareI2C::onReceive (
    void(*)(int) cb
) 

function onRequest

inline void HardwareI2C::onRequest (
    void(*)(void) cb
) 

function peek

virtual int HardwareI2C::peek () = 0

function read

virtual int HardwareI2C::read () = 0

function requestFrom [1/2]

virtual size_t HardwareI2C::requestFrom (
    uint8_t address,
    size_t len,
    bool stopBit
) = 0

function requestFrom [2/2]

inline size_t HardwareI2C::requestFrom (
    uint8_t address,
    size_t len
) 

function setClock

virtual bool HardwareI2C::setClock (
    uint32_t freq
) = 0

function setPins

virtual bool HardwareI2C::setPins (
    int8_t sda,
    int8_t scl
) = 0

function write [1/2]

virtual size_t HardwareI2C::write (
    const uint8_t * data,
    size_t len
) = 0

function write [2/2]

inline virtual size_t HardwareI2C::write (
    uint8_t data
) 

Protected Attributes Documentation

variable _freq

uint32_t HardwareI2C::_freq;

variable _scl

int8_t HardwareI2C::_scl;

variable _sda

int8_t HardwareI2C::_sda;

variable onReceiveCallback

void(* HardwareI2C::onReceiveCallback) (int);

variable onRequestCallback

void(* HardwareI2C::onRequestCallback) (void);

The documentation for this class was generated from the following file cores/common/arduino/src/HardwareI2C.h