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