Amplifier switched by an enable GPIO, with an optional supply.
More...
Amplifier switched by an enable GPIO, with an optional supply.
Some class-D amplifiers select their mode from the number of pulses on the enable line before it stays active: the driver sends mode_pulses pulses of pulse_us high and low first.
.mode_pulses = 1, .pulse_us = 200, .settle_us = 2000);
#define PBL_AUDIO_AMP_GPIO_DEFINE(sym, _name, _enable, _supply,...)
Define a GPIO amplifier.
Definition amp_gpio.h:57
#define SF32LB_GPIO1
Port GPIO1 (PA).
Definition sf32lb.h:46
#define PBL_GPIO(_port, _pin, _flags)
Initializer for a struct pbl_gpio.
Definition gpio.h:148
◆ pbl_audio_amp_gpio
| struct pbl_audio_amp_gpio |
| Data Fields |
|
struct pbl_audio_amp |
amp |
Amplifier. |
|
struct pbl_gpio |
enable |
Enable line. |
|
uint8_t |
mode_pulses |
Mode pulses sent before enabling. |
|
uint16_t |
pulse_us |
Length of each half of a mode pulse, in microseconds. |
|
uint16_t |
settle_us |
Time to settle once the line is driven inactive, in microseconds. |
|
const struct pbl_regulator * |
supply |
Supply, or NULL. |
◆ PBL_AUDIO_AMP_GPIO_DEFINE
| #define PBL_AUDIO_AMP_GPIO_DEFINE |
( |
|
sym, |
|
|
|
_name, |
|
|
|
_enable, |
|
|
|
_supply, |
|
|
|
... |
|
) |
| |
Value:
{ \
.ops = &pbl_audio_amp_gpio_ops, \
}, \
.enable = _enable, \
.supply = (_supply), \
__VA_ARGS__ \
}; \
PBL_DEVICE_REGISTER(sym, &sym.
amp.
dev)
struct pbl_audio_amp amp
Amplifier.
Definition amp_gpio.h:30
GPIO amplifier.
Definition amp_gpio.h:28
struct pbl_device dev
Device.
Definition audio.h:269
#define PBL_DEVICE_STATE_DEFINE(sym)
Define the runtime state of device instance sym.
Definition device.h:129
#define PBL_DEVICE_INIT(sym, _name, _init, _parent, _deps)
Initializer for the struct pbl_device of device instance sym.
Definition device.h:162
Define a GPIO amplifier.
- Parameters
-
| sym | Symbol of the amplifier. |
| _name | Device name. |
| _enable | Enable line, from PBL_GPIO(). |
| _supply | Supply, or NULL. |
| ... | Further fields: mode_pulses, pulse_us, settle_us. |