2012-03-15 09:01:36 +01:00
|
|
|
/* ----------------------------------------------------------------------------
|
2012-07-31 23:48:31 +02:00
|
|
|
* ergoDOX : controller : MCP23018 specific exports : functions
|
2012-03-17 02:31:36 +01:00
|
|
|
* ----------------------------------------------------------------------------
|
2012-03-27 12:06:52 +02:00
|
|
|
* Copyright (c) 2012 Ben Blazak <benblazak.dev@gmail.com>
|
|
|
|
* Released under The MIT License (MIT) (see "license.md")
|
|
|
|
* Project located at <https://github.com/benblazak/ergodox-firmware>
|
2012-03-15 09:01:36 +01:00
|
|
|
* ------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
|
2012-07-31 23:48:31 +02:00
|
|
|
#ifndef KEYBOARD__ERGODOX__CONTROLLER__MCP23018__FUNCTIONS_h
|
|
|
|
#define KEYBOARD__ERGODOX__CONTROLLER__MCP23018__FUNCTIONS_h
|
2012-03-15 09:01:36 +01:00
|
|
|
|
2012-07-31 23:48:31 +02:00
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include "../matrix.h"
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------
|
2012-04-05 12:08:20 +02:00
|
|
|
|
bugfix (mostly): changed the way layers are handled
before, if you pressed a key, then shifted layers, then released it, the
first layer's press() would be called, and the 2nd layer's release()
would be called, causing keys to stick, and probably other errors. now,
the layer that the key was on when it was pressed is kept track of, and
the proper release() is called.
also, layers can be shifted per key now, instead of just for the whole
board at once
i also changed how keyboard-private includes are handled. "private"
stuff is now in its own file, instead of being nested in an extra
`#ifdef`.
and i think that's it. i'm pretty tired right now, so there may be
errors, but it seemed to work all right with cursory tests.
2012-06-11 12:27:34 +02:00
|
|
|
#define MCP23018_TWI_ADDRESS 0b0100000
|
2012-03-19 08:01:41 +01:00
|
|
|
|
2012-07-31 23:48:31 +02:00
|
|
|
// --------------------------------------------------------------------
|
|
|
|
|
bugfix (mostly): changed the way layers are handled
before, if you pressed a key, then shifted layers, then released it, the
first layer's press() would be called, and the 2nd layer's release()
would be called, causing keys to stick, and probably other errors. now,
the layer that the key was on when it was pressed is kept track of, and
the proper release() is called.
also, layers can be shifted per key now, instead of just for the whole
board at once
i also changed how keyboard-private includes are handled. "private"
stuff is now in its own file, instead of being nested in an extra
`#ifdef`.
and i think that's it. i'm pretty tired right now, so there may be
errors, but it seemed to work all right with cursory tests.
2012-06-11 12:27:34 +02:00
|
|
|
uint8_t mcp23018_init(void);
|
|
|
|
uint8_t mcp23018_update_matrix( bool matrix[KB_ROWS][KB_COLUMNS] );
|
2012-03-19 08:01:41 +01:00
|
|
|
|
|
|
|
#endif
|
2012-03-15 09:01:36 +01:00
|
|
|
|