You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.1 KiB

  1. /**
  2. * @file tca6424.h
  3. * @author astro
  4. * @brief driver for the tca6424
  5. *
  6. * This program is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #pragma once
  20. #include <stdint.h>
  21. #ifndef TCA6424_ADDR
  22. #define TCA6424_ADDR 0x44
  23. #endif
  24. typedef enum {
  25. TCA6424_PORT0 = 0,
  26. TCA6424_PORT1,
  27. TCA6424_PORT2,
  28. } TCA6424_PORT;
  29. void tca6424_init(void);
  30. void tca6424_write_config(TCA6424_PORT port, uint8_t data);
  31. void tca6424_write_polarity(TCA6424_PORT port, uint8_t data);
  32. void tca6424_write_port(TCA6424_PORT port, uint8_t data);
  33. uint8_t tca6424_read_port(TCA6424_PORT port);