FastArduino v1.10
C++ library to build fast but small Arduino/AVR projects
Loading...
Searching...
No Matches
i2c::status::I2CStatusRecorder< SIZE > Class Template Reference

Class recording I2C status notifications for later output. More...

#include <fastarduino/i2c_status.h>

Public Member Functions

 I2CStatusRecorder (STATUS trace=STATUS::TRACE_ALL)
 Create an I2CStatusRecorder that can record I2C status notifications determined by trace. More...
 
void reset ()
 Clear all recorded notifications. More...
 
template<typename OSTREAM >
void trace (OSTREAM &out, bool hex_status=true)
 Output all recorded I2C status notifications to out then clear all records. More...
 

Detailed Description

template<uint8_t SIZE>
class i2c::status::I2CStatusRecorder< SIZE >

Class recording I2C status notifications for later output.

Template Parameters
SIZEthe maximum number of notifications to record (each notification is 2 bytes)

Definition at line 60 of file i2c_status.h.

Constructor & Destructor Documentation

◆ I2CStatusRecorder()

template<uint8_t SIZE>
i2c::status::I2CStatusRecorder< SIZE >::I2CStatusRecorder ( STATUS  trace = STATUS::TRACE_ALL)
inlineexplicit

Create an I2CStatusRecorder that can record I2C status notifications determined by trace.

list. The number of recorded notifications is limited by SIZE. Once SIZE notifications have been recorded by this I2CStatusRecorder, any additional notification will be trashed. To be effective, this must be attached to an I2C Manager (at construction time). Recorded notifications can be output to a streams::ostream with trace().

Parameters
tracethe list of notifications to be recorded
See also
trace()
reset()

Definition at line 77 of file i2c_status.h.

Member Function Documentation

◆ reset()

template<uint8_t SIZE>
void i2c::status::I2CStatusRecorder< SIZE >::reset ( )
inline

Clear all recorded notifications.

See also
trace()

Definition at line 83 of file i2c_status.h.

◆ trace()

template<uint8_t SIZE>
template<typename OSTREAM >
void i2c::status::I2CStatusRecorder< SIZE >::trace ( OSTREAM &  out,
bool  hex_status = true 
)
inline

Output all recorded I2C status notifications to out then clear all records.

Parameters
outthe streams::ostream to output traces to
hex_statusif true (the default), status values will be displayed in hexadecimal, otherwise status name will be displayed
See also
reset()

Definition at line 96 of file i2c_status.h.


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