Loading files
3e0e2dea3This file is pinned to the selected release. Download the original to open it in your design tool.
#include <driver/i2s_std.h>
#include "i2scfg.hpp"
#ifndef MAX98357_h
#define MAX98357_h
struct MAX98357PinCfg {
gpio_num_t bclk;
gpio_num_t ws;
gpio_num_t data;
gpio_num_t enable;
};
class MAX98357 {
private:
i2s_chan_handle_t chanHandle;
bool enabled;
MAX98357PinCfg pins;
public:
MAX98357();
bool begin(i2s_port_t port, I2SCfg _cfg, MAX98357PinCfg _pins);
bool end();
void sleep();
void wake();
bool asleep();
bool write(uint8_t* bytes, size_t byteCnt, size_t* bytesWritten);
};
#endif