FastArduino v1.10
C++ library to build fast but small Arduino/AVR projects
Loading...
Searching...
No Matches
i2c::debug::I2CDebugStatusRecorder< SIZE_STATUS, SIZE_DEBUG > Class Template Reference

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

#include <fastarduino/i2c_debug.h>

Inheritance diagram for i2c::debug::I2CDebugStatusRecorder< SIZE_STATUS, SIZE_DEBUG >:
Collaboration diagram for i2c::debug::I2CDebugStatusRecorder< SIZE_STATUS, SIZE_DEBUG >:

Public Member Functions

 I2CDebugStatusRecorder (i2c::status::STATUS trace=i2c::status::STATUS::TRACE_ALL, DEBUG debug=DEBUG::DEBUG_ALL)
 Create an I2CDebugStatusRecorder that can record I2C notifications determined by debug list. More...
 
void reset ()
 Clear all recorded notifications. More...
 
template<typename OSTREAM >
void trace (OSTREAM &out, bool hex_status=true)
 Output all recorded I2C notifications to out then clear all records. More...
 
- Public Member Functions inherited from i2c::status::I2CStatusRecorder< SIZE_STATUS >
 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...
 
void trace (OSTREAM &out, bool hex_status=true)
 Output all recorded I2C status notifications to out then clear all records. More...
 
- Public Member Functions inherited from i2c::debug::I2CDebugRecorder< SIZE_DEBUG >
 I2CDebugRecorder (DEBUG debug=DEBUG::DEBUG_ALL)
 Create an I2CDebugRecorder that can record I2C notifications determined by debug list. More...
 
void reset ()
 Clear all recorded notifications. More...
 
void trace (OSTREAM &out)
 Output all recorded I2C notifications to out then clear all records. More...
 

Detailed Description

template<uint8_t SIZE_STATUS, uint8_t SIZE_DEBUG>
class i2c::debug::I2CDebugStatusRecorder< SIZE_STATUS, SIZE_DEBUG >

Class recording I2C debug and status notifications for later output.

Template Parameters
SIZE_STATUSthe maximum number of status notifications to record (each notification is 2 bytes)
SIZE_DEBUGthe maximum number of debug notifications to record (each notification is 2 bytes)
See also
i2c::debug::I2CDebugRecorder
i2c::status::I2CStatusRecorder

Definition at line 362 of file i2c_debug.h.

Constructor & Destructor Documentation

◆ I2CDebugStatusRecorder()

template<uint8_t SIZE_STATUS, uint8_t SIZE_DEBUG>
i2c::debug::I2CDebugStatusRecorder< SIZE_STATUS, SIZE_DEBUG >::I2CDebugStatusRecorder ( i2c::status::STATUS  trace = i2c::status::STATUS::TRACE_ALL,
DEBUG  debug = DEBUG::DEBUG_ALL 
)
inline

Create an I2CDebugStatusRecorder that can record I2C notifications determined by debug list.

The number of recorded notifications is limited by SIZE. Once SIZE notifications have been recorded by this I2CDebugRecorder, 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 debug notifications to be recorded
debugthe list of status notifications to be recorded
See also
trace()
reset()

Definition at line 384 of file i2c_debug.h.

Member Function Documentation

◆ reset()

template<uint8_t SIZE_STATUS, uint8_t SIZE_DEBUG>
void i2c::debug::I2CDebugStatusRecorder< SIZE_STATUS, SIZE_DEBUG >::reset ( )
inline

Clear all recorded notifications.

See also
trace()

Definition at line 392 of file i2c_debug.h.

◆ trace()

template<uint8_t SIZE_STATUS, uint8_t SIZE_DEBUG>
template<typename OSTREAM >
void i2c::debug::I2CDebugStatusRecorder< SIZE_STATUS, SIZE_DEBUG >::trace ( OSTREAM &  out,
bool  hex_status = true 
)
inline

Output all recorded I2C 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 406 of file i2c_debug.h.


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