MetaWear C++ API  0.20.0
C++ implementation of the MetaWear protocol
neopixel.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include "peripheral_common.h"
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
17 typedef enum {
23 
27 typedef enum {
31 
40 METAWEAR_API void mbl_mw_neopixel_init_slow_strand(const MblMwMetaWearBoard *board, uint8_t strand, uint8_t gpio_pin, uint8_t n_pixels,
50 METAWEAR_API void mbl_mw_neopixel_init_fast_strand(const MblMwMetaWearBoard *board, uint8_t strand, uint8_t gpio_pin, uint8_t n_pixels,
57 METAWEAR_API void mbl_mw_neopixel_free_strand(const MblMwMetaWearBoard *board, uint8_t strand);
64 METAWEAR_API void mbl_mw_neopixel_enable_hold(const MblMwMetaWearBoard *board, uint8_t strand);
79 METAWEAR_API void mbl_mw_neopixel_clear(const MblMwMetaWearBoard *board, uint8_t strand, uint8_t start, uint8_t end);
89 METAWEAR_API void mbl_mw_neopixel_set_color(const MblMwMetaWearBoard *board, uint8_t strand, uint8_t pixel, uint8_t red, uint8_t green, uint8_t blue);
98 METAWEAR_API void mbl_mw_neopixel_rotate(const MblMwMetaWearBoard *board, uint8_t strand, uint8_t count, uint16_t period_ms, MblMwNeoPixelRotDirection direction);
106 METAWEAR_API void mbl_mw_neopixel_rotate_indefinitely(const MblMwMetaWearBoard *board, uint8_t strand, uint8_t period_ms, MblMwNeoPixelRotDirection direction);
113 
114 #ifdef __cplusplus
115 }
116 #endif
#define METAWEAR_API
Indicates the function should be exported to the symbol table
Definition: dllmarker.h:27
struct MblMwMetaWearBoard MblMwMetaWearBoard
Software representation of a physical MetaWear board.
Definition: metawearboard_fwd.h:17
METAWEAR_API void mbl_mw_neopixel_clear(const MblMwMetaWearBoard *board, uint8_t strand, uint8_t start, uint8_t end)
Clears pixel states on a strand.
MblMwNeoPixelColorOrdering
Color ordering for the NeoPixel color values.
Definition: neopixel.h:17
@ MBL_MW_NP_WS2811_GBR
Green, blue, red order.
Definition: neopixel.h:21
@ MBL_MW_NP_WS2811_RGB
Red, green, blue order.
Definition: neopixel.h:18
@ MBL_MW_NP_WS2811_RBG
Red, blue, green order.
Definition: neopixel.h:19
@ MBL_MW_NP_WS2811_GRB
Green, red, blue order.
Definition: neopixel.h:20
METAWEAR_API void mbl_mw_neopixel_rotate(const MblMwMetaWearBoard *board, uint8_t strand, uint8_t count, uint16_t period_ms, MblMwNeoPixelRotDirection direction)
Rotates the pixels on a strand.
METAWEAR_API void mbl_mw_neopixel_stop_rotation(const MblMwMetaWearBoard *board, uint8_t strand)
Stops the pixel rotation.
METAWEAR_API void mbl_mw_neopixel_set_color(const MblMwMetaWearBoard *board, uint8_t strand, uint8_t pixel, uint8_t red, uint8_t green, uint8_t blue)
Sets pixel color.
METAWEAR_API void mbl_mw_neopixel_free_strand(const MblMwMetaWearBoard *board, uint8_t strand)
Frees NeoPixel resources on the MetaWeard board for a specific strand.
METAWEAR_API void mbl_mw_neopixel_init_slow_strand(const MblMwMetaWearBoard *board, uint8_t strand, uint8_t gpio_pin, uint8_t n_pixels, MblMwNeoPixelColorOrdering ordering)
Initializes memory on the MetaWear board for a NeoPixel strand with a slow operating speed (400 KHz)
METAWEAR_API void mbl_mw_neopixel_init_fast_strand(const MblMwMetaWearBoard *board, uint8_t strand, uint8_t gpio_pin, uint8_t n_pixels, MblMwNeoPixelColorOrdering ordering)
Initializes memory on the MetaWear board for a NeoPixel strand with a fast operating speed (800 KHz)
METAWEAR_API void mbl_mw_neopixel_enable_hold(const MblMwMetaWearBoard *board, uint8_t strand)
Enables strand holding which will not refresh with any LED changes until the hold is disabled.
METAWEAR_API void mbl_mw_neopixel_disable_hold(const MblMwMetaWearBoard *board, uint8_t strand)
Disables strand holding.
MblMwNeoPixelRotDirection
Enumeration of rotation directions.
Definition: neopixel.h:27
@ MBL_MW_NP_ROT_DIR_AWAY
Pixels move away from the board.
Definition: neopixel.h:29
@ MBL_MW_NP_ROT_DIR_TOWARDS
Pixels move towards the board.
Definition: neopixel.h:28
METAWEAR_API void mbl_mw_neopixel_rotate_indefinitely(const MblMwMetaWearBoard *board, uint8_t strand, uint8_t period_ms, MblMwNeoPixelRotDirection direction)
Rotates the pixels on a strand indefinitely.