TLV320_RBSP class, defined on the I2C master bus.
Dependents: MovPlayer GR-PEACH_Audio_Playback_Sample GR-PEACH_Audio_Playback_7InchLCD_Sample RGA-MJPEG_VideoDemo ... more
Fork of TLV320_RBSP by
Revision 4:15487e571d9f, committed 2015-10-21
- Comitter:
- dkato
- Date:
- Wed Oct 21 06:58:35 2015 +0000
- Parent:
- 3:db6504d3f914
- Commit message:
- Add API "micVolume()".
Changed in this revision
| TLV320_RBSP.cpp | Show annotated file Show diff for this revision Revisions of this file |
| TLV320_RBSP.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/TLV320_RBSP.cpp Tue Aug 18 04:34:26 2015 +0000
+++ b/TLV320_RBSP.cpp Wed Oct 21 06:58:35 2015 +0000
@@ -29,7 +29,7 @@
#undef MCLK_11_2896MHZ
TLV320_RBSP::TLV320_RBSP(PinName cs, PinName sda, PinName scl, PinName sck, PinName ws, PinName tx, PinName rx, uint8_t int_level, int32_t max_write_num, int32_t max_read_num)
- : mI2c_(sda, scl), mI2s_(sck, ws, tx, rx, int_level, max_write_num, max_read_num), audio_cs_(cs) {
+ : audio_cs_(cs), mI2c_(sda, scl), mI2s_(sck, ws, tx, rx, int_level, max_write_num, max_read_num) {
audio_cs_ = 0;
mAddr = 0x34;
audio_path_control = 0;
@@ -139,6 +139,22 @@
mI2c_.write(mAddr, cmd, 2);
}
+void TLV320_RBSP::micVolume(bool mute, bool boost) {
+ cmd[0] = ANALOG_AUDIO_PATH_CONTROL;
+ if (mute != false) {
+ audio_path_control |= (1 << 1); // MICM Muted
+ } else {
+ audio_path_control &= ~(1 << 1); // MICM Normal
+ }
+ if (boost != false) {
+ audio_path_control |= (1 << 0); // MICB 20dB
+ } else {
+ audio_path_control &= ~(1 << 0); // MICB 0dB
+ }
+ cmd[1] = audio_path_control;
+ mI2c_.write(mAddr, cmd, 2);
+}
+
void TLV320_RBSP::mute(bool softMute) {
cmd[0] = DIGITAL_AUDIO_PATH_CONTROL;
if (softMute != false) {
--- a/TLV320_RBSP.h Tue Aug 18 04:34:26 2015 +0000
+++ b/TLV320_RBSP.h Wed Oct 21 06:58:35 2015 +0000
@@ -146,6 +146,13 @@
*/
void mic(bool micVar);
+ /** Microphone volume
+ *
+ * @param mute Microphone mute. true : mute , false : normal
+ * @param boost Microphone boost. true : 20dB , false : 0dB
+ */
+ void micVolume(bool mute, bool boost = false);
+
/** Digital audio path control
*
* @param softMute Mute output
