FastLED 3.7.8
Loading...
Searching...
No Matches
REFHardwareSPIOutput< _DATA_PIN, _CLOCK_PIN, _SPI_CLOCK_DIVIDER > Class Template Reference

Detailed Description

template<uint8_t _DATA_PIN, uint8_t _CLOCK_PIN, uint32_t _SPI_CLOCK_DIVIDER>
class REFHardwareSPIOutput< _DATA_PIN, _CLOCK_PIN, _SPI_CLOCK_DIVIDER >

A skeletal implementation of hardware SPI support.

Fill in the necessary code for init, waiting, and writing. The rest of the method implementations should provide a starting point, even if they're not the most efficient to start with

Definition at line 16 of file fastspi_ref.h.

#include <fastspi_ref.h>

Public Member Functions

 SAMHardwareSPIOutput ()
 Default Constructor.
 
 SAMHArdwareSPIOutput (Selectable *pSelect)
 Constructor with selectable.
 
void setSelect (Selectable *pSelect)
 set the object representing the selectable
 
void init ()
 initialize the SPI subssytem
 
void select ()
 latch the CS select
 
void release ()
 release the CS select
 
void writeBytesValue (uint8_t value, int len)
 A full cycle of writing a value for len bytes, including select, release, and waiting.
 
template<class D >
void writeBytes (FASTLED_REGISTER uint8_t *data, int len)
 A full cycle of writing a value for len bytes, including select, release, and waiting.
 
void writeBytes (FASTLED_REGISTER uint8_t *data, int len)
 A full cycle of writing a value for len bytes, including select, release, and waiting.
 
template<uint8_t FLAGS, class D , EOrder RGB_ORDER>
void writePixels (PixelController< RGB_ORDER > pixels, void *context=NULL)
 write a block of uint8_ts out in groups of three.
 

Static Public Member Functions

static void waitFully ()
 wait until all queued up data has been written
 
static void writeByte (uint8_t b)
 write a byte out via SPI (returns immediately on writing register)
 
static void writeWord (uint16_t w)
 write a word out via SPI (returns immediately on writing register)
 
static void writeBytesValueRaw (uint8_t value, int len)
 A raw set of writing byte values, assumes setup/init/waiting done elsewhere.
 
template<uint8_t BIT>
static void writeBit (uint8_t b)
 write a single bit out, which bit from the passed in byte is determined by template parameter
 

Member Function Documentation

◆ init()

template<uint8_t _DATA_PIN, uint8_t _CLOCK_PIN, uint32_t _SPI_CLOCK_DIVIDER>
void REFHardwareSPIOutput< _DATA_PIN, _CLOCK_PIN, _SPI_CLOCK_DIVIDER >::init ( )
inline

initialize the SPI subssytem

Definition at line 30 of file fastspi_ref.h.

◆ release()

template<uint8_t _DATA_PIN, uint8_t _CLOCK_PIN, uint32_t _SPI_CLOCK_DIVIDER>
void REFHardwareSPIOutput< _DATA_PIN, _CLOCK_PIN, _SPI_CLOCK_DIVIDER >::release ( )
inline

release the CS select

Definition at line 36 of file fastspi_ref.h.

◆ SAMHArdwareSPIOutput()

template<uint8_t _DATA_PIN, uint8_t _CLOCK_PIN, uint32_t _SPI_CLOCK_DIVIDER>
REFHardwareSPIOutput< _DATA_PIN, _CLOCK_PIN, _SPI_CLOCK_DIVIDER >::SAMHArdwareSPIOutput ( Selectable * pSelect)
inline

Constructor with selectable.

Definition at line 24 of file fastspi_ref.h.

◆ SAMHardwareSPIOutput()

template<uint8_t _DATA_PIN, uint8_t _CLOCK_PIN, uint32_t _SPI_CLOCK_DIVIDER>
REFHardwareSPIOutput< _DATA_PIN, _CLOCK_PIN, _SPI_CLOCK_DIVIDER >::SAMHardwareSPIOutput ( )
inline

Default Constructor.

Definition at line 21 of file fastspi_ref.h.

◆ select()

template<uint8_t _DATA_PIN, uint8_t _CLOCK_PIN, uint32_t _SPI_CLOCK_DIVIDER>
void REFHardwareSPIOutput< _DATA_PIN, _CLOCK_PIN, _SPI_CLOCK_DIVIDER >::select ( )
inline

latch the CS select

Definition at line 33 of file fastspi_ref.h.

◆ setSelect()

template<uint8_t _DATA_PIN, uint8_t _CLOCK_PIN, uint32_t _SPI_CLOCK_DIVIDER>
void REFHardwareSPIOutput< _DATA_PIN, _CLOCK_PIN, _SPI_CLOCK_DIVIDER >::setSelect ( Selectable * pSelect)
inline

