Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new led driver for Keychron's keyboards. #14872

Merged
merged 18 commits into from
Nov 1, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update ckled2001.c/ckled2001.h.
  • Loading branch information
KeychronMacro committed Oct 18, 2021
commit e5ff8ad0cc4b4b2c3a686d362f2ba9b6f3bf8124
4 changes: 2 additions & 2 deletions drivers/led/ckled2001.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ void CKLED2001_init(uint8_t addr) {

// Enable LEDs ON/OFF
CKLED2001_write_register(addr, CONFIGURE_CMD_PAGE, LED_CONTROL_PAGE);
for (int i = 0; i< LED_CONTROL_ON_OFF_LENGTH; i++) {
for (int i = 0; i < LED_CONTROL_ON_OFF_LENGTH; i++) {
CKLED2001_write_register(addr, i, 0xFF);
}

// Select to function page
CKLED2001_write_register(addr, CONFIGURE_CMD_PAGE, FUNCTION_PAGE);
// Setting LED driver to normal mode
Expand Down
6 changes: 3 additions & 3 deletions drivers/led/ckled2001.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,15 @@ void CKLED2001_shutdown(uint8_t addr);
// LED Control Registers
#define LED_CONTROL_ON_OFF_FIRST_ADDR 0x0
#define LED_CONTROL_ON_OFF_LAST_ADDR 0x17
#define LED_CONTROL_ON_OFF_LENGTH ((LED_CONTROL_ON_OFF_LAST_ADDR-LED_CONTROL_ON_OFF_FIRST_ADDR) + 1)
#define LED_CONTROL_ON_OFF_LENGTH ((LED_CONTROL_ON_OFF_LAST_ADDR - LED_CONTROL_ON_OFF_FIRST_ADDR) + 1)

#define LED_CONTROL_OPEN_FIRST_ADDR 0x18
#define LED_CONTROL_OPEN_LAST_ADDR 0x2F
#define LED_CONTROL_OPEN_LENGTH ((LED_CONTROL_OPEN_LAST_ADDR-LED_CONTROL_OPEN_FIRST_ADDR) + 1)
#define LED_CONTROL_OPEN_LENGTH ((LED_CONTROL_OPEN_LAST_ADDR - LED_CONTROL_OPEN_FIRST_ADDR) + 1)

#define LED_CONTROL_SHORT_FIRST_ADDR 0x30
#define LED_CONTROL_SHORT_LAST_ADDR 0x47
#define LED_CONTROL_SHORT_LENGTH ((LED_CONTROL_SHORT_LAST_ADDR-LED_CONTROL_SHORT_FIRST_ADDR) + 1)
#define LED_CONTROL_SHORT_LENGTH ((LED_CONTROL_SHORT_LAST_ADDR - LED_CONTROL_SHORT_FIRST_ADDR) + 1)

#define LED_CONTROL_PAGE_LENGTH 0x48

Expand Down