Pigweed
 
Loading...
Searching...
No Matches
pw::spi::ChipSelector Class Referenceabstract

#include <chip_selector.h>

Inheritance diagram for pw::spi::ChipSelector:
pw::spi::DigitalOutChipSelector

Public Member Functions

virtual Status SetActive (bool active)=0
 
Status Activate ()
 
Status Deactivate ()
 

Detailed Description

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.

Note
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.

Member Function Documentation

◆ Activate()

Status pw::spi::ChipSelector::Activate ( )
inline

Helper method to activate the chip-select signal.

Returns
embed:rst:leading-asterisk
 
* 
*  .. pw-status-codes::
* 
*     OK: Success.
* 
*  Returns other implementation-specific values on failure.
* 
*  

◆ Deactivate()

Status pw::spi::ChipSelector::Deactivate ( )
inline

Helper method to deactivate the chip-select signal.

Returns
embed:rst:leading-asterisk
 
* 
*  .. pw-status-codes::
* 
*     OK: Success.
* 
*  Returns other implementation-specific values on failure.
* 
*  

◆ SetActive()

virtual Status pw::spi::ChipSelector::SetActive ( bool  active)
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.

Returns
embed:rst:leading-asterisk
 
* 
*  .. pw-status-codes::
* 
*     OK: Success.
* 
*  Returns other implementation-specific values on failure.
* 
*  

Implemented in pw::spi::DigitalOutChipSelector.


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