X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fdrv%2Fpcf8574.h;fp=bertos%2Fdrv%2Fpcf8574.h;h=fa327e28deb6d7e4b033b03965e64beb8861203a;hb=e2238a91f56b0d4f79b39e51b2823f555f0ad7e6;hp=2041b4808c58af5e995020070162b39cd8c3221d;hpb=eea6e7e95a7c2ac1343ea0485782efa02a737ec2;p=bertos.git diff --git a/bertos/drv/pcf8574.h b/bertos/drv/pcf8574.h index 2041b480..fa327e28 100644 --- a/bertos/drv/pcf8574.h +++ b/bertos/drv/pcf8574.h @@ -43,6 +43,18 @@ #include +#include + +#if COMPILER_C99 + #define pcf8574_init(...) PP_CAT(pcf8574_init ## _, COUNT_PARMS(__VA_ARGS__)) (__VA_ARGS__) + #define pcf8574_get(...) PP_CAT(pcf8574_get ## _, COUNT_PARMS(__VA_ARGS__)) (__VA_ARGS__) + #define pcf8574_put(...) PP_CAT(pcf8574_put ## _, COUNT_PARMS(__VA_ARGS__)) (__VA_ARGS__) +#else + #define pcf8574_init(args...) PP_CAT(pcf8574_init ## _, COUNT_PARMS(args)) (args) + #define pcf8574_get(args...) PP_CAT(pcf8574_get ## _, COUNT_PARMS(args)) (args) + #define pcf8574_put(args...) PP_CAT(pcf8574_put ## _, COUNT_PARMS(args)) (args) +#endif + typedef uint8_t pcf8574_addr; /** @@ -55,8 +67,13 @@ typedef struct Pcf8574 #define PCF8574ID 0x40 ///< I2C address -int pcf8574_get(Pcf8574 *pcf); -bool pcf8574_put(Pcf8574 *pcf, uint8_t data); -bool pcf8574_init(Pcf8574 *pcf, pcf8574_addr addr); +DEPRECATED int pcf8574_get_1(Pcf8574 *pcf); +DEPRECATED bool pcf8574_put_2(Pcf8574 *pcf, uint8_t data); +DEPRECATED bool pcf8574_init_2(Pcf8574 *pcf, pcf8574_addr addr); + + +int pcf8574_get_2(I2c *i2c, Pcf8574 *pcf); +bool pcf8574_put_3(I2c *i2c, Pcf8574 *pcf, uint8_t data); +bool pcf8574_init_3(I2c *i2c, Pcf8574 *pcf, pcf8574_addr addr); #endif /* DRV_PCF8574_H */