23 lines
558 B
C++
23 lines
558 B
C++
#ifndef SPICLASS_H
|
|
#define SPICLASS_H
|
|
#include <stdint.h>
|
|
#include "ws2812b.h"
|
|
/**
|
|
*/
|
|
|
|
class SpiClass {
|
|
static constexpr unsigned PADDING = 10 * sizeof (Color);
|
|
static constexpr unsigned LEDS_LEN = NUMLEDS * sizeof (Color);
|
|
static constexpr unsigned FULL_LEN = PADDING + LEDS_LEN;
|
|
OneWay<uint8_t> * driver;
|
|
uint8_t * const ptrl;
|
|
uint8_t * const ptrh;
|
|
uint8_t buffer [FULL_LEN];
|
|
public:
|
|
explicit SpiClass (OneWay<uint8_t> & base) noexcept;
|
|
void Init ();
|
|
void drq ();
|
|
protected:
|
|
};
|
|
|
|
#endif // SPICLASS_H
|