Class TWIEndPoint

Inheritance Relationships

Derived Type

Class Documentation

class TWIEndPoint

An endpoint connected to a TWI bus. Represents a device connected to a TWI bus model and acting as a master, a slave or both.

See also

TWI_Bus, TWI_Packet

Subclassed by TWI

Public Functions

TWIEndPoint()
virtual ~TWIEndPoint()
inline TWIBus *bus() const
TWIEndPoint(const TWIEndPoint&) = delete
TWIEndPoint &operator=(const TWIEndPoint&) = delete

Protected Functions

bool acquire_bus()

Used by a master endpoint to get ownership of the bus.

Returns:

true if the endpoint won the acquisition arbitration, false if it lost.

void release_bus()

Releases the bus ownership.

void send_packet(TWIPacket &packet)

Send a packet over the bus.

Parameters:

packet – Packet to circulate on the bus. Note that it may be modified on-the-fly.

void end_packet(TWIPacket &packet)

End a ‘long’ packet over the bus.

Parameters:

packet – Packet to circulate on the bus. Note that it may be modified on-the-fly.

virtual void packet(TWIPacket &packet) = 0

Called by the bus to transmit a packet.

virtual void packet_ended(TWIPacket &packet) = 0

Called by the bus to end a packet.

virtual void bus_acquired() = 0

Called by the bus to notify that the bus is acquired.

virtual void bus_released() = 0

Called by the bus to notify that the bus is released.