123

Dependencies:   mbed

Fork of LG by igor Apu

Revision:
156:e68ee0bcdcda
Child:
167:bedc0a9d559a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DeviceI2C.h	Mon May 09 20:03:26 2016 +0000
@@ -0,0 +1,26 @@
+#ifndef __DEVICE_I2C_H__
+#define __DEVICE_I2C_H__
+
+typedef struct _DeviceI2CSettings {
+  uint32_t trigger;
+} DeviceI2CSettings;
+
+#define I2C_BUFFER_LENGTH 6
+typedef struct _DeviceI2CState {
+  uint32_t CON0;                      //Control register
+  uint32_t buffer[I2C_BUFFER_LENGTH]; //Transmission buffer
+  uint32_t position;                  //Buffer position
+  uint32_t counter;                   //Time out counter
+  uint32_t trigger;                   //Time out trigger
+  uint32_t enabled;                   //Transmission enabled
+} DeviceI2CState;
+
+typedef struct _DeviceI2C {
+  DeviceI2CState state;
+  DeviceI2CSettings settings;
+} DeviceI2C;
+
+void InitI2CWithDefaults(void);
+void InitI2C(void);
+void StartI2CTransmission(void);
+#endif  /* __DEVICE_I2C_H__ */
\ No newline at end of file