|
| #define | PBL_AUDIO_BUF_ALIGN 32U |
| | Alignment, in bytes, of rings and their size: the largest data cache line.
|
| |
| #define | PBL_AUDIO_MAX_PERIODS 32U |
| | Most periods in a ring.
|
| |
| #define | PBL_AUDIO_CODEC_INIT(sym, _name, _init, _parent, _ops) |
| | Initializer of a struct pbl_audio_codec.
|
| |
| #define | PBL_AUDIO_AMP_INIT(sym, _name, _init, _parent, _ops) |
| | Initializer of a struct pbl_audio_amp.
|
| |
| #define | PBL_AUDIO_DAI_STATE_DEFINE(sym) |
| | Define the class state of a DAI.
|
| |
| #define | PBL_AUDIO_DAI_INIT(sym, _name, _parent, _ops, _dir) |
| | Initializer for a struct pbl_audio_dai.
|
| |
| #define | PBL_AUDIO_CARD_DEFINE(sym, _name, _dai, _codec, _amp, _fmt, _clocks) |
| | Define a card.
|
| |
|
|
| #define | PBL_AUDIO_RATE_8000 PBL_BIT(0) |
| | 8 kHz.
|
| |
| #define | PBL_AUDIO_RATE_11025 PBL_BIT(1) |
| | 11.025 kHz.
|
| |
| #define | PBL_AUDIO_RATE_12000 PBL_BIT(2) |
| | 12 kHz.
|
| |
| #define | PBL_AUDIO_RATE_16000 PBL_BIT(3) |
| | 16 kHz.
|
| |
| #define | PBL_AUDIO_RATE_22050 PBL_BIT(4) |
| | 22.05 kHz.
|
| |
| #define | PBL_AUDIO_RATE_24000 PBL_BIT(5) |
| | 24 kHz.
|
| |
| #define | PBL_AUDIO_RATE_32000 PBL_BIT(6) |
| | 32 kHz.
|
| |
| #define | PBL_AUDIO_RATE_44100 PBL_BIT(7) |
| | 44.1 kHz.
|
| |
| #define | PBL_AUDIO_RATE_48000 PBL_BIT(8) |
| | 48 kHz.
|
| |
|
|
| #define | PBL_AUDIO_FMT_I2S PBL_BIT(0) |
| | I2S framing.
|
| |
| #define | PBL_AUDIO_FMT_CODEC_MASTER PBL_BIT(1) |
| | The codec drives the bit and frame clocks.
|
| |
|
| static uint8_t | pbl_audio_dir (const struct pbl_audio *audio) |
| | Get the direction of a card.
|
| |
| static const struct pbl_audio * | pbl_audio_dai_card (const struct pbl_audio_dai *dai) |
| | Get the card of a DAI, for drivers.
|
| |
| void | pbl_audio_period_elapsed (const struct pbl_audio *audio) |
| | Report the end of the period the hardware was working on.
|
| |
| void | pbl_audio_report_xrun (const struct pbl_audio *audio) |
| | Report a hardware overrun or underrun, flagged in the next callback.
|
| |
| void * | pbl_audio_period (const struct pbl_audio *audio, uint8_t idx) |
| | Get a period of the running stream, for drivers.
|
| |
| int | pbl_audio_get_caps (const struct pbl_audio *audio, struct pbl_audio_caps *caps) |
| | Get what a device can do, including its codec.
|
| |
| int | pbl_audio_start (const struct pbl_audio *audio, const struct pbl_audio_stream *stream) |
| | Start streaming.
|
| |
| int | pbl_audio_period_ready (const struct pbl_audio *audio, void *period) |
| | Give a period back to the hardware: refilled for playback, read for capture.
|
| |
| int | pbl_audio_stop (const struct pbl_audio *audio) |
| | Stop streaming.
|
| |
| int | pbl_audio_set_gain (const struct pbl_audio *audio, int32_t gain_mdb) |
| | Set the gain.
|
| |
| int | pbl_audio_set_mute (const struct pbl_audio *audio, bool mute) |
| | Mute or unmute.
|
| |
| int | pbl_audio_get_position (const struct pbl_audio *audio, struct pbl_audio_pos *pos) |
| | Get the current stream position.
|
| |
| bool | pbl_audio_is_running (const struct pbl_audio *audio) |
| | Check whether a device is streaming.
|
| |
| size_t | pbl_audio_ring_bytes (const struct pbl_audio_stream *stream) |
| | Get the bytes of a ring.
|
| |
| void * | pbl_audio_buf_alloc (size_t size) |
| | Allocate a ring: aligned and padded to PBL_AUDIO_BUF_ALIGN, reachable by DMA.
|
| |
| void | pbl_audio_buf_free (void *buf) |
| | Free a ring from pbl_audio_buf_alloc().
|
| |
| uint32_t | pbl_audio_rate_bit (uint32_t rate) |
| | Get the bit of a sample rate.
|
| |
| static int32_t | pbl_audio_gain_to_step (int32_t gain_mdb, int32_t min_mdb, int32_t step_mdb) |
| | Convert a gain in mdB to the register steps of a hardware gain stage.
|
| |