qmk_firmware

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

gergo.h (813B)


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