arduino-audio-tools
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Typedefs | Variables
SPDIFOutput.h File Reference
#include "AudioToolsConfig.h"
#include "AudioTools/CoreAudio/AudioLogger.h"
#include "AudioTools/CoreAudio/AudioStreams.h"
#include "AudioTools/CoreAudio/AudioI2S/I2SConfig.h"
#include "AudioTools/CoreAudio/AudioI2S/I2SStream.h"

Go to the source code of this file.

Classes

struct  SPDIFConfig
 SPDIF configuration. More...
 
class  SPDIFOutput
 Output as 16 bit stereo SPDIF on the I2S data output pin. For the time beeing only the ESP32 is officially supported. More...
 

Namespaces

namespace  audio_tools
 Generic Implementation of sound input and output for desktop environments using portaudio.
 

Macros

#define BMC_B   0x33173333
 
#define BMC_BITS_FACTOR   (BMC_BITS_PER_SAMPLE / I2S_BITS_PER_SAMPLE)
 
#define BMC_BITS_PER_SAMPLE   64
 
#define BMC_M   0x331d3333
 
#define BMC_MW_DIF   (BMC_M ^ BMC_W)
 
#define BMC_W   0x331b3333
 
#define DMA_BUF_COUNT   2
 
#define DMA_BUF_LEN
 
#define I2S_BITS_PER_SAMPLE   (32)
 
#define I2S_BUG_MAGIC   (26 * 1000 * 1000)
 
#define I2S_CHANNELS   2
 
#define I2S_NUM   ((i2s_port_t)0)
 
#define SPDIF_BLOCK_SAMPLES   192
 
#define SPDIF_BLOCK_SIZE    (SPDIF_BLOCK_SAMPLES * (BMC_BITS_PER_SAMPLE / 8) * I2S_CHANNELS)
 
#define SPDIF_BUF_ARRAY_SIZE   (SPDIF_BUF_SIZE / sizeof(uint32_t))
 
#define SPDIF_BUF_DIV   2
 
#define SPDIF_BUF_SIZE   (SPDIF_BLOCK_SIZE / SPDIF_BUF_DIV)
 
#define SPDIF_DATA_PIN   23
 
#define SYNC_FLIP   ((BMC_B ^ BMC_M) >> (SYNC_OFFSET * 8))
 
#define SYNC_OFFSET   2
 

Typedefs

using SPDIFStream = SPDIFOutput
 Alias for SPDIFOutput for backward compatibility.
 

Variables

static const int16_tbmc_tab = (int16_t *)bmc_tab_uint
 
static const uint16_t bmc_tab_uint [256]
 
static uint32_t spdif_buf [(((192 *(64/8) *2)/2)/sizeof(uint32_t))]
 
static uint32_tspdif_ptr = nullptr
 

Macro Definition Documentation

◆ BMC_B

#define BMC_B   0x33173333

◆ BMC_BITS_FACTOR

#define BMC_BITS_FACTOR   (BMC_BITS_PER_SAMPLE / I2S_BITS_PER_SAMPLE)

◆ BMC_BITS_PER_SAMPLE

#define BMC_BITS_PER_SAMPLE   64

◆ BMC_M

#define BMC_M   0x331d3333

◆ BMC_MW_DIF

#define BMC_MW_DIF   (BMC_M ^ BMC_W)

◆ BMC_W

#define BMC_W   0x331b3333

◆ DMA_BUF_COUNT

#define DMA_BUF_COUNT   2

◆ DMA_BUF_LEN

#define DMA_BUF_LEN
Value:
#define SPDIF_BUF_DIV
Definition SPDIFOutput.h:37
#define SPDIF_BLOCK_SAMPLES
Definition SPDIFOutput.h:36
#define I2S_BITS_PER_SAMPLE
Definition SPDIFOutput.h:32
#define BMC_BITS_PER_SAMPLE
Definition SPDIFOutput.h:34

◆ I2S_BITS_PER_SAMPLE

#define I2S_BITS_PER_SAMPLE   (32)

◆ I2S_BUG_MAGIC

#define I2S_BUG_MAGIC   (26 * 1000 * 1000)

◆ I2S_CHANNELS

#define I2S_CHANNELS   2

◆ I2S_NUM

#define I2S_NUM   ((i2s_port_t)0)

◆ SPDIF_BLOCK_SAMPLES

#define SPDIF_BLOCK_SAMPLES   192

◆ SPDIF_BLOCK_SIZE

#define SPDIF_BLOCK_SIZE    (SPDIF_BLOCK_SAMPLES * (BMC_BITS_PER_SAMPLE / 8) * I2S_CHANNELS)

◆ SPDIF_BUF_ARRAY_SIZE

#define SPDIF_BUF_ARRAY_SIZE   (SPDIF_BUF_SIZE / sizeof(uint32_t))

◆ SPDIF_BUF_DIV

#define SPDIF_BUF_DIV   2

◆ SPDIF_BUF_SIZE

#define SPDIF_BUF_SIZE   (SPDIF_BLOCK_SIZE / SPDIF_BUF_DIV)

◆ SPDIF_DATA_PIN

#define SPDIF_DATA_PIN   23

◆ SYNC_FLIP

#define SYNC_FLIP   ((BMC_B ^ BMC_M) >> (SYNC_OFFSET * 8))

◆ SYNC_OFFSET

#define SYNC_OFFSET   2