Sound Byte Libs 29c5ff3
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
Namespaces | Typedefs | Functions
driver.hpp File Reference

Audio driver interface - canonical types and convenience functions. More...

#include "types.hpp"
Include dependency graph for driver.hpp:

Go to the source code of this file.

Namespaces

namespace  sbl
 Root namespace for all Sound Byte Libs functionality.
 
namespace  sbl::audio
 

Typedefs

using sbl::audio::AudioConfig = sbl::hal::audio::AudioConfig
 
using sbl::audio::AudioCallback = sbl::hal::audio::AudioCallback
 

Functions

template<typename Driver >
void sbl::audio::start (AudioCallback cb)
 Configure audio with defaults, set callback, and start streaming.
 
template<typename Driver >
void sbl::audio::start (const AudioConfig &config, AudioCallback cb)
 Configure with custom settings, set callback, and start streaming.
 
template<typename Driver >
void sbl::audio::stop ()
 Stop audio streaming.
 

Detailed Description

Audio driver interface - canonical types and convenience functions.

This header provides the portable audio API for Sound Byte Libs.

Audio Driver Contract

Drivers implement the following static interface:

static void init() - Configure with defaults static void init(const AudioConfig&) - Configure with custom settings static void set_callback(AudioCallback) - Register processing function static void start() - Begin streaming static void stop() - Stop streaming

Convenience Functions

sbl::audio::start<sbl::driver::Sai>(my_callback); sbl::audio::stop<sbl::driver::Sai>();

Usage in application: #include <sbl/hal/audio/driver.hpp> #include <sbl/hw/driver/sai.hpp>

sbl::audio::start<sbl::driver::Sai>(audio_callback);

Definition in file driver.hpp.