Class ArchAVR_USI

Nested Relationships

Nested Types

Inheritance Relationships

Base Type

Class Documentation

class ArchAVR_USI : public Peripheral

Implementation of a Universal Serial Interface for AVR series.

Unsupported features:

Public Functions

explicit ArchAVR_USI(const ArchAVR_USIConfig &config)
virtual ~ArchAVR_USI()
virtual bool init(Device &device) override

Virtual method called when the device is initialised. This is where the peripheral can allocate its I/O registers, interrupts or connect signals.

Returns:

boolean indicates the success of all allocations.

virtual void reset() override

Virtual method called when the device is reset. Note that resetting I/O registers is only necessary here if their reset value is not zero.

virtual void ioreg_write_handler(reg_addr_t addr, const ioreg_write_t &data) override

Virtual method called when the CPU is writing a I/O register allocated by this peripheral. The value has already been written.

Parameters:
  • addr – the register address in I/O space

  • value – the new register content

class _PinDriver : public PinDriver

Public Functions

_PinDriver(ArchAVR_USI &per)
bool line_state(pin_index_t) const
void set_line_state(pin_index_t index, bool state)
void set_clock_hold(bool hold)
virtual Pin::controls_t override_gpio(pin_index_t pin_index, const Pin::controls_t &gpio_controls) override

Stub called when a state resolution is taking place on a pin that the driver is controlling. The reimplementation should make a copy of the controls structure in argument, change its members according to the override state and return the result.

Parameters:
  • pin_index – index of the pin

  • controls – pin controls as configured by the GPIO port controller

Returns:

the controls to apply to the pin

virtual void digital_state_changed(pin_index_t pin_index, bool dig_state) override

Stub called when the digital state of a pin has changed after a state resolution.

Parameters:
  • pin_index – Index of the pin

  • state – New digital state of the pin