The best way to support a new codec is to use the provided template (AFCodecTemplate.cpp) following the recommended list of actions given below, as well as consult existing implementations, e.g. AFCodecWM8993.cpp or AFCodecWM8988.cpp.
-
Fill in the codec capabilities so it can be picked up by the Audio Framework when doing automatic configuration.
-
Implement AFCodec::Init to initialize the codec given the currently used path.
-
Implement AFCodec::InitI2SBus to support all the featured capabilities of the codec such as different sample rates, master/slave playback and recording.
-
Implement AFCodec::Deinit for shutting down the codec (optional).
-
Implement other codec specific functionality like muting/unmuting, actions on power-up/power-down and so on. (optional).
The best way to support a new CPU is to use the provided template (AFCPUTemplate.cpp) following the recommended list of actions given below, as well as consult existing implementations, e.g. AFCPUPXA270.cpp or AFCPUS3C6400.cpp.
-
Fill in the CPU capabilities so it can be picked up by the Audio Framework when doing automatic configuration.
-
Map /unmap the registers to memory for configuring the controllers.
-
Initialize I2S (either directly or via another driver or library).
-
Initialize and prepare DMA (either directly or via another driver or library).
-
Create an IST to trigger input/output events in case the CPU does not have distinct IRQs for input/output.
-
Implement power up/down functionality.
-
Implement other CPU specific functionality (optional).
-
Create a file '$(_TGTPLAT)_sourcelibs' in '$(_TARGETPLATROOT)\src\drivers\AudioFramework\CPUs\' and add all necessary libraries needed for linking.