RISC-V/V203F6P6/ws2812b/spiclass.h
2025-01-25 12:21:08 +01:00

23 lines
542 B
C++

#ifndef SPICLASS_H
#define SPICLASS_H
#include <stdint.h>
#include "ws2812b.h"
/**
*/
static constexpr unsigned PADDING = 10 * sizeof (Color);
static constexpr unsigned LEDS_LEN = NUMLEDS * sizeof (Color);
static constexpr unsigned FULL_LEN = PADDING + LEDS_LEN;
class SpiClass {
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