Call this function to get the last received LED state.
Call this function to get the last received LED state. This is useful for reading the LED state outside `led_set_*`, e.g. in [`matrix_scan_user()`](#matrix-scanning-code).
This is useful for reading the LED state outside `led_set_*`, e.g. in [`matrix_scan_user()`](#matrix-scanning-code).
For convenience, you can use the `IS_HOST_LED_ON(led_name)` and `IS_HOST_LED_OFF(led_name)` macros instead of calling and checking `host_keyboard_leds()` directly.
For convenience, you can use the `IS_HOST_LED_ON(LED_NAME)` and `IS_HOST_LED_OFF(LED_NAME)` macros instead of calling `host_keyboard_leds()` directly.
## Setting Physical LED State
## Setting physical LED state
Some keyboard implementations provide convenience methods for setting the state of the physical LEDs.
Some keyboard implementations provide convenience methods for setting the state of the physical LEDs.
### Ergodox and Ergodox EZ
### Ergodox Boards
The Ergodox EZ implementation provides `ergodox_right_led_``1`/`2`/`3_on`/`off()`
The Ergodox implementations provide `ergodox_right_led_1`/`2`/`3_on`/`off()` to turn individual LEDs on or off, as well as `ergodox_right_led_on`/`off(uint8_t led)` to turn them on or off by their index.
to turn individual LEDs on and off, as well as
`ergodox_right_led_on`/`off(uint8_t led)`
to turn them on and off by their number.
In addition, it is possible to specify the brightness level with `ergodox_led_all_set(uint8_t n)`,
In addition, it is possible to specify the brightness level of all LEDs with `ergodox_led_all_set(uint8_t n)`; of individual LEDs with `ergodox_right_led_1`/`2`/`3_set(uint8_t n)`; or by index with `ergodox_right_led_set(uint8_t led, uint8_t n)`.
for individual LEDs with `ergodox_right_led_1`/`2`/`3_set(uint8_t n)`
or by their number using `ergodox_right_led_set(uint8_t led, uint8_t n)`.
It defines`LED_BRIGHTNESS_LO` for the lowest brightness and `LED_BRIGHTNESS_HI` for the highest brightness, which is also the default.
Ergodox boards also define `LED_BRIGHTNESS_LO` for the lowest brightness and `LED_BRIGHTNESS_HI` for the highest brightness (which is the default).