qmk_firmware

QMK firmware for my keyboards (Corne, Sweep Ferris) and trackball (Ploopy Adept)
Log | Files | Refs | Submodules | LICENSE

left.h (1219B)


      1 #pragma once
      2 
      3 #include <stdint.h>
      4 #include "i2c_master.h"
      5 
      6 #define MCP23017
      7 #define MCP23017_A0 0
      8 #define MCP23017_A1 0
      9 #define MCP23017_A2 0
     10 
     11 #define I2C_ADDR        ((0x20) << 1)
     12 
     13 #define MCP23017_B0_IODIRA     0x00
     14 #define MCP23017_B0_IODIRB     0x01
     15 #define MCP23017_B0_IPOLA      0x02
     16 #define MCP23017_B0_IPOLB      0x03
     17 #define MCP23017_B0_GPINTENA   0x04
     18 #define MCP23017_B0_GPINTENB   0x05
     19 #define MCP23017_B0_DEFVALA    0x06
     20 #define MCP23017_B0_DEFVALB    0x07
     21 #define MCP23017_B0_INTCONA    0x08
     22 #define MCP23017_B0_INTCONB    0x09
     23 #define MCP23017_B0_IOCONA     0x0A
     24 #define MCP23017_B0_IOCONB     0x0B
     25 #define MCP23017_B0_GPPUA      0x0C
     26 #define MCP23017_B0_GPPUB      0x0D
     27 #define MCP23017_B0_INTFA      0x0E
     28 #define MCP23017_B0_INTFB      0x0F
     29 #define MCP23017_B0_INTCAPA    0x10
     30 #define MCP23017_B0_INTCAPB    0x11
     31 #define MCP23017_B0_GPIOA      0x12
     32 #define MCP23017_B0_GPIOB      0x13
     33 #define MCP23017_B0_OLATA      0x14
     34 #define MCP23017_B0_OLATB      0x15
     35 
     36 #define HOTDOX_I2C_TIMEOUT     100
     37 
     38 void left_init(void);
     39 void left_scan(void);
     40 
     41 uint8_t left_read_cols(void);
     42 uint8_t left_get_col(uint8_t col);
     43 
     44 void left_unselect_rows(void);
     45 void left_select_row(uint8_t row);
     46 
     47 uint8_t init_mcp23017(void);
     48