logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

tca6424.h (1223B)


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