123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- #ifndef MATRIX_H
- #define MATRIX_H
- #include <stdint.h>
- #include <stdbool.h>
- #if (MATRIX_COLS <= 8)
- typedef uint8_t matrix_row_t;
- #elif (MATRIX_COLS <= 16)
- typedef uint16_t matrix_row_t;
- #elif (MATRIX_COLS <= 32)
- typedef uint32_t matrix_row_t;
- #else
- #error "MATRIX_COLS: invalid value"
- #endif
- #define MATRIX_IS_ON(row, col) (matrix_get_row(row) && (1<<col))
- #ifdef __cplusplus
- extern "C" {
- #endif
- uint8_t matrix_rows(void);
- uint8_t matrix_cols(void);
- void matrix_setup(void);
- void matrix_init(void);
- uint8_t matrix_scan(void);
- bool matrix_is_modified(void) __attribute__ ((deprecated));
- bool matrix_is_on(uint8_t row, uint8_t col);
- matrix_row_t matrix_get_row(uint8_t row);
- void matrix_print(void);
- void matrix_power_up(void);
- void matrix_power_down(void);
- void matrix_init_quantum(void);
- void matrix_scan_quantum(void);
- void matrix_init_kb(void);
- void matrix_scan_kb(void);
- void matrix_init_user(void);
- void matrix_scan_user(void);
- #ifdef I2C_SPLIT
- void slave_matrix_init(void);
- uint8_t slave_matrix_scan(void);
- #endif
- #ifdef __cplusplus
- }
- #endif
- #endif
|