X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fdrv%2Ftas5706a.h;fp=bertos%2Fdrv%2Ftas5706a.h;h=2f602356d1899400dd5a2c91e8da0812800939ec;hb=e23c0ef94dcdb5392f27d338d4ba20b1227b2c17;hp=0000000000000000000000000000000000000000;hpb=cc700d4410b0b7056c1d7b872b400ba18f3d5164;p=bertos.git diff --git a/bertos/drv/tas5706a.h b/bertos/drv/tas5706a.h new file mode 100644 index 00000000..2f602356 --- /dev/null +++ b/bertos/drv/tas5706a.h @@ -0,0 +1,89 @@ +/** + * \file + * + * + * \brief TAS5706A Power DAC i2c driver. + * + * + * \version $Id$ + * \author Francesco Sacchi + */ + +#ifndef DRV_TAS5706A_H +#define DRV_TAS5706A_H + +#include + +typedef enum Tas5706aCh +{ + TAS_CH1, + TAS_CH2, + TAS_CNT, +} Tas5706aCh; + +/** + * TAS minimum volume (%). + */ +#define TAS_VOL_MIN 0 + +/** + * TAS maximum volume (%). + */ +#define TAS_VOL_MAX 100 + +typedef uint8_t tas5706a_vol_t; + +/** + * Set the volume for the specified channel. + * + * The volume must be expressed in % and will be at maximum CONFIG_TAS_MAX_VOL. + * + * \param ch The channel to be controlled. + * \param vol The volume you want to set. + */ +void tas5706a_setVolume(Tas5706aCh ch, tas5706a_vol_t vol); + +/** + * Initialize the TAS chip. + */ +void tas5706a_init(void); + +/** + * Set TAS chip to low power mode. + * + * When in low power mode, the TAS will not play any sound. You should put the TAS chip in low + * power whenever possible to prevent overheating and to save power. + * + * \param val True if you want to enable low power mode, false otherwise. + */ +void tas5706a_setLowPower(bool val); + +#endif /* DRV_TAS5706A_H */