#include <drv/i2c.h>
-#if !CONFIG_I2C_DISABLE_OLD_API
-
-INLINE int pcf8574_get_priv(Pcf8574 *pcf)
-{
- if (!i2c_start_r(PCF8574ID | ((pcf->addr << 1) & 0xF7)))
- return EOF;
-
- int data;
-
- if (!i2c_recv(&data, 1))
- data = EOF;
-
- i2c_stop();
-
- return data;
-}
-
-/**
- * Read PCF8574 \a pcf bit status.
- * \return the pins status or EOF on errors.
- */
-int pcf8574_get_1(Pcf8574 *pcf)
-{
- return pcf8574_get_priv(pcf);
-}
-
-/**
- * Write to PCF8574 \a pcf port \a data.
- * \return true if ok, false on errors.
- */
-bool pcf8574_put_2(Pcf8574 *pcf, uint8_t data)
-{
- bool res = i2c_start_w(PCF8574ID | ((pcf->addr << 1) & 0xF7)) && i2c_put(data);
- i2c_stop();
- return res;
-}
-
-/**
- * Init a PCF8574 on the bus with addr \a addr.
- * \return true if device is found, false otherwise.
- */
-bool pcf8574_init_2(Pcf8574 *pcf, pcf8574_addr addr)
-{
- MOD_CHECK(i2c);
- pcf->addr = addr;
- return pcf8574_get_priv(pcf) != EOF;
-}
-#endif /* !CONFIG_I2C_DISABLE_OLD_API */
-
-
-/*
- * New API
- */
-
/**
* Read PCF8574 \a pcf bit status.
* \return the pins status or EOF on errors.