Skip to content

daisy::NeoPixel

Module: External

Device support for Adafruit Neopixel Device. More...

#include <neopixel.h>

Public Classes

Name
struct Config

Public Types

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

Public Functions

Name
NeoPixel()
~NeoPixel()
Result Init(Config config)
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)
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)
Result GetTransportError()
void SWReset()
void UpdateLength(uint16_t n)
void UpdateType(neoPixelType t)
bool CanShow(void )
void Show(void )
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)
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
uint16_t NumPixels(void ) const
void Clear()
void SetBrightness(uint8_t b)

Protected Attributes

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

Detailed Description

template <typename Transport >
class daisy::NeoPixel;

Device support for Adafruit Neopixel Device.

Author: beserge

Date: December 2021

Public Types Documentation

enum Result

Enumerator Value Description
OK 0
ERR

enum ModBaseAdd

Enumerator Value Description
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 ModAddReg

Enumerator Value Description
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 StatAddReg

Enumerator Value Description
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 NeoPixel

inline NeoPixel()

function ~NeoPixel

inline ~NeoPixel()

function Init

inline Result Init(
    Config config
)

Parameters:

  • config Configuration settings

Initialize the NeoPixel device


function Write

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

function Write8

inline void Write8(
    uint8_t reg_high,
    uint8_t reg_low,
    uint8_t value
)

Parameters:

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

Writes an 8 bit value


function Read8

inline uint8_t Read8(
    uint8_t reg_high,
    uint8_t reg_low
)

Parameters:

  • reg the register address to read from

Return: the data uint8_t read from the device

Reads an 8 bit value


function ReadLen

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

function GetTransportError

inline Result GetTransportError()

Return: Whether the transport has errored since the last check

Get and reset the transport error flag


function SWReset

inline void SWReset()

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


function UpdateLength

inline void UpdateLength(
    uint16_t n
)

function UpdateType

inline void UpdateType(
    neoPixelType t
)

function CanShow

inline bool CanShow(
    void 
)

function Show

inline void Show(
    void 
)

function SetPin

inline void SetPin(
    uint8_t p
)

function SetPixelColor

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

function SetPixelColor

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

function SetPixelColor

inline void SetPixelColor(
    uint16_t n,
    uint32_t c
)

function Color

inline uint32_t Color(
    uint8_t r,
    uint8_t g,
    uint8_t b
)

function Color

inline uint32_t Color(
    uint8_t r,
    uint8_t g,
    uint8_t b,
    uint8_t w
)

function GetPixelColor

inline uint32_t GetPixelColor(
    uint16_t n
) const

function GetPixels

inline uint8_t * GetPixels(
    void 
) const

function NumPixels

inline uint16_t NumPixels(
    void 
) const

function Clear

inline void Clear()

function SetBrightness

inline void SetBrightness(
    uint8_t b
)

Protected Attributes Documentation

variable is800KHz

bool is800KHz;

variable begun

bool begun;

variable numLEDs

uint16_t numLEDs;

variable numBytes

uint16_t numBytes;

variable pin

int8_t pin;

variable pixelsd

uint8_t[256] pixelsd;

variable brightness

uint8_t brightness;

variable pixels

uint8_t * pixels;

variable rOffset

uint8_t rOffset;

variable gOffset

uint8_t gOffset;

variable bOffset

uint8_t bOffset;

variable wOffset

uint8_t wOffset;

variable endTime

uint32_t endTime;

variable type

uint16_t type;

Updated on 2024-01-03 at 19:41:01 +0000