Skip to content

Class daisy::NeoPixel

template <typename Transport>

ClassList > daisy > NeoPixel

Device support for Adafruit Neopixel Device. More...

  • #include <neopixel.h>

Classes

Type Name
struct Config

Public Types

Type Name
enum ModAddReg
enum ModBaseAdd
enum Result
enum StatAddReg
typedef uint16_t neoPixelType

Public Functions

Type Name
bool CanShow (void)
void Clear ()
uint32_t Color (uint8_t r, uint8_t g, uint8_t b)
uint32_t Color (uint8_t r, uint8_t g, uint8_t b, uint8_t w)
uint32_t GetPixelColor (uint16_t n) const
uint8_t * GetPixels (void) const
Result GetTransportError ()
Result Init (Config config)
NeoPixel ()
uint16_t NumPixels (void) const
uint8_t Read8 (uint8_t reg_high, uint8_t reg_low)
void ReadLen (uint8_t reg_high, uint8_t reg_low, uint8_t * buff, uint8_t len)
void SWReset ()
void SetBrightness (uint8_t b)
void SetPin (uint8_t p)
void SetPixelColor (uint16_t n, uint8_t r, uint8_t g, uint8_t b)
void SetPixelColor (uint16_t n, uint8_t r, uint8_t g, uint8_t b, uint8_t w)
void SetPixelColor (uint16_t n, uint32_t c)
void Show (void)
void UpdateLength (uint16_t n)
void UpdateType (neoPixelType t)
void Write (uint8_t reg_high, uint8_t reg_low, uint8_t * buff, uint8_t size)
void Write8 (uint8_t reg_high, uint8_t reg_low, uint8_t value)
~NeoPixel ()

Protected Attributes

Type Name
uint8_t bOffset
bool begun
uint8_t brightness
uint32_t endTime
uint8_t gOffset
bool is800KHz
uint16_t numBytes
uint16_t numLEDs
int8_t pin
uint8_t * pixels
uint8_t pixelsd
uint8_t rOffset
uint16_t type
uint8_t wOffset

Detailed Description

Author:

beserge

Date:

December 2021

Public Types Documentation

enum ModAddReg

enum daisy::NeoPixel::ModAddReg {
    SEESAW_NEOPIXEL_STATUS = 0x00,
    SEESAW_NEOPIXEL_PIN = 0x01,
    SEESAW_NEOPIXEL_SPEED = 0x02,
    SEESAW_NEOPIXEL_BUF_LENGTH = 0x03,
    SEESAW_NEOPIXEL_BUF = 0x04,
    SEESAW_NEOPIXEL_SHOW = 0x05
};

neopixel module function address registers


enum ModBaseAdd

enum daisy::NeoPixel::ModBaseAdd {
    SEESAW_STATUS_BASE = 0x00,
    SEESAW_GPIO_BASE = 0x01,
    SEESAW_SERCOM0_BASE = 0x02,
    SEESAW_TIMER_BASE = 0x08,
    SEESAW_ADC_BASE = 0x09,
    SEESAW_DAC_BASE = 0x0A,
    SEESAW_INTERRUPT_BASE = 0x0B,
    SEESAW_DAP_BASE = 0x0C,
    SEESAW_EEPROM_BASE = 0x0D,
    SEESAW_NEOPIXEL_BASE = 0x0E,
    SEESAW_TOUCH_BASE = 0x0F,
    SEESAW_KEYPAD_BASE = 0x10,
    SEESAW_ENCODER_BASE = 0x11,
    SEESAW_SPECTRUM_BASE = 0x12
};

Module Base Addreses The module base addresses for different seesaw modules.


enum Result

enum daisy::NeoPixel::Result {
    OK = 0,
    ERR
};

enum StatAddReg

enum daisy::NeoPixel::StatAddReg {
    SEESAW_STATUS_HW_ID = 0x01,
    SEESAW_STATUS_VERSION = 0x02,
    SEESAW_STATUS_OPTIONS = 0x03,
    SEESAW_STATUS_TEMP = 0x04,
    SEESAW_STATUS_SWRST = 0x7F
};

status module function address registers


typedef neoPixelType

typedef uint16_t daisy::NeoPixel< Transport >::neoPixelType;

Public Functions Documentation

function CanShow

inline bool daisy::NeoPixel::CanShow (
    void
) 

function Clear

inline void daisy::NeoPixel::Clear () 

