#include <chip_selector.h>
Public Member Functions | |
virtual Status | SetActive (bool active)=0 |
Status | Activate () |
Status | Deactivate () |
The ChipSelector class provides an abstract interface for controlling the chip-select signal associated with a specific SPI responder.
This interface provides a SetActive()
method, which activates/deactivates the device based on the value of the active
parameter. The associated Activate()
and Deactivate()
methods are utility wrappers for SetActive(true)
and SetActive(false)
, respectively.
A concrete implementation of this interface class must be provided in order to use the SPI HAL to communicate with a responder.
Active
does not imply a specific logic-level; it is left to the implementor to correctly map logic-levels to the device's active/inactive states.
|
inline |
Helper method to activate the chip-select signal.
embed:rst:leading-asterisk * * .. pw-status-codes:: * * OK: Success. * * Returns other implementation-specific values on failure. * *
|
inline |
Helper method to deactivate the chip-select signal.
embed:rst:leading-asterisk * * .. pw-status-codes:: * * OK: Success. * * Returns other implementation-specific values on failure. * *
|
pure virtual |
SetActive sets the state of the chip-select signal to the value represented by the active
parameter. Passing a value of true
will activate the chip-select signal, and false
will deactivate the chip-select signal.
embed:rst:leading-asterisk * * .. pw-status-codes:: * * OK: Success. * * Returns other implementation-specific values on failure. * *
Implemented in pw::spi::DigitalOutChipSelector.