OSDN Git Service

[LCD] Fix click-noise of LCD=ON.
[openi2cradio/OpenI2CRadio.git] / i2c_io.h
index f97a666..ea4add0 100644 (file)
--- a/i2c_io.h
+++ b/i2c_io.h
@@ -31,6 +31,7 @@
 #else
 #include <xc.h>
 #endif
+
 #include <i2c.h>
 #include "iodef.h"
 
@@ -43,7 +44,7 @@ extern "C" {
 /*
  * #1
  */
-#define I2C_CLOCK_PARAM 19 // 8MHz/(4*(1+I2C_CLOCK_PARAM)) -> 100KHz
+#define I2C_CLOCK_PARAM 4 // 8MHz/(4*(1+I2C_CLOCK_PARAM)) -> 400KHz
 //#define I2C_CLOCK_PARAM 15 // 8MHz/(4*(1+I2C_CLOCK_PARAM)) -> 100KHz
 #define I2C_DEFAULT_MODE I2C_MASTER
 #define I2C_SLEW_DEFAULT I2C_SLEW_OFF
@@ -52,6 +53,9 @@ extern "C" {
 #define CLOSEASMASTER() i2c_close()
 extern void i2c1_init(void);
 extern void i2c2_init(void);
+extern void i2c_send_byte(unsigned char addr, unsigned char reg, unsigned char data);
+extern unsigned char i2c_read_byte(unsigned char addr, unsigned char reg);
+
 
 #ifdef __cplusplus
 }