1
0
Fork 0
qmk_firmware/keyboards/ergodone/expander.h
Jack Humbert d2ff66a985 Creates a layouts/ folder for keymaps shared between keyboards (#1609)
* include variables and .h files as pp directives

* start layout compilation

* split ergodoxes up

* don't compile all layouts for everything

* might seg fault

* reset layouts variable

* actually reset layouts

* include rules.mk instead

* remove includes from rules.mk

* update variable setting

* load visualizer from path

* adds some more examples

* adds more layouts

* more boards added

* more boards added

* adds documentation for layouts

* use lowercase names for LAYOUT_

* add layout.json files for each layout

* add community folder, default keymaps for layouts

* touch-up default layouts

* touch-up layouts, some keyboard rules.mk

* update documentation for layouts

* fix up serial/i2c switches
2017-08-23 22:29:07 -04:00

48 lines
1 KiB
C

#ifndef EXPANDER_H
#define EXPANDER_H
#include <stdint.h>
#include "matrix.h"
#define MCP23017
#define MCP23017_A0 0
#define MCP23017_A1 0
#define MCP23017_A2 0
#ifdef MCP23017
#define EXPANDER_ADDR ((0x20|(MCP23017_A0<<0)|(MCP23017_A1<<1)|(MCP23017_A2<<2)) << 1)
enum EXPANDER_REG_BANK0 {
EXPANDER_REG_IODIRA = 0,
EXPANDER_REG_IODIRB,
EXPANDER_REG_IPOLA,
EXPANDER_REG_IPOLB,
EXPANDER_REG_GPINTENA,
EXPANDER_REG_GPINTENB,
EXPANDER_REG_DEFVALA,
EXPANDER_REG_DEFVALB,
EXPANDER_REG_INTCONA,
EXPANDER_REG_INTCONB,
EXPANDER_REG_IOCONA,
EXPANDER_REG_IOCONB,
EXPANDER_REG_GPPUA,
EXPANDER_REG_GPPUB,
EXPANDER_REG_INTFA,
EXPANDER_REG_INTFB,
EXPANDER_REG_INTCAPA,
EXPANDER_REG_INTCAPB,
EXPANDER_REG_GPIOA,
EXPANDER_REG_GPIOB,
EXPANDER_REG_OLATA,
EXPANDER_REG_OLATB
};
#endif
void expander_init(void);
void expander_scan(void);
void expander_read_cols(void);
uint8_t expander_get_col(uint8_t col);
matrix_row_t expander_read_row(void);
void expander_unselect_rows(void);
void expander_select_row(uint8_t row);
#endif