constants.py 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. """Information that should be available to the python library.
  2. """
  3. from os import environ
  4. from pathlib import Path
  5. # The root of the qmk_firmware tree.
  6. QMK_FIRMWARE = Path.cwd()
  7. # Upstream repo url
  8. QMK_FIRMWARE_UPSTREAM = 'qmk/qmk_firmware'
  9. # This is the number of directories under `qmk_firmware/keyboards` that will be traversed. This is currently a limitation of our make system.
  10. MAX_KEYBOARD_SUBFOLDERS = 5
  11. # Supported processor types
  12. CHIBIOS_PROCESSORS = 'cortex-m0', 'cortex-m0plus', 'cortex-m3', 'cortex-m4', 'MKL26Z64', 'MK20DX128', 'MK20DX256', 'MK66FX1M0', 'STM32F042', 'STM32F072', 'STM32F103', 'STM32F303', 'STM32F401', 'STM32F405', 'STM32F407', 'STM32F411', 'STM32F446', 'STM32G431', 'STM32G474', 'STM32L412', 'STM32L422', 'STM32L432', 'STM32L433', 'STM32L442', 'STM32L443', 'GD32VF103', 'WB32F3G71'
  13. LUFA_PROCESSORS = 'at90usb162', 'atmega16u2', 'atmega32u2', 'atmega16u4', 'atmega32u4', 'at90usb646', 'at90usb647', 'at90usb1286', 'at90usb1287', None
  14. VUSB_PROCESSORS = 'atmega32a', 'atmega328p', 'atmega328', 'attiny85'
  15. # Bootloaders of the supported processors
  16. MCU2BOOTLOADER = {
  17. "MKL26Z64": "halfkay",
  18. "MK20DX128": "halfkay",
  19. "MK20DX256": "halfkay",
  20. "MK66FX1M0": "halfkay",
  21. "STM32F042": "stm32-dfu",
  22. "STM32F072": "stm32-dfu",
  23. "STM32F103": "stm32duino",
  24. "STM32F303": "stm32-dfu",
  25. "STM32F401": "stm32-dfu",
  26. "STM32F405": "stm32-dfu",
  27. "STM32F407": "stm32-dfu",
  28. "STM32F411": "stm32-dfu",
  29. "STM32F446": "stm32-dfu",
  30. "STM32G431": "stm32-dfu",
  31. "STM32G474": "stm32-dfu",
  32. "STM32L412": "stm32-dfu",
  33. "STM32L422": "stm32-dfu",
  34. "STM32L432": "stm32-dfu",
  35. "STM32L433": "stm32-dfu",
  36. "STM32L442": "stm32-dfu",
  37. "STM32L443": "stm32-dfu",
  38. "GD32VF103": "gd32v-dfu",
  39. "WB32F3G71": "wb32-dfu",
  40. "atmega16u2": "atmel-dfu",
  41. "atmega32u2": "atmel-dfu",
  42. "atmega16u4": "atmel-dfu",
  43. "atmega32u4": "atmel-dfu",
  44. "at90usb162": "atmel-dfu",
  45. "at90usb646": "atmel-dfu",
  46. "at90usb647": "atmel-dfu",
  47. "at90usb1286": "atmel-dfu",
  48. "at90usb1287": "atmel-dfu",
  49. "atmega32a": "bootloadhid",
  50. "atmega328p": "usbasploader",
  51. "atmega328": "usbasploader",
  52. }
  53. # Common format strings
  54. DATE_FORMAT = '%Y-%m-%d'
  55. DATETIME_FORMAT = '%Y-%m-%d %H:%M:%S %Z'
  56. TIME_FORMAT = '%H:%M:%S'
  57. # Used when generating matrix locations
  58. COL_LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijilmnopqrstuvwxyz'
  59. ROW_LETTERS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnop'
  60. # Mapping between info.json and config.h keys
  61. LED_INDICATORS = {
  62. 'caps_lock': 'LED_CAPS_LOCK_PIN',
  63. 'num_lock': 'LED_NUM_LOCK_PIN',
  64. 'scroll_lock': 'LED_SCROLL_LOCK_PIN',
  65. }
  66. # Constants that should match their counterparts in make
  67. BUILD_DIR = environ.get('BUILD_DIR', '.build')
  68. KEYBOARD_OUTPUT_PREFIX = f'{BUILD_DIR}/obj_'