diff options
| author | tmk <nobody@nowhere> | 2011-02-21 15:43:17 +0900 |
|---|---|---|
| committer | tmk <nobody@nowhere> | 2011-02-22 03:09:14 +0900 |
| commit | fb8d23c60c757d5d9c2270cb0123a53be2049a28 (patch) | |
| tree | 2f5d695f9d501468dc83f4861e7367cdf905ed3f /matrix.h | |
| parent | 47f5d8b545eec12ca74d8e7048bb5daa290d937e (diff) | |
| download | qmk_firmware-fb8d23c60c757d5d9c2270cb0123a53be2049a28.tar.gz qmk_firmware-fb8d23c60c757d5d9c2270cb0123a53be2049a28.zip | |
integrate V-USB support into ps2_usb
Diffstat (limited to 'matrix.h')
| -rw-r--r-- | matrix.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/matrix.h b/matrix.h new file mode 100644 index 000000000..1bcd0915f --- /dev/null +++ b/matrix.h | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | #ifndef MATRIX_H | ||
| 2 | #define MATRIX_H | ||
| 3 | |||
| 4 | #include <stdbool.h> | ||
| 5 | |||
| 6 | /* number of matrix rows */ | ||
| 7 | uint8_t matrix_rows(void); | ||
| 8 | /* number of matrix columns */ | ||
| 9 | uint8_t matrix_cols(void); | ||
| 10 | /* intialize matrix for scaning. should be called once. */ | ||
| 11 | void matrix_init(void); | ||
| 12 | /* scan all key states on matrix */ | ||
| 13 | uint8_t matrix_scan(void); | ||
| 14 | /* whether modified from previous scan. used after matrix_scan. */ | ||
| 15 | bool matrix_is_modified(void); | ||
| 16 | /* whether ghosting occur on matrix. */ | ||
| 17 | bool matrix_has_ghost(void); | ||
| 18 | /* whether a swtich is on */ | ||
| 19 | bool matrix_is_on(uint8_t row, uint8_t col); | ||
| 20 | /* matrix state on row */ | ||
| 21 | #if (MATRIX_COLS <= 8) | ||
| 22 | uint8_t matrix_get_row(uint8_t row); | ||
| 23 | #else | ||
| 24 | uint16_t matrix_get_row(uint8_t row); | ||
| 25 | #endif | ||
| 26 | /* count keys pressed */ | ||
| 27 | uint8_t matrix_key_count(void); | ||
| 28 | /* print matrix for debug */ | ||
| 29 | void matrix_print(void); | ||
| 30 | |||
| 31 | |||
| 32 | #endif | ||