set the object representing the selectable

Definition at line 27 of file fastspi_ref.h.

◆ waitFully()

template<uint8_t _DATA_PIN, uint8_t _CLOCK_PIN, uint32_t _SPI_CLOCK_DIVIDER>
static void REFHardwareSPIOutput< _DATA_PIN, _CLOCK_PIN, _SPI_CLOCK_DIVIDER >::waitFully ( )
inlinestatic

wait until all queued up data has been written

Definition at line 39 of file fastspi_ref.h.

◆ writeBit()

template<uint8_t _DATA_PIN, uint8_t _CLOCK_PIN, uint32_t _SPI_CLOCK_DIVIDER>
template<uint8_t BIT>
static void REFHardwareSPIOutput< _DATA_PIN, _CLOCK_PIN, _SPI_CLOCK_DIVIDER >::writeBit ( uint8_t b)
inlinestatic

write a single bit out, which bit from the passed in byte is determined by template parameter

Definition at line 74 of file fastspi_ref.h.

◆ writeByte()

template<uint8_t _DATA_PIN, uint8_t _CLOCK_PIN, uint32_t _SPI_CLOCK_DIVIDER>
static void REFHardwareSPIOutput< _DATA_PIN, _CLOCK_PIN, _SPI_CLOCK_DIVIDER >::writeByte ( uint8_t b)
inlinestatic

write a byte out via SPI (returns immediately on writing register)

Definition at line 42 of file fastspi_ref.h.

◆ writeBytes() [1/2]

template<uint8_t _DATA_PIN, uint8_t _CLOCK_PIN, uint32_t _SPI_CLOCK_DIVIDER>
template<class D >
void REFHardwareSPIOutput< _DATA_PIN, _CLOCK_PIN, _SPI_CLOCK_DIVIDER >::writeBytes ( FASTLED_REGISTER uint8_t * data,
int len )
inline

A full cycle of writing a value for len bytes, including select, release, and waiting.

Definition at line 58 of file fastspi_ref.h.

◆ writeBytes() [2/2]

template<uint8_t _DATA_PIN, uint8_t _CLOCK_PIN, uint32_t _SPI_CLOCK_DIVIDER>
void REFHardwareSPIOutput< _DATA_PIN, _CLOCK_PIN, _SPI_CLOCK_DIVIDER >::writeBytes ( FASTLED_REGISTER uint8_t * data,
int len )
inline

A full cycle of writing a value for len bytes, including select, release, and waiting.

Definition at line 71 of file fastspi_ref.h.

◆ writeBytesValue()

template<uint8_t _DATA_PIN, uint8_t _CLOCK_PIN, uint32_t _SPI_CLOCK_DIVIDER>
void REFHardwareSPIOutput< _DATA_PIN, _CLOCK_PIN, _SPI_CLOCK_DIVIDER >::writeBytesValue ( uint8_t value,
int len )
inline

A full cycle of writing a value for len bytes, including select, release, and waiting.

Definition at line 53 of file fastspi_ref.h.

◆ writeBytesValueRaw()

template<uint8_t _DATA_PIN, uint8_t _CLOCK_PIN, uint32_t _SPI_CLOCK_DIVIDER>
static void REFHardwareSPIOutput< _DATA_PIN, _CLOCK_PIN, _SPI_CLOCK_DIVIDER >::writeBytesValueRaw ( uint8_t value,
int len )
inlinestatic

A raw set of writing byte values, assumes setup/init/waiting done elsewhere.

Definition at line 48 of file fastspi_ref.h.

◆ writePixels()

template<uint8_t _DATA_PIN, uint8_t _CLOCK_PIN, uint32_t _SPI_CLOCK_DIVIDER>
template<uint8_t FLAGS, class D , EOrder RGB_ORDER>
void REFHardwareSPIOutput< _DATA_PIN, _CLOCK_PIN, _SPI_CLOCK_DIVIDER >::writePixels ( PixelController< RGB_ORDER > pixels,
void * context = NULL )
inline

write a block of uint8_ts out in groups of three.

len is the total number of uint8_ts to write out. The template parameters indicate how many uint8_ts to skip at the beginning and/or end of each grouping

Definition at line 78 of file fastspi_ref.h.

◆ writeWord()

template<uint8_t _DATA_PIN, uint8_t _CLOCK_PIN, uint32_t _SPI_CLOCK_DIVIDER>
static void REFHardwareSPIOutput< _DATA_PIN, _CLOCK_PIN, _SPI_CLOCK_DIVIDER >::writeWord ( uint16_t w)
inlinestatic

write a word out via SPI (returns immediately on writing register)

Definition at line 45 of file fastspi_ref.h.


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