ISF15ACP4 Driver 1.0.0
API reference
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
isf15acp4::SpiInterface< Derived > Class Template Reference

CRTP transport interface for SPI writes and GPIO control. More...

#include <isf15acp4_spi_interface.hpp>

Public Member Functions

bool EnsureInitialized () noexcept
 Ensure SPI bus and GPIO pins are configured.
 
bool BeginCommand () noexcept
 Begin an SPI transaction with D/C in command mode.
 
bool BeginData () noexcept
 Begin an SPI transaction with D/C in data mode.
 
void EndTransaction () noexcept
 End the active SPI transaction (typically deassert CS).
 
bool WriteBytes (const uint8_t *data, std::size_t len) noexcept
 Write bytes on MOSI while a transaction is active.
 
void GpioSet (CtrlPin pin, GpioSignal signal) noexcept
 Drive a control pin to an abstract signal level.
 
bool GpioRead (CtrlPin pin) noexcept
 Read a digital input (typically the momentary switch).
 
void DelayUs (uint32_t us) noexcept
 Blocking microsecond delay.
 
void GpioSetActive (CtrlPin pin) noexcept
 
void GpioSetInactive (CtrlPin pin) noexcept
 
 SpiInterface (const SpiInterface &)=delete
 
SpiInterface & operator= (const SpiInterface &)=delete
 

Protected Member Functions

 SpiInterface ()=default
 
 ~SpiInterface ()=default
 

Detailed Description

template<typename Derived>
class isf15acp4::SpiInterface< Derived >

CRTP transport interface for SPI writes and GPIO control.

Platform implementations must:

Template Parameters
DerivedConcrete platform adapter type.

Constructor & Destructor Documentation

◆ SpiInterface() [1/2]

template<typename Derived >
isf15acp4::SpiInterface< Derived >::SpiInterface ( const SpiInterface< Derived > &  )
delete

◆ SpiInterface() [2/2]

template<typename Derived >
isf15acp4::SpiInterface< Derived >::SpiInterface ( )
protecteddefault

◆ ~SpiInterface()

template<typename Derived >
isf15acp4::SpiInterface< Derived >::~SpiInterface ( )
protecteddefault

Member Function Documentation

◆ BeginCommand()

template<typename Derived >
bool isf15acp4::SpiInterface< Derived >::BeginCommand ( )
inlinenoexcept

Begin an SPI transaction with D/C in command mode.

Returns
true on success.

◆ BeginData()

template<typename Derived >
bool isf15acp4::SpiInterface< Derived >::BeginData ( )
inlinenoexcept

Begin an SPI transaction with D/C in data mode.

Returns
true on success.

◆ DelayUs()

template<typename Derived >
void isf15acp4::SpiInterface< Derived >::DelayUs ( uint32_t  us)
inlinenoexcept

Blocking microsecond delay.

Parameters
usDelay duration in microseconds.

◆ EndTransaction()

template<typename Derived >
void isf15acp4::SpiInterface< Derived >::EndTransaction ( )
inlinenoexcept

End the active SPI transaction (typically deassert CS).

◆ EnsureInitialized()

template<typename Derived >
bool isf15acp4::SpiInterface< Derived >::EnsureInitialized ( )
inlinenoexcept

Ensure SPI bus and GPIO pins are configured.

Returns
true when the bus is ready.

◆ GpioRead()

template<typename Derived >
bool isf15acp4::SpiInterface< Derived >::GpioRead ( CtrlPin  pin)
inlinenoexcept

Read a digital input (typically the momentary switch).

Parameters
pinInput pin identifier.
Returns
true when the abstract ACTIVE level is sensed.

◆ GpioSet()

template<typename Derived >
void isf15acp4::SpiInterface< Derived >::GpioSet ( CtrlPin  pin,
GpioSignal  signal 
)
inlinenoexcept

Drive a control pin to an abstract signal level.

Parameters
pinControl signal identifier.
signalDesired abstract level.

◆ GpioSetActive()

template<typename Derived >
void isf15acp4::SpiInterface< Derived >::GpioSetActive ( CtrlPin  pin)
inlinenoexcept

◆ GpioSetInactive()

template<typename Derived >
void isf15acp4::SpiInterface< Derived >::GpioSetInactive ( CtrlPin  pin)
inlinenoexcept

◆ operator=()

template<typename Derived >
SpiInterface & isf15acp4::SpiInterface< Derived >::operator= ( const SpiInterface< Derived > &  )
delete

◆ WriteBytes()

template<typename Derived >
bool isf15acp4::SpiInterface< Derived >::WriteBytes ( const uint8_t *  data,
std::size_t  len 
)
inlinenoexcept

Write bytes on MOSI while a transaction is active.

Parameters
dataSource buffer.
lenNumber of bytes.
Returns
true on success.

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