Keyboard firmwares for Atmel AVR and Cortex-M
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. Copyright 2013 Jun Wako <[email protected]>
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. #ifndef LAYER_SWITCH_H
  15. #define LAYER_SWITCH_H
  16. #include <stdint.h>
  17. #include "keyboard.h"
  18. #include "action.h"
  19. /* overlays are asigned at layer 16-31 */
  20. #define OVERLAY_BIT 0x10
  21. #define OVERLAY_MASK 0x0F
  22. /*
  23. * Default Layer
  24. */
  25. /* base layer to fall back */
  26. extern uint8_t default_layer;
  27. void default_layer_set(uint8_t layer);
  28. /*
  29. * Keymap Layer
  30. */
  31. extern uint16_t keymap_stat;
  32. /* return current active layer */
  33. uint8_t keymap_get_layer(void);
  34. void keymap_clear(void);
  35. void keymap_set(uint16_t stat);
  36. void keymap_move(uint8_t layer);
  37. void keymap_on(uint8_t layer);
  38. void keymap_off(uint8_t layer);
  39. void keymap_invert(uint8_t layer);
  40. /* bitwise operation */
  41. void keymap_or(uint16_t stat);
  42. void keymap_and(uint16_t stat);
  43. void keymap_xor(uint16_t stat);
  44. void keymap_debug(void);
  45. /*
  46. * Overlay Layer
  47. */
  48. extern uint16_t overlay_stat;
  49. /* return current active layer */
  50. uint8_t overlay_get_layer(void);
  51. void overlay_clear(void);
  52. void overlay_set(uint16_t stat);
  53. void overlay_move(uint8_t layer);
  54. void overlay_on(uint8_t layer);
  55. void overlay_off(uint8_t layer);
  56. void overlay_invert(uint8_t layer);
  57. /* bitwise operation */
  58. void overlay_or(uint16_t stat);
  59. void overlay_and(uint16_t stat);
  60. void overlay_xor(uint16_t stat);
  61. void overlay_debug(void);
  62. /* return action depending on current layer status */
  63. action_t layer_switch_get_action(key_t key);
  64. #endif