Audio DAIs of the SF32LB audio codec: its DAC and its ADC.
More...
|
| #define | PBL_AUDIO_SF32LB_AUDCODEC_DAI(dac, idx) (&((const struct pbl_audio_sf32lb_audcodec *)(dac))->dai[(idx)]) |
| | Get a DAI of an audio codec, as its sound-dai cell selects it.
|
| |
| #define | PBL_AUDIO_SF32LB_AUDCODEC_DEFINE(sym, _name, _base, _clk, _dac_dma, _adc1_dma, _adc2_dma, _pinctrl, _pmuc) |
| | Define an audio codec: its DAC, a playback DAI, and its ADC, a capture DAI.
|
| |
Audio DAIs of the SF32LB audio codec: its DAC and its ADC.
The audio codec (AUDCODEC) plays mono through its DAC, with its analog bias, PLL and output stage, at 8 to 48 kHz; its digital gain runs from -36 to 0 dB. Its ADC records one or two analog microphones, powered from its microphone bias, at the same rates: mono takes the first ADC, stereo both, the second with a DMA channel of its own. The ADC gain runs from -60 to +30 dB. Both stream through cyclic DMA channels, so rings have two periods, of a multiple of 4 bytes per channel. The CPU does not enter deep sleep while they stream.
In the devicetree, the codec takes one cell in sound-dai: 0 for the DAC, 1 for the ADC.
◆ pbl_audio_sf32lb_audcodec
| struct pbl_audio_sf32lb_audcodec |
| Data Fields |
|
const struct pbl_dma_chan * |
adc_dma[2] |
DMA channels of the first and second ADC, NULL for an ADC not recorded. |
|
uintptr_t |
base |
Register base address. |
|
struct pbl_clk |
clk |
Clock. |
|
const struct pbl_dma_chan * |
dac_dma |
DAC DMA channel. |
|
struct pbl_audio_dai |
dai[2] |
DAIs, by direction: the DAC, then the ADC. |
|
struct pbl_pinctrl |
pinctrl |
Pins of the analog inputs and the microphone bias. |
|
uintptr_t |
pmuc |
PMUC registers, holding the HXT48 buffer to the codec. |
|
struct pbl_audio_sf32lb_audcodec_state * |
state |
Driver runtime state. |
◆ PBL_AUDIO_SF32LB_AUDCODEC_DAI
Get a DAI of an audio codec, as its sound-dai cell selects it.
- Parameters
-
◆ PBL_AUDIO_SF32LB_AUDCODEC_DEFINE
| #define PBL_AUDIO_SF32LB_AUDCODEC_DEFINE |
( |
|
sym, |
|
|
|
_name, |
|
|
|
_base, |
|
|
|
_clk, |
|
|
|
_dac_dma, |
|
|
|
_adc1_dma, |
|
|
|
_adc2_dma, |
|
|
|
_pinctrl, |
|
|
|
_pmuc |
|
) |
| |
Value:
PBL_AUDIO_DAI_STATE_DEFINE(sym##_adc); \
static struct pbl_audio_sf32lb_audcodec_state sym##_audcodec_state = { \
}; \
.dai = \
{ \
PBL_AUDIO_DAI_INIT(sym##_adc, _name "-adc", nullptr, \
}, \
.base = (_base), \
.clk = _clk, \
.dac_dma = (_dac_dma), \
.adc_dma = {(_adc1_dma), (_adc2_dma)}, \
.pmuc = (_pmuc), \
.state = &sym##_audcodec_state, \
}; \
Audio codec.
Definition sf32lb.h:47
A digital audio interface of the SoC, streaming one direction.
Definition audio.h:355
#define PBL_AUDIO_DAI_INIT(sym, _name, _parent, _ops, _dir)
Initializer for a struct pbl_audio_dai.
Definition audio.h:409
#define PBL_AUDIO_DAI_STATE_DEFINE(sym)
Define the class state of a DAI.
Definition audio.h:396
@ PBL_AUDIO_PLAYBACK
From memory to the hardware.
Definition audio.h:90
@ PBL_AUDIO_CAPTURE
From the hardware to memory.
Definition audio.h:92
#define PBL_PINCTRL(_default, _sleep, _reg)
Initializer for a struct pbl_pinctrl.
Definition pinctrl.h:132
#define PBL_MUTEX_INITIALIZER
Static initializer for an unlocked mutex.
Definition mutex.h:50
Define an audio codec: its DAC, a playback DAI, and its ADC, a capture DAI.
- Parameters
-
| sym | Symbol of the DAC; the ADC is reached with PBL_AUDIO_SF32LB_AUDCODEC_DAI(). |
| _name | Device name. |
| _base | Register base address. |
| _clk | Clock, from PBL_CLK(). |
| _dac_dma | DAC DMA channel. |
| _adc1_dma | DMA channel of the first ADC, or NULL. |
| _adc2_dma | DMA channel of the second ADC, or NULL. |
| _pinctrl | Default state of the analog pins, or NULL. |
| _pmuc | PMUC registers. |