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.

54 lines
1.8 KiB

  1. /* Copyright 2021
  2. *
  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. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #include <stdint.h>
  17. #include "progmem.h"
  18. #include "send_string_keycodes.h"
  19. #define SEND_STRING(string) send_string_P(PSTR(string))
  20. #define SEND_STRING_DELAY(string, interval) send_string_with_delay_P(PSTR(string), interval)
  21. // Look-Up Tables (LUTs) to convert ASCII character to keycode sequence.
  22. extern const uint8_t ascii_to_shift_lut[16];
  23. extern const uint8_t ascii_to_altgr_lut[16];
  24. extern const uint8_t ascii_to_dead_lut[16];
  25. extern const uint8_t ascii_to_keycode_lut[128];
  26. // clang-format off
  27. #define KCLUT_ENTRY(a, b, c, d, e, f, g, h) \
  28. ( ((a) ? 1 : 0) << 0 \
  29. | ((b) ? 1 : 0) << 1 \
  30. | ((c) ? 1 : 0) << 2 \
  31. | ((d) ? 1 : 0) << 3 \
  32. | ((e) ? 1 : 0) << 4 \
  33. | ((f) ? 1 : 0) << 5 \
  34. | ((g) ? 1 : 0) << 6 \
  35. | ((h) ? 1 : 0) << 7 )
  36. // clang-format on
  37. void send_string(const char *str);
  38. void send_string_with_delay(const char *str, uint8_t interval);
  39. void send_string_P(const char *str);
  40. void send_string_with_delay_P(const char *str, uint8_t interval);
  41. void send_char(char ascii_code);
  42. void send_dword(uint32_t number);
  43. void send_word(uint16_t number);
  44. void send_byte(uint8_t number);
  45. void send_nibble(uint8_t number);
  46. void tap_random_base64(void);