First publishment of Shimabara Audio Codec Controller library. Including code for ADAU1361 and UMB-ADAU1361A. Working pretty fine. Checked with LPCXpresso 4337 and Unzen_lpc4337
Dependents: unzen_sample_LPC4088_quickstart unzen_sample_lpcxpresso_4337_callbacks unzen_sample_nucleo_f746 unzen_delay_sample_nucleo_f746 ... more
shimabaraは、mbedからオーディオ・コーデックのハードウェアを操作するクラス・ライブラリです。このライブラリは雲仙オーディオ・フレームワークと共に使うことを想定して開発しましたが、独立して使うことも可能です。
使い方
shimabaraは BaseAudioCodec, ADAU1361, UMB_ADAU1361Aの三つのクラスを定義しています。いずれのクラスも名前空間simabaraに属しています。実際のアプリケーションで使用するのはshimabara::UMB_ADAU1361Aだけで、このクラスはアクアシグナルのUMB-ADAU1361-Aに対応しています。ヘッダーファイルは umb_adau1361a.hです。
shimabara::UMB_ADAU1361Aのコンストラクタは三つの引数を受け取ります。
- Fs はサンプル周波数です。これはenum Fs_type型の引数で、やはり名前空間shimabaraに属しています。
- controller はADAU1361Aが接続されているI2Cポートに対応するI2Cオブジェクトを与えます。shimabaraはこのポートを通してCODECと通信します。
- Addrには、コーデックのI2Cアドレスを与えます。現時点ではこの引数は0x38固定です。
コンストラクタでオブジェクトを初期化したら、start()メソッドを呼んでください。これでshimabaraはコーデックと通信し、I2Sモードでの動作が始まります。
参考リンク
- 『雲仙』 オーディオ・フレームワーク
- skeleton_unzen_nucleo_f746 Nucleo F746ZGおよびUI基板を使う場合のスケルトンプログラム。F746を使う方はここから読み始めると良いでしょう。
Diff: umb_adau1361a.h
- Revision:
- 1:ea6d442bd68a
- Child:
- 2:fba0b8afebf0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/umb_adau1361a.h Sun May 08 09:52:42 2016 +0000 @@ -0,0 +1,61 @@ +/** +* \brief header file for the unzen audio frame work +* \arthur SeiichiHorie +* \date 8/May/2016 +*/ + +#ifndef _UMB_ADAU1361A_H_ +#define _UMB_ADAU1361A_H_ + +#include "adau1361.h" +#include "mbed.h" +/** + \brief audio framework name space. +*/ +namespace audiocodec +{ + + +/** +* \brief UMB-ADAU1361-A audio codec board controller. +* \details +* This class send a set of command to control an UMB-ADAU1361-A codec board. +* +* The hardware desription is here. http://dsps.shop-pro.jp/?pid=82798273 +*/ + class UMB_ADAU1361A:public Adau1361 + { + public: + /** + * \brief constructor. + * \param controler Pass the I2C controler object. + * \param Fs Sampling frequency. + * \param Addr I2C device address. value range is from 0 to 127 + * \details + * initialize the internal variables. + */ + UMB_ADAU1361A( I2C * controler, Fs_Type Fs = audiocodec::Fs_48, unsigned int Addr=0x38 ): + Adau1361( controler, Fs, Addr ){}; + protected: + /** + * \brief configuration of the PLL for the desired Fs. + * \details + * Configure the PLL based on the given Fs and hardware clock configuration. + * Fs is stored in fs member variable already. Hadrware clock have to be given + * from the circuit designer. For the UMB-ADAU1361-A, the clock is external + * 12MHz oscillator from the clock input. + */ + virtual void configure_pll(void); + /** + * \brief configuration of the the codec for UMB-ADAU1361-A + * \details + * Configure Internal signal pass and parameters for UMB-ADAU1361. + * The all pass-through signals are shut off. All cross channel signals are shut off. + * Monoral output is disabled. + */ + virtual void configure_board(void); + }; + +} + +#endif \ No newline at end of file