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

Basic I2S API - for the Arduino Nano BLE Sense See https://content.arduino.cc/assets/Nano_BLE_MCU-nRF52840_PS_v1.1.pdf Douplex mode (RXTX_MODE) is currently not supported, but it should be quite easy to implement. More...

#include <I2SNanoSenseBLE.h>

Public Member Functions

 I2SDriverNanoBLE ()=default
 
int available ()
 
int availableForWrite ()
 
bool begin (I2SConfigStd cfg)
 starts the I2S
 
bool begin (RxTxMode mode=TX_MODE)
 starts the I2S with the default config in TX Mode
 
void clearStream ()
 Deactivate alternative API: don't forget to call begin()
 
I2SConfigStd config ()
 provides the actual configuration
 
I2SConfigStd defaultConfig (RxTxMode mode)
 Provides the default configuration.
 
void end ()
 stops the I2S
 
size_t readBytes (void *dest, size_t size_bytes)
 reads the data from the I2S buffer
 
bool setAudioInfo (AudioInfo)
 Potentially updates the sample rate (if supported)
 
void setBufferSize (int size)
 
void setStream (Stream &stream)
 alternative API which provides the data directly via a Stream
 
size_t writeBytes (const void *src, size_t size_bytes)
 writes the data to the I2S buffer
 

Protected Member Functions

unsigned long getINTENSET ()
 Determine the INTENSET value.
 
int getPinName (int pin)
 Provides the arduino or unconverted pin name.
 
void releaseBuffers ()
 Release buffers.
 
void setupBitWidth (I2SConfigStd cfg)
 setup SWIDTH
 
bool setupBuffers ()
 dynamic buffer management
 
void setupClock (I2SConfigStd cfg)
 setup MCKFREQ and RATIO
 
void setupMode (I2SConfigStd cfg)
 setup format and align
 
void setupPins (I2SConfigStd cfg)
 setup pins
 
bool setupRxTx (I2SConfigStd cfg)
 setup TXEN or RXEN
 
void startI2SActive ()
 Start IRQ and I2S.
 

Protected Attributes

I2SConfigStd cfg
 
bool is_active = false
 

Friends

class I2SStream
 

Detailed Description

Basic I2S API - for the Arduino Nano BLE Sense See https://content.arduino.cc/assets/Nano_BLE_MCU-nRF52840_PS_v1.1.pdf Douplex mode (RXTX_MODE) is currently not supported, but it should be quite easy to implement.

Author
Phil Schatzmann

Constructor & Destructor Documentation

◆ I2SDriverNanoBLE()

I2SDriverNanoBLE ( )
default

Member Function Documentation

◆ available()

int available ( )
inline

◆ availableForWrite()

int availableForWrite ( )
inline

◆ begin() [1/2]

bool begin ( I2SConfigStd  cfg)
inline

starts the I2S

◆ begin() [2/2]

bool begin ( RxTxMode  mode = TX_MODE)
inline

starts the I2S with the default config in TX Mode

◆ clearStream()

void clearStream ( )
inline

Deactivate alternative API: don't forget to call begin()

◆ config()

I2SConfigStd config ( )
inline

provides the actual configuration

◆ defaultConfig()

I2SConfigStd defaultConfig ( RxTxMode  mode)
inline

Provides the default configuration.

◆ end()

void end ( )
inline

stops the I2S

◆ getINTENSET()

unsigned long getINTENSET ( )
inlineprotected

Determine the INTENSET value.

◆ getPinName()

int getPinName ( int  pin)
inlineprotected

Provides the arduino or unconverted pin name.

◆ readBytes()

size_t readBytes ( void dest,
size_t  size_bytes 
)
inline

reads the data from the I2S buffer

◆ releaseBuffers()

void releaseBuffers ( )
inlineprotected

Release buffers.

◆ setAudioInfo()

bool setAudioInfo ( AudioInfo  )
inline

Potentially updates the sample rate (if supported)

◆ setBufferSize()

void setBufferSize ( int  size)
inline

◆ setStream()

void setStream ( Stream stream)
inline

alternative API which provides the data directly via a Stream

◆ setupBitWidth()

void setupBitWidth ( I2SConfigStd  cfg)
inlineprotected

setup SWIDTH

◆ setupBuffers()

bool setupBuffers ( )
inlineprotected

dynamic buffer management

◆ setupClock()

void setupClock ( I2SConfigStd  cfg)
inlineprotected

setup MCKFREQ and RATIO

◆ setupMode()

void setupMode ( I2SConfigStd  cfg)
inlineprotected

setup format and align

◆ setupPins()

void setupPins ( I2SConfigStd  cfg)
inlineprotected

setup pins

◆ setupRxTx()

bool setupRxTx ( I2SConfigStd  cfg)
inlineprotected

setup TXEN or RXEN

◆ startI2SActive()

void startI2SActive ( )
inlineprotected

Start IRQ and I2S.

◆ writeBytes()

size_t writeBytes ( const void src,
size_t  size_bytes 
)
inline

writes the data to the I2S buffer

Friends And Related Symbol Documentation

◆ I2SStream

Member Data Documentation

◆ cfg

I2SConfigStd cfg
protected

◆ is_active

bool is_active = false
protected

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