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.

105 lines
2.9 KiB

adding Hadron v3 keyboard, QWIIC devices support, haptic feedback support (#4462) * add initial support for hadron ver3 * add initial support for hadron ver3 * pull qwiic support for micro_led to be modified for use in hadron's 64x24 ssd1306 oled display * initial work on OLED using qwiic driver * early work to get 128x32 oled working by redefining qwiic micro oled parameters. Currently working, but would affect qwiic's micro oled functionality * moved oled defines to config.h and added ifndef to micro_oled driver * WORKING :D - note, still work in progress to get the start location correct on the 128x32 display. * added equation to automatically calculate display offset based on screen width * adding time-out timer to oled display * changed read lock staus via read_led_state * lock indications fixes * Added scroll lock indication to oled * add support for DRV2605 haptic driver * Improve readabiity of DRV2605 driver. -added typedef for waveform library -added unions for registers * Update keyboards/hadron/ver2/keymaps/default/config.h Co-Authored-By: ishtob <ishtob@gmail.com> * Update keyboards/hadron/ver2/keymaps/default/config.h Co-Authored-By: ishtob <ishtob@gmail.com> * Update keyboards/hadron/ver2/keymaps/default/config.h Co-Authored-By: ishtob <ishtob@gmail.com> * Update keyboards/hadron/ver2/keymaps/default/config.h Co-Authored-By: ishtob <ishtob@gmail.com> * Fixes for PR * PR fixes * fix old persistent layer function to use new set_single_persistent_default_layer * fix issues with changing makefile defines that broken per-key haptic pulse * Comment fixes * Add definable parameter and auto-calibration based on motor choice
5 years ago
8 years ago
  1. /*
  2. Copyright 2013 Jun Wako <wakojun@gmail.com>
  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 ACTION_LAYER_H
  15. #define ACTION_LAYER_H
  16. #include <stdint.h>
  17. #include "keyboard.h"
  18. #include "action.h"
  19. /*
  20. * Default Layer
  21. */
  22. extern uint32_t default_layer_state;
  23. void default_layer_debug(void);
  24. void default_layer_set(uint32_t state);
  25. __attribute__((weak))
  26. uint32_t default_layer_state_set_kb(uint32_t state);
  27. __attribute__((weak))
  28. uint32_t default_layer_state_set_user(uint32_t state);
  29. #ifndef NO_ACTION_LAYER
  30. /* bitwise operation */
  31. void default_layer_or(uint32_t state);
  32. void default_layer_and(uint32_t state);
  33. void default_layer_xor(uint32_t state);
  34. #else
  35. #define default_layer_or(state)
  36. #define default_layer_and(state)
  37. #define default_layer_xor(state)
  38. #endif
  39. /*
  40. * Keymap Layer
  41. */
  42. #ifndef NO_ACTION_LAYER
  43. extern uint32_t layer_state;
  44. void layer_state_set(uint32_t state);
  45. bool layer_state_is(uint8_t layer);
  46. bool layer_state_cmp(uint32_t layer1, uint8_t layer2);
  47. void layer_debug(void);
  48. void layer_clear(void);
  49. void layer_move(uint8_t layer);
  50. void layer_on(uint8_t layer);
  51. void layer_off(uint8_t layer);
  52. void layer_invert(uint8_t layer);
  53. /* bitwise operation */
  54. void layer_or(uint32_t state);
  55. void layer_and(uint32_t state);
  56. void layer_xor(uint32_t state);
  57. #else
  58. #define layer_state 0
  59. #define layer_state_set(layer)
  60. #define layer_state_is(layer) (layer == 0)
  61. #define layer_state_cmp(state, layer) (state == 0 ? layer == 0 : (state & 1UL << layer) != 0)
  62. #define layer_debug()
  63. #define layer_clear()
  64. #define layer_move(layer)
  65. #define layer_on(layer)
  66. #define layer_off(layer)
  67. #define layer_invert(layer)
  68. #define layer_or(state)
  69. #define layer_and(state)
  70. #define layer_xor(state)
  71. #endif
  72. uint32_t layer_state_set_user(uint32_t state);
  73. uint32_t layer_state_set_kb(uint32_t state);
  74. /* pressed actions cache */
  75. #if !defined(NO_ACTION_LAYER) && !defined(STRICT_LAYER_RELEASE)
  76. /* The number of bits needed to represent the layer number: log2(32). */
  77. #define MAX_LAYER_BITS 5
  78. void update_source_layers_cache(keypos_t key, uint8_t layer);
  79. uint8_t read_source_layers_cache(keypos_t key);
  80. #endif
  81. action_t store_or_get_action(bool pressed, keypos_t key);
  82. /* return the topmost non-transparent layer currently associated with key */
  83. int8_t layer_switch_get_layer(keypos_t key);
  84. /* return action depending on current layer status */
  85. action_t layer_switch_get_action(keypos_t key);
  86. #endif