PCF8574.h 746 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * PCF8574.h V1.0
  3. *
  4. * Created on: 14 mai 2019
  5. * Author: e_rcluze
  6. */
  7. #ifndef _PCF8474__H_
  8. #define _PCF8474__H_
  9. #include "i2c.h"
  10. #include <stdint.h>
  11. I2C_HandleTypeDef *I2C_PCF8574;
  12. /** Private Fonction*/
  13. HAL_StatusTypeDef read_I2C_PCF8574(uint8_t add, uint8_t *tab);
  14. HAL_StatusTypeDef write_I2C_PCF8574(uint8_t addresse, uint8_t *tab);
  15. /** Public Fonction*/
  16. void initPCF8574(I2C_HandleTypeDef *typ);
  17. /*
  18. * PAram addBit : la valeurs des bit A1 A2 A3:
  19. * 0 0 0 = 0;
  20. * 0 0 1 = 1;
  21. * 0 1 0 = 2;
  22. * ...
  23. */
  24. HAL_StatusTypeDef Read_PCF8574(uint8_t addBit, uint8_t* val);
  25. HAL_StatusTypeDef Write_PCF8574(uint8_t addBit,uint8_t val);
  26. HAL_StatusTypeDef Write_One_Bit_PCF8574(uint8_t addBit, uint8_t val, uint8_t Local);
  27. #endif