28 lines
609 B
C
28 lines
609 B
C
#ifndef SPEAKER_H
|
|
#define SPEAKER_H
|
|
|
|
#include <stdint.h>
|
|
#include <stdlib.h>
|
|
#include "freertos/FreeRTOS.h"
|
|
#include "freertos/task.h"
|
|
#include "driver/i2s_std.h"
|
|
#include "driver/gpio.h"
|
|
#include "esp_check.h"
|
|
#include "sdkconfig.h"
|
|
#include "sd.hpp"
|
|
|
|
#define SPEAKER_PIN_BCLK GPIO_NUM_46
|
|
#define SPEAKER_PIN_WS GPIO_NUM_9
|
|
#define SPEAKER_PIN_DOUT GPIO_NUM_3
|
|
#define SAMPLE_RATE 44100
|
|
#define AUDIO_BUFFER 2048
|
|
|
|
static i2s_chan_handle_t tx_chan;
|
|
|
|
static const char *SPEAKER_TAG = "speaker_driver";
|
|
|
|
esp_err_t play_raw(const char *fp);
|
|
void init_speaker(void)
|
|
void play_example();
|
|
|
|
#endif /* SPEAKER_H */ |