From e34a21ff824ba7d3d887c128c90bef9b5f2525eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Thu, 28 Jun 2018 21:25:21 +0200 Subject: [PATCH] Allways define i2c prototypes --- code/espurna/config/prototypes.h | 44 +++++++++++++++----------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/code/espurna/config/prototypes.h b/code/espurna/config/prototypes.h index 885b2b8b..5f4436c9 100644 --- a/code/espurna/config/prototypes.h +++ b/code/espurna/config/prototypes.h @@ -56,29 +56,27 @@ bool gpioReleaseLock(unsigned char gpio); // ----------------------------------------------------------------------------- // I2C // ----------------------------------------------------------------------------- -#if I2C_SUPPORT - void i2cScan(); - void i2cClearBus(); - bool i2cGetLock(unsigned char address); - bool i2cReleaseLock(unsigned char address); - unsigned char i2cFindAndLock(size_t size, unsigned char * addresses); - - void i2c_wakeup(uint8_t address); - uint8_t i2c_write_buffer(uint8_t address, uint8_t * buffer, size_t len); - uint8_t i2c_write_uint8(uint8_t address, uint8_t value); - uint8_t i2c_write_uint8(uint8_t address, uint8_t reg, uint8_t value); - uint8_t i2c_write_uint8(uint8_t address, uint8_t reg, uint8_t value1, uint8_t value2); - uint8_t i2c_write_uint16(uint8_t address, uint16_t value); - uint8_t i2c_write_uint16(uint8_t address, uint8_t reg, uint16_t value); - uint8_t i2c_read_uint8(uint8_t address); - uint8_t i2c_read_uint8(uint8_t address, uint8_t reg); - uint16_t i2c_read_uint16(uint8_t address); - uint16_t i2c_read_uint16(uint8_t address, uint8_t reg); - uint16_t i2c_read_uint16_le(uint8_t address, uint8_t reg); - int16_t i2c_read_int16(uint8_t address, uint8_t reg); - int16_t i2c_read_int16_le(uint8_t address, uint8_t reg); - void i2c_read_buffer(uint8_t address, uint8_t * buffer, size_t len); -#endif +void i2cScan(); +void i2cClearBus(); +bool i2cGetLock(unsigned char address); +bool i2cReleaseLock(unsigned char address); +unsigned char i2cFindAndLock(size_t size, unsigned char * addresses); + +void i2c_wakeup(uint8_t address); +uint8_t i2c_write_buffer(uint8_t address, uint8_t * buffer, size_t len); +uint8_t i2c_write_uint8(uint8_t address, uint8_t value); +uint8_t i2c_write_uint8(uint8_t address, uint8_t reg, uint8_t value); +uint8_t i2c_write_uint8(uint8_t address, uint8_t reg, uint8_t value1, uint8_t value2); +uint8_t i2c_write_uint16(uint8_t address, uint16_t value); +uint8_t i2c_write_uint16(uint8_t address, uint8_t reg, uint16_t value); +uint8_t i2c_read_uint8(uint8_t address); +uint8_t i2c_read_uint8(uint8_t address, uint8_t reg); +uint16_t i2c_read_uint16(uint8_t address); +uint16_t i2c_read_uint16(uint8_t address, uint8_t reg); +uint16_t i2c_read_uint16_le(uint8_t address, uint8_t reg); +int16_t i2c_read_int16(uint8_t address, uint8_t reg); +int16_t i2c_read_int16_le(uint8_t address, uint8_t reg); +void i2c_read_buffer(uint8_t address, uint8_t * buffer, size_t len); // ----------------------------------------------------------------------------- // MQTT