This library controls a ST TDA7419 audio control IC. This is part of a project to implement an mbed controlled car stereo. The TDA7419 will take in stereo and output four channels of audio plus a subwoofer channel.
Revision 0:86ea14016b10, committed 2014-10-19
- Comitter:
- danielashercohen
- Date:
- Sun Oct 19 04:30:22 2014 +0000
- Child:
- 1:69c37f1ab7df
- Commit message:
- first sound from the TDA7419;
Changed in this revision
| PreampTDA7419.cpp | Show annotated file Show diff for this revision Revisions of this file |
| PreampTDA7419.h | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/PreampTDA7419.cpp Sun Oct 19 04:30:22 2014 +0000
@@ -0,0 +1,39 @@
+/** PreampTDA7419 Library
+ *
+ * @Author: Dan Cohen
+ */
+
+#include "mbed.h"
+#include "PreampTDA7419.h"
+#include <stdio.h>
+#include <string.h>
+#include <inttypes.h>
+
+
+
+PreampTDA7419::PreampTDA7419(PinName sda, PinName scl):
+ _device(sda, scl)
+{
+ _address = (TDA7419_ADDRESS<<1);
+ // _device.frequency(100000);
+ //_device.frequency(10000);
+ //_Comdelay=70;
+}
+
+
+void PreampTDA7419::setI2CAddress(uint8_t add)
+{
+ _address = (add<<1);
+}
+
+
+int PreampTDA7419::i2c_write(char command, char value) {
+ int transmissionSuccessful;
+ _device.start();
+ _device.write(_address);
+ _device.write(command);
+ _device.write(value);
+ _device.stop();
+ return (transmissionSuccessful);
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/PreampTDA7419.h Sun Oct 19 04:30:22 2014 +0000
@@ -0,0 +1,70 @@
+/** TDA7419 PreAmp library, I2C
+ *
+ * @Author: Dan Cohen
+ */
+#ifndef DigoleSerialDisp_h
+#define DigoleSerialDisp_h
+
+#include "mbed.h"
+#include <inttypes.h>
+
+ ///////////////////////////
+// Variables for TDA7419 //
+///////////////////////////
+// I2C address for TDA7419
+#define TDA7419_ADDRESS 0x44
+
+#define DEC 10
+#define HEX 16
+#define OCT 8
+#define BIN 2
+
+ /** TDA7419 PreAmp library
+ *
+ * Includes the commands for volume, fader, subwoofer and tone controls
+ *
+ */
+class PreampTDA7419 {
+public:
+
+ /** Create a new Digole Serial Display interface
+ *
+ * @param sda is the pin for I2C SDA
+ * @param scl is the pin for I2C SCL
+ * @param address is the 7-bit address (default is 0x27 for the device)
+ */
+ PreampTDA7419(PinName sda, PinName scl);
+
+ /** Sets a new I2C address for the Preamp board (perhaps not useful as it is fixed for the TDA4719)
+ * @param address is the the new address
+ */
+ void setI2CAddress(uint8_t add);
+
+ /** Set up the TDA7419 to default values that will allow audio to pass through the device
+ *
+ */
+ void initialize();
+ int i2c_write(char command, char value);
+
+private:
+ I2C _device;
+ uint8_t _address;
+ uint8_t _Comdelay;
+
+};
+
+#endif
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file