logo

qmk_firmware

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

gergo.h (731B)


  1. #pragma once
  2. #include "quantum.h"
  3. #include <stdint.h>
  4. #include <stdbool.h>
  5. #include "i2c_master.h"
  6. #include <util/delay.h>
  7. extern i2c_status_t mcp23018_status;
  8. #define I2C_TIMEOUT 1000
  9. // I2C aliases and register addresses (see "mcp23018.md")
  10. #define I2C_ADDR (0x20<<1)
  11. #define IODIRA 0x00 // i/o direction register
  12. #define IODIRB 0x01
  13. #define GPPUA 0x0C // GPIO pull-up resistor register
  14. #define GPPUB 0x0D
  15. #define GPIOA 0x12 // general purpose i/o port register (write modifies OLAT)
  16. #define GPIOB 0x13
  17. #define OLATA 0x14 // output latch register
  18. #define OLATB 0x15
  19. uint8_t init_mcp23018(void);