|
static err | ecl::cs43l22< I2c, I2s, Rst_gpio >::init () |
| Codec low-level initialization routine. More...
|
|
static err | ecl::cs43l22< I2c, I2s, Rst_gpio >::power_up () |
| Codec power up sequence. More...
|
|
static err | ecl::cs43l22< I2c, I2s, Rst_gpio >::power_down () |
| Codec power down sequence. More...
|
|
static err | ecl::cs43l22< I2c, I2s, Rst_gpio >::send_pcm_buffer (const uint16_t *buffer, size_t count) |
| Send PCM buffer to the codec. More...
|
|
static err | ecl::cs43l22< I2c, I2s, Rst_gpio >::pcm_stream_start (const uint16_t *buffer, size_t count, user_callback callback) |
| Starts stream of the PCM buffer to the codec. More...
|
|
static err | ecl::cs43l22< I2c, I2s, Rst_gpio >::pcm_stream_stop () |
| Stop active stream. More...
|
|
static err | ecl::cs43l22< I2c, I2s, Rst_gpio >::set_master_volume (uint8_t volume, channel ch=channel::all) |
| Set master volume for specific channel. More...
|
|
static err | ecl::cs43l22< I2c, I2s, Rst_gpio >::set_headphone_volume (uint8_t volume, channel ch=channel::all) |
| Set headphone volume for specific channel. More...
|
|
static err | ecl::cs43l22< I2c, I2s, Rst_gpio >::headphone_mute (channel ch=channel::all) |
| Mute headphone channel. More...
|
|
static err | ecl::cs43l22< I2c, I2s, Rst_gpio >::headphone_unmute (channel ch=channel::all) |
| Unmute headphone channel. More...
|
|
static err | ecl::cs43l22< I2c, I2s, Rst_gpio >::set_beep_on_time (beep_on_time value) |
| Set beep on time. More...
|
|
static err | ecl::cs43l22< I2c, I2s, Rst_gpio >::set_beep_off_time (beep_off_time value) |
| Set beep off time. More...
|
|
static err | ecl::cs43l22< I2c, I2s, Rst_gpio >::set_beep_frequency (beep_frequency value) |
| Set beep frequency. More...
|
|
static err | ecl::cs43l22< I2c, I2s, Rst_gpio >::set_beep_volume (uint8_t volume) |
| Set beep Volume. More...
|
|
static err | ecl::cs43l22< I2c, I2s, Rst_gpio >::beep_enable (beep_mode mode=beep_mode::multiple) |
| Enable beep generator. More...
|
|
static err | ecl::cs43l22< I2c, I2s, Rst_gpio >::beep_disable () |
| Disable beep generator. More...
|
|
template<ecl::i2s::audio_frequency frequency> |
static err | ecl::cs43l22< I2c, I2s, Rst_gpio >::set_sampling_frequency () |
| Set sampling frequency for PCM audio data. More...
|
|
template<class I2c , class I2s , class Rst_gpio >
Codec power up sequence.
Must not be called if codec is already powered.
This method performs power up sequence of the codec which is recommended by CS43L22 Reference Manual (RM). To use this method, the init() method must be called previously.
- Return values
-
template<class I2c , class I2s , class Rst_gpio >
Codec power down sequence.
Must not be called if codec is not powered.
This method performs power down sequence of the codec which is recommended by CS43L22 Reference Manual (RM). To use this method, the init() method must be called previously.
- Return values
-
template<class I2c , class I2s , class Rst_gpio >
err ecl::cs43l22< I2c, I2s, Rst_gpio >::send_pcm_buffer |
( |
const uint16_t * |
buffer, |
|
|
size_t |
count |
|
) |
| |
|
static |
Send PCM buffer to the codec.
This method blocks until all data is transferred. The PCM data contains audio samples. Sample size is constant and equal to 16 bit. Sampling frequency can be changed with cs43l22< I2c, I2s, Rst_gpio >::set_sampling_frequency() method. The buffer format is next: LRLR.... Where L - left channel and R - right channel.
- Parameters
-
buffer | The buffer which contains PCM data. Must not be null. |
count | Number of samples in PCM buffer. Must not be null. |
- Return values
-
template<class I2c , class I2s , class Rst_gpio >
Starts stream of the PCM buffer to the codec.
When stream is started, the user callback is called on two events: Halt Transfer (HT) and Transfer Completed (TC). When half of samples are transferred, the HT is generated and user can write the data into fist half of the buffer. After all sample are transferred, the TC is generated. After this the codec is continuing streaming from the start of the buffer until it is stopped by cs43l22< I2c, I2s, Rst_gpio >::pcm_stream_stop(). NOTE: The HT and TC events are generated in IRQ context. The user callback should not perform blocking operations, busy wait etc. The PCM data contains audio samples. Sample size is constant and equal to 16 bit. Sampling frequency can be changed with cs43l22< I2c, I2s, Rst_gpio >::set_sampling_frequency() method. The buffer format is next: LRLR.... Where L - left channel and R - right channel.
- Parameters
-
buffer | The buffer which contains PCM data. Must not be null. |
count | Number of samples in PCM buffer. Must not be null. Must be multiple of 2 and less of equal to 0xFFFF. |
callback | User callback is called on HT and TC events. |
- Return values
-
template<class I2c , class I2s , class Rst_gpio >
Stop active stream.
Must not be called if stream is not active.
This method stops active PCM stream. It is recommended to call this method during processing of the HT or TC event. In case this method is called during processing of the TC event the steam will be stopped immediately. Otherwise, it will be stopped after next TC event.
- Return values
-