_Controller Class Reference

yasimavr: ArchXT_SPI::_Controller Class Reference
yasimavr
Loading...
Searching...
No Matches
ArchXT_SPI::_Controller Class Reference
Inheritance diagram for ArchXT_SPI::_Controller:
SPI::EndPoint CycleTimer

Public Member Functions

 _Controller (ArchXT_SPI &peripheral)
 
PinDriverpin_driver ()
 
void init (CycleManager &cycle_manager, Logger &logger)
 
void reset ()
 
void set_bit_delay (cycle_count_t delay)
 
void set_mode (ControllerMode mode)
 
ControllerMode mode () const
 
void set_serial_mode (SerialMode mode)
 
void push_tx (uint8_t data, bool force_buffer)
 
bool tx_pending () const
 
uint8_t pop_rx ()
 
uint8_t peek_rx () const
 
unsigned int rx_available () const
 
uint8_t mock_transfer (uint8_t rx_frame)
 
void input_clock (bool state)
 
void set_selected (bool selected)
 
bool selected () const
 
virtual cycle_count_t next (cycle_count_t when) override
 Callback from the cycle loop.
 
- Public Member Functions inherited from SPI::EndPoint
 EndPoint ()
 
virtual ~EndPoint ()=default
 
void set_serial_mode (SerialMode mode)
 
SerialMode serial_mode () const
 
void set_bit_order (BitOrder order)
 
BitOrder bit_order () const
 
void set_shift_data (uint8_t frame)
 
uint8_t shift_data () const
 
bool complete_frame () const
 Returns true when a complete byte has been transferred/received.
 
- Public Member Functions inherited from CycleTimer
 CycleTimer ()
 
 CycleTimer (const CycleTimer &other)
 
virtual ~CycleTimer ()
 
bool scheduled () const
 Returns true if this timer is scheduled with a manager.
 
bool paused () const
 
cycle_count_t remaining_delay () const
 
CycleTimeroperator= (const CycleTimer &other)
 

Protected Member Functions

virtual void frame_completed () override
 
virtual void write_data_output (bool level) override
 
virtual bool read_data_input () override
 
- Protected Member Functions inherited from SPI::EndPoint
void set_active (bool active)
 Enable/disable the endpoint A disabled endpoint will ignore any clock change but still keeps track of them.
 
bool active () const
 
void set_shift_clock (bool state)
 
bool shift_clock () const
 

Constructor & Destructor Documentation

◆ _Controller()

ArchXT_SPI::_Controller::_Controller ( ArchXT_SPI peripheral)
explicit

Member Function Documentation

◆ frame_completed()

void ArchXT_SPI::_Controller::frame_completed ( )
overrideprotectedvirtual

Virtual callback function called on the last clock edge of a byte shift. Can be overriden by upper layers to signal when the transmission/reception of a byte has been completed. The base function does nothing.

Reimplemented from SPI::EndPoint.

◆ init()

void ArchXT_SPI::_Controller::init ( CycleManager cycle_manager,
Logger logger 
)

◆ input_clock()

void ArchXT_SPI::_Controller::input_clock ( bool  state)
inline

◆ mock_transfer()

uint8_t ArchXT_SPI::_Controller::mock_transfer ( uint8_t  rx_frame)

◆ mode()

ControllerMode ArchXT_SPI::_Controller::mode ( ) const
inline

◆ next()

cycle_count_t ArchXT_SPI::_Controller::next ( cycle_count_t  when)
overridevirtual

Callback from the cycle loop.

Note
there's no guarantee the method will be called exactly on the required 'when' cycle. The only guarantee is "called 'when' <= 'current cycle'", the implementations must account for this.
Parameters
whencurrent 'when' cycle, at which the timer was scheduled
Returns
the next 'when' the timer requires to be called at.
Note
The next 'when' can be in the 'past' (i.e. <= 'current cycle'). In this case, the timer will be called again within the same cycle with the given next 'when'. The only constraint is that it must be greater than the previous 'when'. If it's negative or zero, the timer is removed from the queue.

Implements CycleTimer.

◆ peek_rx()

uint8_t ArchXT_SPI::_Controller::peek_rx ( ) const

◆ pin_driver()

PinDriver & ArchXT_SPI::_Controller::pin_driver ( )
inline

◆ pop_rx()

uint8_t ArchXT_SPI::_Controller::pop_rx ( )

◆ push_tx()

void ArchXT_SPI::_Controller::push_tx ( uint8_t  data,
bool  force_buffer 
)

◆ read_data_input()

bool ArchXT_SPI::_Controller::read_data_input ( )
overrideprotectedvirtual

Virtual function called by the internal logic to read the DATA IN line

Returns
level Line level true=HIGH, false=LOW

Implements SPI::EndPoint.

◆ reset()

void ArchXT_SPI::_Controller::reset ( )

◆ rx_available()

unsigned int ArchXT_SPI::_Controller::rx_available ( ) const
inline

◆ selected()

bool ArchXT_SPI::_Controller::selected ( ) const
inline

◆ set_bit_delay()

void ArchXT_SPI::_Controller::set_bit_delay ( cycle_count_t  delay)

◆ set_mode()

void ArchXT_SPI::_Controller::set_mode ( ControllerMode  mode)

◆ set_selected()

void ArchXT_SPI::_Controller::set_selected ( bool  selected)

◆ set_serial_mode()

void ArchXT_SPI::_Controller::set_serial_mode ( SPI::SerialMode  mode)

◆ tx_pending()

bool ArchXT_SPI::_Controller::tx_pending ( ) const
inline

◆ write_data_output()

void ArchXT_SPI::_Controller::write_data_output ( bool  level)
overrideprotectedvirtual

Virtual function called by the internal logic to write to the DATA OUT line

Parameters
levelLine level true=HIGH, false=LOW

Implements SPI::EndPoint.


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