arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
audio_tools::I2SBase Class Reference

Basic I2S API - for the ESP32. If we receive 1 channel, we expand the result to 2 channels. More...

#include <I2SESP32.h>

Public Member Functions

int available ()
 we assume the data is already available in the buffer
 
int available ()
 we assume the data is already available in the buffer
 
int available ()
 
int available ()
 
int available ()
 we assume the data is already available in the buffer
 
int availableForWrite ()
 We limit the write size to the buffer size.
 
int availableForWrite ()
 We limit the write size to the buffer size.
 
int availableForWrite ()
 
int availableForWrite ()
 
int availableForWrite ()
 We limit the write size to the buffer size.
 
bool begin ()
 starts the DAC with the current config - if not started yet. If I2S has been started there is no action and we return true
 
bool begin ()
 
bool begin (I2SConfig cfg)
 starts the DAC
 
bool begin (I2SConfig cfg)
 starts the DAC
 
bool begin (I2SConfig cfg)
 starts the DAC
 
bool begin (I2SConfig cfg)
 starts the DAC
 
bool begin (I2SConfig cfg)
 starts the DAC
 
void begin (I2SConfig cfg)
 starts the DAC
 
bool begin (RxTxMode mode)
 starts the DAC with the default config
 
bool begin (RxTxMode mode)
 starts the DAC with the default config
 
bool begin (RxTxMode mode=TX_MODE)
 starts the DAC with the default config
 
bool begin (RxTxMode mode=TX_MODE)
 starts the DAC with the default config in TX Mode
 
bool begin (RxTxMode mode=TX_MODE)
 starts the DAC with the default config in TX Mode
 
void begin (RxTxMode mode=TX_MODE)
 starts the DAC with the default config in TX Mode
 
I2SConfig config ()
 provides the actual configuration
 
I2SConfig config ()
 provides the actual configuration
 
I2SConfig config ()
 provides the actual configuration
 
I2SConfig config ()
 provides the actual configuration
 
I2SConfig config ()
 provides the actual configuration
 
I2SConfig config ()
 provides the actual configuration
 
I2SConfig defaultConfig (RxTxMode mode)
 Provides the default configuration.
 
I2SConfig defaultConfig (RxTxMode mode)
 Provides the default configuration.
 
I2SConfig defaultConfig (RxTxMode mode)
 Provides the default configuration.
 
I2SConfig defaultConfig (RxTxMode mode)
 Provides the default configuration.
 
I2SConfig defaultConfig (RxTxMode mode)
 Provides the default configuration.
 
I2SConfig defaultConfig (RxTxMode mode=TX_MODE)
 Provides the default configuration.
 
void end ()
 stops the I2C and unistalls the driver
 
void end ()
 stops the I2C and unistalls the driver
 
void end ()
 stops the I2C and unistalls the driver
 
void end ()
 stops the I2C and unistalls the driver
 
void end ()
 stops the I2C and unistalls the driver
 
void end ()
 stops the I2C and unistalls the driver
 
size_t readBytes (void *dest, size_t size_bytes)
 
size_t readBytes (void *dest, size_t size_bytes)
 
size_t readBytes (void *dest, size_t size_bytes)
 
size_t readBytes (void *src, size_t size_bytes)
 
size_t writeBytes (const void *src, size_t size_bytes)
 writes the data to the I2S interface
 
size_t writeBytes (const void *src, size_t size_bytes)
 
size_t writeBytes (const void *src, size_t size_bytes)
 blocking writes for the data to the I2S interface
 
size_t writeBytes (const void *src, size_t size_bytes)
 writes the data to the I2S interface
 

Static Public Member Functions

static void readToTransmit (uint8_t *buffer, uint16_t byteCount)
 Callback function used by https://github.com/pschatzmann/stm32f411-i2s.
 
static void writeFromReceive (uint8_t *buffer, uint16_t byteCount)
 Callback function used by https://github.com/pschatzmann/stm32f411-i2s.
 

Protected Member Functions

bool begin (I2SConfig cfg, int txPin, int rxPin)
 starts the DAC
 
void deleteBuffers ()
 
uint32_t getMode (I2SConfig &cfg)
 
int getModeDigital (I2SConfig &cfg)
 
uint32_t getSampleRate (I2SConfig &cfg)
 
uint32_t getStandard (I2SConfig &cfg)
 
size_t readBytes (void *dest, size_t size_bytes)
 reads the data from the I2S interface
 
size_t readBytes (void *dest, size_t size_bytes)
 
void setChannels (int channels)
 
void setupBitWidth (I2SConfig cfg)
 
void setupClock (I2SConfig cfg)
 
void setupData (I2SConfig cfg)
 
void setupDefaultI2SParameters ()
 
void setupIRQ ()
 
void setupMode (I2SConfig cfg)
 
void setupPins (I2SConfig cfg)
 
void setupRxTx (I2SConfig cfg)
 
i2s_comm_format_t toCommFormat (I2SFormat mode)
 
i2s_mode_t toMode (I2SConfig &cfg)
 
size_t writeBytes (const void *src, size_t size_bytes)
 writes the data to the I2S interface
 
size_t writeBytes (const void *src, size_t size_bytes)
 writes the data to the I2S buffer
 
size_t writeBytesExt (const void *src, size_t size_bytes)
 
size_t writeExt (const void *src, size_t size_bytes)
 writes the data by making shure that we send 2 channels 16 bit data
 

Static Protected Member Functions

static size_t writeExpandChannel (i2s_port_t i2s_num, const int bits_per_sample, const void *src, size_t size_bytes)
 writes the data by making shure that we send 2 channels
 

Protected Attributes

I2SConfig cfg = defaultConfig(RX_MODE)
 
i2s_config_t i2s_config
 
i2s_port_t i2s_num
 
I2SSettingsSTM32 i2s_stm32
 
bool is_started = false
 

Static Protected Attributes

static INLINE_VAR NBuffer< uint8_t > * p_rx_buffer =nullptr
 
static INLINE_VAR NBuffer< uint8_t > * p_tx_buffer =nullptr
 

Friends

class AnalogAudio
 
class AudioKitStream
 
class I2SStream
 

Detailed Description

Basic I2S API - for the ESP32. If we receive 1 channel, we expand the result to 2 channels.

Basic I2S API - for the ...

Basic I2S API - for the STM32 Depends on https://github.com/pschatzmann/stm32f411-i2s We just add a write and read buffer and pass some parameters to the STM32 API!

Basic I2S API - for the SAMD.

Basic I2S API - for the Arduino Nano BLE Sense.

Basic I2S API - for the ESP8266 Only 16 bits are supported !

Author
Phil Schatzmann

The documentation for this class was generated from the following files: