diff options
| author | Joel Challis <git@zvecr.com> | 2025-08-17 01:14:48 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-17 01:14:48 +0100 |
| commit | cc696a2ae838a9639335ca8eb3cb3b794c06bc33 (patch) | |
| tree | 901b54bda536acb5503c6cf924b0f30bca1a174e /data | |
| parent | f29d8117bf877a4df1f88f40e0131f4465748540 (diff) | |
Refactor battery driver (#25550)
Diffstat (limited to 'data')
| -rw-r--r-- | data/mappings/info_config.hjson | 8 | ||||
| -rw-r--r-- | data/mappings/info_rules.hjson | 1 | ||||
| -rw-r--r-- | data/schemas/keyboard.jsonschema | 22 |
3 files changed, 31 insertions, 0 deletions
diff --git a/data/mappings/info_config.hjson b/data/mappings/info_config.hjson index a160e490c7..4c53aa4339 100644 --- a/data/mappings/info_config.hjson +++ b/data/mappings/info_config.hjson | |||
| @@ -43,6 +43,14 @@ | |||
| 43 | "BOOTMAGIC_ROW": {"info_key": "bootmagic.matrix.0", "value_type": "int"}, | 43 | "BOOTMAGIC_ROW": {"info_key": "bootmagic.matrix.0", "value_type": "int"}, |
| 44 | "BOOTMAGIC_ROW_RIGHT": {"info_key": "split.bootmagic.matrix.0", "value_type": "int"}, | 44 | "BOOTMAGIC_ROW_RIGHT": {"info_key": "split.bootmagic.matrix.0", "value_type": "int"}, |
| 45 | 45 | ||
| 46 | // Battery | ||
| 47 | "BATTERY_SAMPLE_INTERVAL": {"info_key": "battery.sample_interval", "value_type": "int"}, | ||
| 48 | "BATTERY_ADC_PIN": {"info_key": "battery.adc.pin"}, | ||
| 49 | "BATTERY_ADC_REF_VOLTAGE_MV": {"info_key": "battery.adc.reference_voltage", "value_type": "int"}, | ||
| 50 | "BATTERY_ADC_VOLTAGE_DIVIDER_R1": {"info_key": "battery.adc.divider_r1", "value_type": "int"}, | ||
| 51 | "BATTERY_ADC_VOLTAGE_DIVIDER_R2": {"info_key": "battery.adc.divider_r2", "value_type": "int"}, | ||
| 52 | "BATTERY_ADC_RESOLUTION": {"info_key": "battery.adc.resolution", "value_type": "int"}, | ||
| 53 | |||
| 46 | // Caps Word | 54 | // Caps Word |
| 47 | "BOTH_SHIFTS_TURNS_ON_CAPS_WORD": {"info_key": "caps_word.both_shifts_turns_on", "value_type": "flag"}, | 55 | "BOTH_SHIFTS_TURNS_ON_CAPS_WORD": {"info_key": "caps_word.both_shifts_turns_on", "value_type": "flag"}, |
| 48 | "CAPS_WORD_IDLE_TIMEOUT": {"info_key": "caps_word.idle_timeout", "value_type": "int"}, | 56 | "CAPS_WORD_IDLE_TIMEOUT": {"info_key": "caps_word.idle_timeout", "value_type": "int"}, |
diff --git a/data/mappings/info_rules.hjson b/data/mappings/info_rules.hjson index d43d83c3ea..5ecd5c12b3 100644 --- a/data/mappings/info_rules.hjson +++ b/data/mappings/info_rules.hjson | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | 13 | ||
| 14 | "AUDIO_DRIVER": {"info_key": "audio.driver"}, | 14 | "AUDIO_DRIVER": {"info_key": "audio.driver"}, |
| 15 | "BACKLIGHT_DRIVER": {"info_key": "backlight.driver"}, | 15 | "BACKLIGHT_DRIVER": {"info_key": "backlight.driver"}, |
| 16 | "BATTERY_DRIVER": {"info_key": "battery.driver"}, | ||
| 16 | "BLUETOOTH_DRIVER": {"info_key": "bluetooth.driver"}, | 17 | "BLUETOOTH_DRIVER": {"info_key": "bluetooth.driver"}, |
| 17 | "BOARD": {"info_key": "board"}, | 18 | "BOARD": {"info_key": "board"}, |
| 18 | "BOOTLOADER": {"info_key": "bootloader", "warn_duplicate": false}, | 19 | "BOOTLOADER": {"info_key": "bootloader", "warn_duplicate": false}, |
diff --git a/data/schemas/keyboard.jsonschema b/data/schemas/keyboard.jsonschema index 3775b66c1a..93b1c82b1c 100644 --- a/data/schemas/keyboard.jsonschema +++ b/data/schemas/keyboard.jsonschema | |||
| @@ -188,6 +188,28 @@ | |||
| 188 | "as_caps_lock": {"type": "boolean"} | 188 | "as_caps_lock": {"type": "boolean"} |
| 189 | } | 189 | } |
| 190 | }, | 190 | }, |
| 191 | "battery": { | ||
| 192 | "type": "object", | ||
| 193 | "additionalProperties": false, | ||
| 194 | "properties": { | ||
| 195 | "driver": { | ||
| 196 | "type": "string", | ||
| 197 | "enum": ["adc", "custom", "vendor"] | ||
| 198 | }, | ||
| 199 | "adc": { | ||
| 200 | "type": "object", | ||
| 201 | "additionalProperties": false, | ||
| 202 | "properties": { | ||
| 203 | "pin": {"$ref": "./definitions.jsonschema#/mcu_pin"}, | ||
| 204 | "reference_voltage": {"type": "integer"}, | ||
| 205 | "divider_r1": {"type": "integer"}, | ||
| 206 | "divider_r2": {"type": "integer"}, | ||
| 207 | "resolution": {"type": "integer"} | ||
| 208 | } | ||
| 209 | }, | ||
| 210 | "sample_interval": {"type": "integer"} | ||
| 211 | } | ||
| 212 | }, | ||
| 191 | "bluetooth": { | 213 | "bluetooth": { |
| 192 | "type": "object", | 214 | "type": "object", |
| 193 | "additionalProperties": false, | 215 | "additionalProperties": false, |
