Audio devices of the SF32LB52: the audio codec DAC and the PDM interface.
More...
|
| #define | PBL_AUDIO_SF32LB52_AUDCODEC_DEFINE(sym, _name, _dma, _dma_irq, _link) |
| | Define the audio codec DAC, a playback device.
|
| |
| #define | PBL_AUDIO_SF32LB52_PDM_DEFINE(sym, _name, _pinctrl, _irq, _dma, _dma_irq, _vdd) |
| | Define the PDM interface, a capture device.
|
| |
Audio devices of the SF32LB52: the audio codec DAC and the PDM interface.
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. The PDM interface records one or two digital microphones at 8 to 48 kHz, mono taking the left channel; its gain runs from -15 to +45 dB. Both stream through a cyclic DMA channel of SF32LB52_DMAC1, so rings have two periods, of a multiple of 4 bytes; the board connects and gives the channel interrupt. The CPU does not enter deep sleep while they stream.
&s_speaker_link);
#define PBL_AUDIO_SF32LB52_AUDCODEC_DEFINE(sym, _name, _dma, _dma_irq, _link)
Define the audio codec DAC, a playback device.
Definition sf32lb52.h:70
#define SF32LB52_DMA_REQ_AUDAC_CH0
Definition sf32lb52.h:88
#define SF32LB52_DMA_PL_HIGH
High priority.
Definition sf32lb52.h:41
#define SF32LB52_DMAC1
HPSYS DMA controller.
Definition sf32lb52.h:112
void pbl_dma_sf32lb52_irq_handler(const struct pbl_dma_chan *chan)
Channel interrupt handler, to connect with PBL_IRQ_CONNECT().
A channel, as used by a consumer.
Definition dma.h:91
#define PBL_DMA_CHAN(_ctrl, _channel, _request, _config)
Initializer for a struct pbl_dma_chan.
Definition dma.h:110
#define PBL_IRQN(line)
Number of a SoC interrupt line from soc_irqs.h.
Definition irq.h:93
#define PBL_IRQ_CONNECT(line, prio, isr, arg, flags)
Bind a SoC interrupt line to a handler at build time.
Definition irq.h:117
◆ pbl_audio_sf32lb52_audcodec
| struct pbl_audio_sf32lb52_audcodec |
| Data Fields |
|
struct pbl_audio |
audio |
Audio device. |
|
const struct pbl_dma_chan * |
dma |
DAC DMA channel. |
|
pbl_irq_t |
dma_irq |
Interrupt of the DMA channel. |
|
struct pbl_audio_sf32lb52_audcodec_state * |
state |
Driver runtime state. |
◆ pbl_audio_sf32lb52_pdm
| struct pbl_audio_sf32lb52_pdm |
PDM microphone interface.
| Data Fields |
|
struct pbl_audio |
audio |
Audio device. |
|
const struct pbl_dma_chan * |
dma |
DMA channel. |
|
pbl_irq_t |
dma_irq |
Interrupt of the DMA channel. |
|
pbl_irq_t |
irq |
PDM interrupt, reporting FIFO overflows. |
|
const struct pbl_pinctrl * |
pinctrl |
Clock and data pins. |
|
struct pbl_audio_sf32lb52_pdm_state * |
state |
Driver runtime state. |
|
const struct pbl_regulator * |
vdd |
Microphone supply, on while recording, or NULL. |
◆ PBL_AUDIO_SF32LB52_AUDCODEC_DEFINE
| #define PBL_AUDIO_SF32LB52_AUDCODEC_DEFINE |
( |
|
sym, |
|
|
|
_name, |
|
|
|
_dma, |
|
|
|
_dma_irq, |
|
|
|
_link |
|
) |
| |
Value:
static struct pbl_audio_sf32lb52_audcodec_state sym##_audcodec_state; \
.dma = (_dma), \
.
state = &sym##_audcodec_state, \
}; \
PBL_DEVICE_REGISTER(sym, &sym.
audio.
dev)
pbl_irq_t dma_irq
Interrupt of the DMA channel.
Definition sf32lb52.h:51
struct pbl_audio audio
Audio device.
Definition sf32lb52.h:47
Audio codec DAC.
Definition sf32lb52.h:45
struct pbl_audio_state * state
Runtime state.
Definition audio.h:308
struct pbl_device dev
Device.
Definition audio.h:304
#define PBL_AUDIO_INIT(sym, _name, _dir, _ops, _link, _deps)
Initializer for a struct pbl_audio.
Definition audio.h:346
#define PBL_AUDIO_STATE_DEFINE(sym)
Define the class state of an audio device.
Definition audio.h:331
@ PBL_AUDIO_PLAYBACK
From memory to the hardware.
Definition audio.h:88
#define PBL_DEVICE_DEPS(...)
Static dependency list for struct pbl_device::deps.
Definition device.h:122
Define the audio codec DAC, a playback device.
- Parameters
-
| sym | Symbol of the device. |
| _name | Device name. |
| _dma | DAC DMA channel, on SF32LB52_DMAC1 with request SF32LB52_DMA_REQ_AUDAC_CH0. |
| _dma_irq | Interrupt of the DMA channel. |
| _link | What the DAC is wired to, or NULL. |
◆ PBL_AUDIO_SF32LB52_PDM_DEFINE
| #define PBL_AUDIO_SF32LB52_PDM_DEFINE |
( |
|
sym, |
|
|
|
_name, |
|
|
|
_pinctrl, |
|
|
|
_irq, |
|
|
|
_dma, |
|
|
|
_dma_irq, |
|
|
|
_vdd |
|
) |
| |
Value:
static struct pbl_audio_sf32lb52_pdm_state sym##_pdm_state; \
static const struct pbl_pinctrl sym##_pdm_pins = _pinctrl; \
.pinctrl = &sym##_pdm_pins, \
.irq = (_irq), \
.dma_irq = (_dma_irq), \
.
state = &sym##_pdm_state, \
}; \
PBL_DEVICE_REGISTER(sym, &sym.
audio.
dev)
struct pbl_audio audio
Audio device.
Definition sf32lb52.h:91
const struct pbl_regulator * vdd
Microphone supply, on while recording, or NULL.
Definition sf32lb52.h:101
const struct pbl_dma_chan * dma
DMA channel.
Definition sf32lb52.h:97
PDM microphone interface.
Definition sf32lb52.h:89
@ PBL_AUDIO_CAPTURE
From the hardware to memory.
Definition audio.h:90
Pin states of a peripheral, as used by a consumer.
Definition pinctrl.h:117
struct pbl_regulator_state * state
Runtime state.
Definition regulator.h:54
Define the PDM interface, a capture device.
- Parameters
-
| sym | Symbol of the device. |
| _name | Device name. |
| _pinctrl | Clock and data pins, from PBL_PINCTRL(). |
| _irq | PDM interrupt; the board connects pbl_audio_sf32lb52_pdm_irq_handler() to it. |
| _dma | DMA channel, on SF32LB52_DMAC1 with request SF32LB52_DMA_REQ_PDM1_L. |
| _dma_irq | Interrupt of the DMA channel. |
| _vdd | Microphone supply, or NULL. |
◆ pbl_audio_sf32lb52_pdm_irq_handler()