diff options
author | layne001365 <layne.guan@gmail.com> | 2019-03-12 03:41:16 +0800 |
---|---|---|
committer | Drashna Jaelre <drashna@live.com> | 2019-03-11 12:41:16 -0700 |
commit | 2a2f41c6de868c06c06cf437cf7c2b875b8c53a4 (patch) | |
tree | b8f688d6af621a681bf6c262d029f63a704e86e1 /keyboards/hotdox/left.h | |
parent | bf1e51ec22a8016aa02d84993241c6a85c562a0e (diff) | |
download | firmware-2a2f41c6de868c06c06cf437cf7c2b875b8c53a4.tar.gz firmware-2a2f41c6de868c06c06cf437cf7c2b875b8c53a4.tar.bz2 firmware-2a2f41c6de868c06c06cf437cf7c2b875b8c53a4.zip |
[Keyboard] Add HotDox keyboard (#5365)
* Add HotDox
* Update keyboards/hotdox/config.h
Co-Authored-By: layne001365 <layne.guan@gmail.com>
* Update keyboards/hotdox/config.h
Co-Authored-By: layne001365 <layne.guan@gmail.com>
* Update keyboards/hotdox/config.h
Co-Authored-By: layne001365 <layne.guan@gmail.com>
* Update keyboards/hotdox/config.h
Co-Authored-By: layne001365 <layne.guan@gmail.com>
* Update keyboards/hotdox/keymaps/default/keymap.c
Co-Authored-By: layne001365 <layne.guan@gmail.com>
* * Update
- keyboards/hotdox/config.h
- keyboards/hotdox/hotdox.h
- keyboards/hotdox/info.json
- keyboards/hotdox/left.h
- keyboards/hotdox/left.c
- keyboards/hotdox/rules.mk
* Replace EPRM with EPRM
- keyboards/hotdox/keymaps/default/keymap.c
- keyboards/hotdox/keymaps/eozaki/keymap.c
- keyboards/hotdox/keymaps/kloki/keymap.c
* Remove keymaps readme.md
* Remove twimaster.h/ twimaster.c
* * Update
- remove FORCE_NKRO from keyboards/hotdox/config.h
- keyboards/hotdox/hotdox.c
- keyboards/hotdox/hotdox.h
- keyboards/hotdox/keymaps/default/keymap.c
- keyboards/hotdox/left.c
- keyboards/hotdox/readme.md
- keyboards/hotdox/rules.mk
* Update keyboards/hotdox/keymaps/default/keymap.c
Co-Authored-By: layne001365 <layne.guan@gmail.com>
* Update keyboards/hotdox/keymaps/default/keymap.c
Co-Authored-By: layne001365 <layne.guan@gmail.com>
* Update keyboards/hotdox/rules.mk
Co-Authored-By: layne001365 <layne.guan@gmail.com>
* Update keyboards/hotdox/rules.mk
Co-Authored-By: layne001365 <layne.guan@gmail.com>
* Update keyboards/hotdox/rules.mk
Co-Authored-By: layne001365 <layne.guan@gmail.com>
* Update keyboards/hotdox/rules.mk
Co-Authored-By: layne001365 <layne.guan@gmail.com>
* Update keyboards/hotdox/rules.mk
Co-Authored-By: layne001365 <layne.guan@gmail.com>
* Update keyboards/hotdox/hotdox.h
Co-Authored-By: layne001365 <layne.guan@gmail.com>
* Update keyboards/hotdox/rules.mk
Co-Authored-By: layne001365 <layne.guan@gmail.com>
* Update keyboards/hotdox/rules.mk
Co-Authored-By: layne001365 <layne.guan@gmail.com>
* Update keyboards/hotdox/config.h
Co-Authored-By: layne001365 <layne.guan@gmail.com>
* Update keyboards/hotdox/config.h
Co-Authored-By: layne001365 <layne.guan@gmail.com>
Diffstat (limited to 'keyboards/hotdox/left.h')
-rw-r--r-- | keyboards/hotdox/left.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/keyboards/hotdox/left.h b/keyboards/hotdox/left.h new file mode 100644 index 000000000..3d8b5a6ea --- /dev/null +++ b/keyboards/hotdox/left.h @@ -0,0 +1,57 @@ +#pragma once + +#include "quantum.h" +#include <stdint.h> +#include "i2c_master.h" +#include <util/delay.h> + +#define MCP23017 +#define MCP23017_A0 0 +#define MCP23017_A1 0 +#define MCP23017_A2 0 + +#define I2C_ADDR (0x20) +#define I2C_ADDR_WRITE ((I2C_ADDR << 1) | I2C_WRITE) +#define I2C_ADDR_READ ((I2C_ADDR << 1) | I2C_READ) + + +#define MCP23017_B0_IODIRA 0x00 +#define MCP23017_B0_IODIRB 0x01 +#define MCP23017_B0_IPOLA 0x02 +#define MCP23017_B0_IPOLB 0x03 +#define MCP23017_B0_GPINTENA 0x04 +#define MCP23017_B0_GPINTENB 0x05 +#define MCP23017_B0_DEFVALA 0x06 +#define MCP23017_B0_DEFVALB 0x07 +#define MCP23017_B0_INTCONA 0x08 +#define MCP23017_B0_INTCONB 0x09 +#define MCP23017_B0_IOCONA 0x0A +#define MCP23017_B0_IOCONB 0x0B +#define MCP23017_B0_GPPUA 0x0C +#define MCP23017_B0_GPPUB 0x0D +#define MCP23017_B0_INTFA 0x0E +#define MCP23017_B0_INTFB 0x0F +#define MCP23017_B0_INTCAPA 0x10 +#define MCP23017_B0_INTCAPB 0x11 +#define MCP23017_B0_GPIOA 0x12 +#define MCP23017_B0_GPIOB 0x13 +#define MCP23017_B0_OLATA 0x14 +#define MCP23017_B0_OLATB 0x15 + +#define HOTDOX_I2C_TIMEOUT 100 + +typedef int16_t i2c_status_t; + +void left_init(void); +void left_scan(void); + +uint8_t left_read_cols(void); +uint8_t left_get_col(uint8_t col); + +matrix_row_t left_read_row(void); + +void left_unselect_rows(void); +void left_select_row(uint8_t row); + +uint8_t init_mcp23017(void); + |