tas5706a.h
Go to the documentation of this file.00001
00044 #ifndef DRV_TAS5706A_H
00045 #define DRV_TAS5706A_H
00046
00047 #include "cfg/cfg_i2c.h"
00048
00049 #include <cfg/compiler.h>
00050
00051 #include <drv/i2c.h>
00052
00053 #if COMPILER_C99
00054 #define tas5706a_init(...) PP_CAT(tas5706a_init ## _, COUNT_PARMS(__VA_ARGS__)) (__VA_ARGS__)
00055 #define tas5706a_setLowPower(...) PP_CAT(tas5706a_setLowPower ## _, COUNT_PARMS(__VA_ARGS__)) (__VA_ARGS__)
00056 #define tas5706a_setVolume(...) PP_CAT(tas5706a_setVolume ## _, COUNT_PARMS(__VA_ARGS__)) (__VA_ARGS__)
00057 #else
00058 #define tas5706a_init(args...) PP_CAT(tas5706a_init ## _, COUNT_PARMS(args)) (args)
00059 #define tas5706a_setLowPower(args...) PP_CAT(tas5706a_setLowPower ## _, COUNT_PARMS(args)) (args)
00060 #define tas5706a_setVolume(args...) PP_CAT(tas5706a_setVolume ## _, COUNT_PARMS(args)) (args)
00061 #endif
00062
00063 typedef enum Tas5706aCh
00064 {
00065 TAS_CH1,
00066 TAS_CH2,
00067 TAS_CNT,
00068 } Tas5706aCh;
00069
00073 #define TAS_VOL_MIN 0
00074
00078 #define TAS_VOL_MAX 100
00079
00080 typedef uint8_t tas5706a_vol_t;
00081
00091 void tas5706a_setVolume_3(I2c *i2c, Tas5706aCh ch, tas5706a_vol_t vol);
00092
00102 void tas5706a_setLowPower_2(I2c *i2c, bool val);
00103
00109 void tas5706a_init_1(I2c *i2c);
00110
00111 #if !CONFIG_I2C_DISABLE_OLD_API
00112
00113 DEPRECATED INLINE void tas5706a_setVolume_2(Tas5706aCh ch, tas5706a_vol_t vol)
00114 {
00115 tas5706a_setVolume_3(&local_i2c_old_api, ch, vol);
00116 }
00117 DEPRECATED INLINE void tas5706a_setLowPower_1(bool val)
00118 {
00119 tas5706a_setLowPower_2(&local_i2c_old_api, val);
00120 }
00121 DEPRECATED INLINE void tas5706a_init_0(void)
00122 {
00123 tas5706a_init_1(&local_i2c_old_api);
00124 }
00125
00126 #endif
00127
00128 #endif