RISC-V/V203F6P6/ws2812b/spiclass.h

24 lines
558 B
C
Raw Normal View History

2025-01-25 10:55:11 +01:00
#ifndef SPICLASS_H
#define SPICLASS_H
#include <stdint.h>
#include "ws2812b.h"
/**
*/
class SpiClass {
2025-01-29 09:59:36 +01:00
static constexpr unsigned PADDING = 10 * sizeof (Color);
static constexpr unsigned LEDS_LEN = NUMLEDS * sizeof (Color);
static constexpr unsigned FULL_LEN = PADDING + LEDS_LEN;
2025-01-25 10:55:11 +01:00
OneWay<uint8_t> * driver;
uint8_t * const ptrl;
uint8_t * const ptrh;
2025-01-29 09:59:36 +01:00
uint8_t buffer [FULL_LEN];
2025-01-25 10:55:11 +01:00
public:
explicit SpiClass (OneWay<uint8_t> & base) noexcept;
void Init ();
void drq ();
protected:
};
#endif // SPICLASS_H