44 template<
typename OSTREAM> OSTREAM& operator<<(OSTREAM& out,
i2c::DebugStatus status)
91 return out << convert(status);
172 template<
typename OSTREAM>
175 for (uint8_t i = 0; i < index_; ++i)
194 out << data_[i] <<
' ';
206 if (index_ >= SIZE)
return;
219 status_[index_] = status;
220 data_[index_++] = data;
227 status_[index_] = status;
228 data_[index_++] = data;
235 status_[index_] = status;
236 data_[index_++] = data;
243 status_[index_] = status;
244 data_[index_++] = data;
251 status_[index_] = status;
252 data_[index_++] = data;
274 template<
typename OSTREAM>
290 bool display =
false;
361 template<u
int8_t SIZE_STATUS, u
int8_t SIZE_DEBUG>
405 template<
typename OSTREAM>
406 void trace(OSTREAM& out,
bool hex_status =
true)
420 template<
typename OSTREAM>
444 bool hex_status =
true)
Class tracing I2C debug notifications live to out.
I2CDebugLiveLogger(OSTREAM &out, DEBUG debug=DEBUG::DEBUG_ALL)
Create an I2CDebugLiveLogger that can trace live I2C notifications determined by debug list.
Class recording I2C debug notifications for later output.
void reset()
Clear all recorded notifications.
I2CDebugRecorder(DEBUG debug=DEBUG::DEBUG_ALL)
Create an I2CDebugRecorder that can record I2C notifications determined by debug list.
void trace(OSTREAM &out)
Output all recorded I2C notifications to out then clear all records.
Class tracing I2C status and debug notifications live to out.
I2CDebugStatusLiveLogger(OSTREAM &out, i2c::status::STATUS trace=i2c::status::STATUS::TRACE_ALL, DEBUG debug=DEBUG::DEBUG_ALL, bool hex_status=true)
Create an I2CDebugLiveLogger that can trace live I2C notifications determined by debug and trace list...
Class recording I2C debug and status notifications for later output.
void reset()
Clear all recorded notifications.
void trace(OSTREAM &out, bool hex_status=true)
Output all recorded I2C notifications to out then clear all records.
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.
Class tracing I2C status notifications live to out.
I2CStatusLiveLogger(OSTREAM &out, STATUS trace=STATUS::TRACE_ALL, bool hex_status=true)
Create an I2CStatusLiveLogger that can trace live I2C notifications determined by trace.
Class recording I2C status notifications for later output.
I2CStatusRecorder(STATUS trace=STATUS::TRACE_ALL)
Create an I2CStatusRecorder that can record I2C status notifications determined by trace.
void trace(OSTREAM &out, bool hex_status=true)
Output all recorded I2C status notifications to out then clear all records.
void reset()
Clear all recorded notifications.
static constexpr fmtflags basefield
Bitmask constant used with setf(fmtflags, fmtflags) when changing the output base format.
static constexpr fmtflags hex
Read or write integral values using hexadecimal (0..9,A..F) base format.
#define F(ptr)
Force string constant to be stored as flash storage.
I2C status hook utilities.
Defines API to ease I2C devices debugging.
DEBUG
Indicate what in I2C protocol shall be debugged.
@ DEBUG_SEND_OK
Debug successfully written bytes.
@ DEBUG_RECV_OK
Debug successfully received bytes.
@ DEBUG_RECV_ERR
Debug error during receiving bytes.
@ DEBUG_STEPS
Debug all individual steps of I2C protocol:
@ DEBUG_ALL
Debug everything.
@ DEBUG_SEND_ERR
Debug written bytes not acknowledged by slave.
STATUS
Indicate when status should be traced.
@ TRACE_ALL
Trace everything.
Define API to define and manage I2C devices.
DebugStatus
List of debug states that are reported by the I2C Manager in debug mode.
@ SEND_OK
The latest sent byte has been acknowledged by the slave.
@ SEND_ERROR
The latest sent byte has not been acknowledged by the slave.
@ SLAR
A slave address has just been sent for reading.
@ RECV_OK
I2C Manager has acknowledged the latest received byte from the slave.
@ SEND
A byte has just be sent to the slave.
@ STOP
A stop condition has just been sent.
@ REPEAT_START
A repeat start condition has just been sent.
@ RECV_LAST
The last byte is being received from the slave.
@ START
A start condition has just been sent.
@ RECV
A byte is being received from the slave.
@ RECV_ERROR
I2C Manager has not acknowledged the latest received byte from the slave.
@ SLAW
A slave address has just been sent for writing.