Keyboard firmwares for Atmel AVR and Cortex-M
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

matrix_skel.h 728B

12345678910111213141516171819202122232425262728
  1. #ifndef MATRIX_SKEL_H
  2. #define MATRIX_SKEL_H 1
  3. #include <stdbool.h>
  4. /* number of matrix rows */
  5. int matrix_rows(void);
  6. /* number of matrix columns */
  7. int matrix_cols(void);
  8. /* intialize matrix for scaning. should be called once. */
  9. void matrix_init(void);
  10. /* scan all key states on matrix */
  11. int matrix_scan(void);
  12. /* whether modified from previous scan. used after matrix_scan. */
  13. bool matrix_is_modified(void);
  14. /* whether ghosting occur on matrix. */
  15. bool matrix_has_ghost(void);
  16. /* whether a swtich is on */
  17. bool matrix_is_on(int row, int col);
  18. /* matrix state on row */
  19. uint16_t matrix_get_row(int row);
  20. /* count keys pressed */
  21. int matrix_key_count(void);
  22. /* print matrix for debug */
  23. void matrix_print(void);
  24. #endif