function Color [½]

inline uint32_t daisy::NeoPixel::Color (
    uint8_t r,
    uint8_t g,
    uint8_t b
) 

function Color [2/2]

inline uint32_t daisy::NeoPixel::Color (
    uint8_t r,
    uint8_t g,
    uint8_t b,
    uint8_t w
) 

function GetPixelColor

inline uint32_t daisy::NeoPixel::GetPixelColor (
    uint16_t n
) const

function GetPixels

inline uint8_t * daisy::NeoPixel::GetPixels (
    void
) const

function GetTransportError

inline Result daisy::NeoPixel::GetTransportError () 

Get and reset the transport error flag

Returns:

Whether the transport has errored since the last check


function Init

inline Result daisy::NeoPixel::Init (
    Config config
) 

Initialize the NeoPixel device

Parameters:

  • config Configuration settings

function NeoPixel

inline daisy::NeoPixel::NeoPixel () 

function NumPixels

inline uint16_t daisy::NeoPixel::NumPixels (
    void
) const

function Read8

inline uint8_t daisy::NeoPixel::Read8 (
    uint8_t reg_high,
    uint8_t reg_low
) 

Reads an 8 bit value

Parameters:

  • reg the register address to read from

Returns:

the data uint8_t read from the device


function ReadLen

inline void daisy::NeoPixel::ReadLen (
    uint8_t reg_high,
    uint8_t reg_low,
    uint8_t * buff,
    uint8_t len
) 

function SWReset

inline void daisy::NeoPixel::SWReset () 

Perform a software reset. This resets all seesaw registers to their default values. This is called automatically from Init().


function SetBrightness

inline void daisy::NeoPixel::SetBrightness (
    uint8_t b
) 

function SetPin

inline void daisy::NeoPixel::SetPin (
    uint8_t p
) 

function SetPixelColor [⅓]

inline void daisy::NeoPixel::SetPixelColor (
    uint16_t n,
    uint8_t r,
    uint8_t g,
    uint8_t b
) 

function SetPixelColor [⅔]

inline void daisy::NeoPixel::SetPixelColor (
    uint16_t n,
    uint8_t r,
    uint8_t g,
    uint8_t b,
    uint8_t w
) 

function SetPixelColor [3/3]

inline void daisy::NeoPixel::SetPixelColor (
    uint16_t n,
    uint32_t c
) 

function Show

inline void daisy::NeoPixel::Show (
    void
) 

function UpdateLength

inline void daisy::NeoPixel::UpdateLength (
    uint16_t n
) 

function UpdateType

inline void daisy::NeoPixel::UpdateType (
    neoPixelType t
) 

function Write

inline void daisy::NeoPixel::Write (
    uint8_t reg_high,
    uint8_t reg_low,
    uint8_t * buff,
    uint8_t size
) 

function Write8

inline void daisy::NeoPixel::Write8 (
    uint8_t reg_high,
    uint8_t reg_low,
    uint8_t value
) 

Writes an 8 bit value

Parameters:

  • reg the register address to write to
  • value the value to write to the register

function ~NeoPixel

inline daisy::NeoPixel::~NeoPixel () 

Protected Attributes Documentation

variable bOffset

uint8_t daisy::NeoPixel< Transport >::bOffset;

variable begun

bool daisy::NeoPixel< Transport >::begun;

variable brightness

uint8_t daisy::NeoPixel< Transport >::brightness;

variable endTime

uint32_t daisy::NeoPixel< Transport >::endTime;

variable gOffset

uint8_t daisy::NeoPixel< Transport >::gOffset;

variable is800KHz

bool daisy::NeoPixel< Transport >::is800KHz;

variable numBytes

uint16_t daisy::NeoPixel< Transport >::numBytes;

variable numLEDs

uint16_t daisy::NeoPixel< Transport >::numLEDs;

variable pin

int8_t daisy::NeoPixel< Transport >::pin;

variable pixels

uint8_t * daisy::NeoPixel< Transport >::pixels;

variable pixelsd

uint8_t daisy::NeoPixel< Transport >::pixelsd[256];

variable rOffset

uint8_t daisy::NeoPixel< Transport >::rOffset;

variable type

uint16_t daisy::NeoPixel< Transport >::type;

variable wOffset

uint8_t daisy::NeoPixel< Transport >::wOffset;


The documentation for this class was generated from the following file external-docs/libDaisy/src/dev/neopixel.h