Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: TLV320AIC1110.h
- Revision:
- 4:470f89e786f9
- Parent:
- 3:4592d862ef88
--- a/TLV320AIC1110.h Wed May 15 21:12:22 2013 +0000 +++ b/TLV320AIC1110.h Fri May 17 20:33:16 2013 +0000 @@ -42,18 +42,83 @@ private: I2C *_i2c; + /** + * @enum TLV320AIC1110_REGISTERS + * @brief The device register map + */ enum TLV320AIC1110_REGISTERS { POWER_CONTROL = 0, MODE_CONTROL, TXPGA, RXPGA, HI_DTMF, LO_DTMF, AUX }; + + /** + * @enum CHANNEL_T + * @brief List of channels that can be muted / unmuted + */ + enum CHANNEL_T + { + RECEIVE = 0x04, TRANSMIT = 0x40, SIDETONE = 0x80 + }; public: + /** Create the TLV320AIC1110 object + * @param i2c - A defined I2C object + */ TLV320AIC1110(I2C &i2c); + + /** Destroy the TLV320AIC1110 object + */ ~TLV320AIC1110(); - void regDump(void) const ; - void init(void) const ; - void writeRegister(const TLV320AIC1110_REGISTERS reg, const uint8_t value) const ; - uint8_t readRegister(const uint8_t reg) const ; + + /** Print register values to the stdio stream + */ + void regDump(void); + + /** Initialize the register settings to basic operational settings + */ + void init(void); + + /** Direct write access to a device register + * @param reg - A register name from the register map enum + * @param value - The value to write to the specified register + */ + void writeRegister(const TLV320AIC1110_REGISTERS reg, const uint8_t value); + + /** Read the contents from a specific register + * @param reg - A register name from the register map enum + */ + uint8_t readRegister(const uint8_t reg); + + /** Mute an audio stream - bit mapped enum values so multiple can be "or'd" and passed + * @param ch - A channel name from the channel access enum + */ + void mute(const CHANNEL_T ch); + + /** Un-mute an audio stream - bit mapped enum values so multiple can be "or'd" and passed + * @param ch - A channel name from the channel access enum + */ + void unmute(const CHANNEL_T ch); + + /** Adjust the gain applied to the transmit audio stream + * @param gain - Adjustable from 20dB to 42dB in 2dB steps (passed as 20 ... 42) + */ + uint32_t txGain(const uint8_t gain); + + /** Adjust the local sidetone + * @param gain - Adjustable from -12dB to -24dB in 2dB steps (passed as -12 ... -24) + */ + uint32_t sidetoneGain(const int8_t gain); + + /** Adjust the gain applied to the receive audio stream + * @param gain - Adjustable from 6dB to -6dB in 1dB steps (passed as 6 ... -6) + */ + uint32_t rxGain(const int8_t gain); + + /** Adjust the volume of the EARxOP outputs that drive speakers or line outputs + * @param gain - Adjustable from 0dB to -18dB in 2dB steps (passed as 0 ... -18) + */ + uint32_t rxVolume(const int8_t gain); + };