Corium 1.1.0
High-Performance Zero-Heap C++20 MPSC Application Runtime
Loading...
Searching...
No Matches
corium::embedded::I2cIsrAdapter< EventVariant > Class Template Reference

Non-blocking hardware ISR adapter for I2C master/slave controllers. Dispatches completed I2C read/write transactions directly into the Corium lock-free ring buffer. More...

#include <I2cAdapter.hpp>

+ Collaboration diagram for corium::embedded::I2cIsrAdapter< EventVariant >:

Public Member Functions

 I2cIsrAdapter (EventSinkT< EventVariant > sink) noexcept
 
template<typename TargetEvent = I2cFrame<32>, size_t MaxPayload = 32>
void postFromIsr (const I2cFrame< MaxPayload > &frame, EventPriority priority=EventPriority::Normal) noexcept
 Post an I2C frame from ISR context into the event sink.
 
template<typename TargetEvent = I2cFrame<32>>
void postReadFromIsr (uint16_t devAddr, uint8_t regAddr, std::span< const uint8_t > readBytes, uint8_t status=0, EventPriority priority=EventPriority::Normal) noexcept
 Construct and post an I2C read result frame from ISR context.
 

Detailed Description

template<typename EventVariant>
class corium::embedded::I2cIsrAdapter< EventVariant >

Non-blocking hardware ISR adapter for I2C master/slave controllers. Dispatches completed I2C read/write transactions directly into the Corium lock-free ring buffer.

Constructor & Destructor Documentation

◆ I2cIsrAdapter()

template<typename EventVariant >
corium::embedded::I2cIsrAdapter< EventVariant >::I2cIsrAdapter ( EventSinkT< EventVariant >  sink)
inlineexplicitnoexcept

Member Function Documentation

◆ postFromIsr()

template<typename EventVariant >
template<typename TargetEvent = I2cFrame<32>, size_t MaxPayload = 32>
void corium::embedded::I2cIsrAdapter< EventVariant >::postFromIsr ( const I2cFrame< MaxPayload > &  frame,
EventPriority  priority = EventPriority::Normal 
)
inlinenoexcept

Post an I2C frame from ISR context into the event sink.

Template Parameters
TargetEventUser event type constructible from I2cFrame or I2cFrame itself.
MaxPayloadPayload capacity of the frame.
Parameters
frameThe completed I2C transaction frame.
priorityPriority to assign.

◆ postReadFromIsr()

template<typename EventVariant >
template<typename TargetEvent = I2cFrame<32>>
void corium::embedded::I2cIsrAdapter< EventVariant >::postReadFromIsr ( uint16_t  devAddr,
uint8_t  regAddr,
std::span< const uint8_t >  readBytes,
uint8_t  status = 0,
EventPriority  priority = EventPriority::Normal 
)
inlinenoexcept

Construct and post an I2C read result frame from ISR context.

Template Parameters
TargetEventUser event type.
Parameters
devAddrSlave device address.
regAddrRegister address read from.
readBytesSpan of received bytes.
statusHardware status code.
priorityEvent priority.

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