libyggdrasil  v1.0.0
bsp::drv::SPI< Context, SPIImpl > Struct Template Reference

Base class for SPI abstraction. More...

#include <spi.hpp>

Public Types

using Impl = SPIImpl< Context >
 

Public Member Functions

 SPI ()=delete
 

Static Public Member Functions

static auto init (auto ... args)
 SPI initialization. More...
 
static auto deinit (auto ... args)
 SPI deinitialization. More...
 
template<typename T >
static T read ()
 SPI read function. More...
 
template<typename T >
static void write (const T &value)
 SPI write function. More...
 
static void setMode (SPIMode mode)
 Set the spi mode (CPOL and CPHA) More...
 

Detailed Description

template<auto Context, template< auto > typename SPIImpl>
struct bsp::drv::SPI< Context, SPIImpl >

Base class for SPI abstraction.

Template Parameters
ContextSPI context
SPIImplSPI implementation

Member Typedef Documentation

◆ Impl

template<auto Context, template< auto > typename SPIImpl>
using bsp::drv::SPI< Context, SPIImpl >::Impl = SPIImpl<Context>

Constructor & Destructor Documentation

◆ SPI()

template<auto Context, template< auto > typename SPIImpl>
bsp::drv::SPI< Context, SPIImpl >::SPI ( )
delete

Member Function Documentation

◆ deinit()

template<auto Context, template< auto > typename SPIImpl>
static auto bsp::drv::SPI< Context, SPIImpl >::deinit ( auto ...  args)
inlinestatic

SPI deinitialization.

Parameters
argsPlatform specific arguments
Returns
Success

◆ init()

template<auto Context, template< auto > typename SPIImpl>
static auto bsp::drv::SPI< Context, SPIImpl >::init ( auto ...  args)
inlinestatic

SPI initialization.

Parameters
argsPlatform specific arguments
Returns
Success

◆ read()

template<auto Context, template< auto > typename SPIImpl>
template<typename T >
static T bsp::drv::SPI< Context, SPIImpl >::read ( )
inlinestatic

SPI read function.

Template Parameters
Ttype to read
Returns
Read data

◆ setMode()

template<auto Context, template< auto > typename SPIImpl>
static void bsp::drv::SPI< Context, SPIImpl >::setMode ( SPIMode  mode)
inlinestatic

Set the spi mode (CPOL and CPHA)

Parameters
modeSPI mode
Note
This function wait until the SPI is not busy anymore and then the mode change will take place

◆ write()

template<auto Context, template< auto > typename SPIImpl>
template<typename T >
static void bsp::drv::SPI< Context, SPIImpl >::write ( const T &  value)
inlinestatic

SPI write function.

Template Parameters
Ttype to write
Parameters
valueData to write

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