Mercurial > hg > beaglert
comparison include/I2c_Codec.h @ 0:8a575ba3ab52
Initial commit.
author | andrewm |
---|---|
date | Fri, 31 Oct 2014 19:10:17 +0100 |
parents | |
children | ef9392d077a4 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:8a575ba3ab52 |
---|---|
1 /* | |
2 * I2c_Codec.h | |
3 * | |
4 * Handle writing the registers to the TLV320AIC310x | |
5 * series audio codecs, used on the BeagleBone Audio Cape. | |
6 * This code is designed to bypass the ALSA driver and | |
7 * configure the codec directly in a sensible way. It | |
8 * is complemented by code running on the PRU which uses | |
9 * the McASP serial port to transfer audio data. | |
10 * | |
11 * Created on: May 25, 2014 | |
12 * Author: Andrew McPherson | |
13 */ | |
14 | |
15 | |
16 #ifndef I2CCODEC_H_ | |
17 #define I2CCODEC_H_ | |
18 | |
19 #include "I2c.h" | |
20 | |
21 | |
22 class I2c_Codec : public I2c | |
23 { | |
24 public: | |
25 int writeRegister(unsigned int reg, unsigned int value); | |
26 | |
27 int initCodec(); | |
28 int startAudio(int dual_rate); | |
29 int stopAudio(); | |
30 | |
31 int setDACVolume(int halfDbSteps); | |
32 int writeDACVolumeRegisters(bool mute); | |
33 int setADCVolume(int halfDbSteps); | |
34 int writeADCVolumeRegisters(bool mute); | |
35 int setHPVolume(int halfDbSteps); | |
36 int writeHPVolumeRegisters(); | |
37 | |
38 int readI2C(); | |
39 | |
40 I2c_Codec(); | |
41 ~I2c_Codec(); | |
42 | |
43 private: | |
44 bool running; | |
45 int dacVolumeHalfDbs; | |
46 int adcVolumeHalfDbs; | |
47 int hpVolumeHalfDbs; | |
48 }; | |
49 | |
50 | |
51 #endif /* I2CCODEC_H_ */ |