forked from mirrors/qmk_userspace
LED drivers: clean up SWx
/CSy
pullup/down resistor config (#22381)
This commit is contained in:
parent
6b19a99a4f
commit
8136cf4bfb
18 changed files with 302 additions and 218 deletions
|
@ -33,8 +33,8 @@
|
|||
#define IS31FL3733_REG_CONFIGURATION 0x00 // PG3
|
||||
#define IS31FL3733_REG_GLOBALCURRENT 0x01 // PG3
|
||||
#define IS31FL3733_REG_RESET 0x11 // PG3
|
||||
#define IS31FL3733_REG_SWPULLUP 0x0F // PG3
|
||||
#define IS31FL3733_REG_CSPULLUP 0x10 // PG3
|
||||
#define IS31FL3733_REG_SW_PULLUP 0x0F // PG3
|
||||
#define IS31FL3733_REG_CS_PULLDOWN 0x10 // PG3
|
||||
|
||||
#define IS31FL3733_PWM_REGISTER_COUNT 192
|
||||
#define IS31FL3733_LED_CONTROL_REGISTER_COUNT 24
|
||||
|
@ -51,12 +51,12 @@
|
|||
# define IS31FL3733_PWM_FREQUENCY IS31FL3733_PWM_FREQUENCY_8K4_HZ // PFS - IS31FL3733B only
|
||||
#endif
|
||||
|
||||
#ifndef IS31FL3733_SWPULLUP
|
||||
# define IS31FL3733_SWPULLUP IS31FL3733_PUR_0R
|
||||
#ifndef IS31FL3733_SW_PULLUP
|
||||
# define IS31FL3733_SW_PULLUP IS31FL3733_PUR_0_OHM
|
||||
#endif
|
||||
|
||||
#ifndef IS31FL3733_CSPULLUP
|
||||
# define IS31FL3733_CSPULLUP IS31FL3733_PUR_0R
|
||||
#ifndef IS31FL3733_CS_PULLDOWN
|
||||
# define IS31FL3733_CS_PULLDOWN IS31FL3733_PDR_0_OHM
|
||||
#endif
|
||||
|
||||
#ifndef IS31FL3733_GLOBALCURRENT
|
||||
|
@ -193,9 +193,9 @@ void is31fl3733_init(uint8_t bus, uint8_t addr, uint8_t sync) {
|
|||
// Select PG3
|
||||
is31fl3733_write_register(bus, addr, IS31FL3733_COMMANDREGISTER, IS31FL3733_PAGE_FUNCTION);
|
||||
// Set de-ghost pull-up resistors (SWx)
|
||||
is31fl3733_write_register(bus, addr, IS31FL3733_REG_SWPULLUP, IS31FL3733_SWPULLUP);
|
||||
is31fl3733_write_register(bus, addr, IS31FL3733_REG_SW_PULLUP, IS31FL3733_SW_PULLUP);
|
||||
// Set de-ghost pull-down resistors (CSx)
|
||||
is31fl3733_write_register(bus, addr, IS31FL3733_REG_CSPULLUP, IS31FL3733_CSPULLUP);
|
||||
is31fl3733_write_register(bus, addr, IS31FL3733_REG_CS_PULLDOWN, IS31FL3733_CS_PULLDOWN);
|
||||
// Set global current to maximum.
|
||||
is31fl3733_write_register(bus, addr, IS31FL3733_REG_GLOBALCURRENT, IS31FL3733_GLOBALCURRENT);
|
||||
// Disable software shutdown.
|
||||
|
|
|
@ -67,19 +67,29 @@ void is31fl3733_update_led_control_registers(uint8_t addr, uint8_t index);
|
|||
|
||||
void is31fl3733_flush(void);
|
||||
|
||||
#define IS31FL3733_PUR_0R 0x00 // No PUR resistor
|
||||
#define IS31FL3733_PUR_05KR 0x02 // 0.5k Ohm resistor in t_NOL
|
||||
#define IS31FL3733_PUR_3KR 0x03 // 3.0k Ohm resistor on all the time
|
||||
#define IS31FL3733_PUR_4KR 0x04 // 4.0k Ohm resistor on all the time
|
||||
#define IS31FL3733_PUR_8KR 0x05 // 8.0k Ohm resistor on all the time
|
||||
#define IS31FL3733_PUR_16KR 0x06 // 16k Ohm resistor on all the time
|
||||
#define IS31FL3733_PUR_32KR 0x07 // 32k Ohm resistor in t_NOL
|
||||
#define IS31FL3733_PDR_0_OHM 0b000 // No pull-down resistor
|
||||
#define IS31FL3733_PDR_0K5_OHM 0b001 // 0.5 kOhm resistor
|
||||
#define IS31FL3733_PDR_1K_OHM 0b010 // 1 kOhm resistor
|
||||
#define IS31FL3733_PDR_2K_OHM 0b011 // 2 kOhm resistor
|
||||
#define IS31FL3733_PDR_4K_OHM 0b100 // 4 kOhm resistor
|
||||
#define IS31FL3733_PDR_8K_OHM 0b101 // 8 kOhm resistor
|
||||
#define IS31FL3733_PDR_16K_OHM 0b110 // 16 kOhm resistor
|
||||
#define IS31FL3733_PDR_32K_OHM 0b111 // 32 kOhm resistor
|
||||
|
||||
#define IS31FL3733_PWM_FREQUENCY_8K4_HZ 0x00
|
||||
#define IS31FL3733_PWM_FREQUENCY_4K2_HZ 0x01
|
||||
#define IS31FL3733_PWM_FREQUENCY_26K7_HZ 0x02
|
||||
#define IS31FL3733_PWM_FREQUENCY_2K1_HZ 0x03
|
||||
#define IS31FL3733_PWM_FREQUENCY_1K05_HZ 0x04
|
||||
#define IS31FL3733_PUR_0_OHM 0b000 // No pull-up resistor
|
||||
#define IS31FL3733_PUR_0K5_OHM 0b001 // 0.5 kOhm resistor
|
||||
#define IS31FL3733_PUR_1K_OHM 0b010 // 1 kOhm resistor
|
||||
#define IS31FL3733_PUR_2K_OHM 0b011 // 2 kOhm resistor
|
||||
#define IS31FL3733_PUR_4K_OHM 0b100 // 4 kOhm resistor
|
||||
#define IS31FL3733_PUR_8K_OHM 0b101 // 8 kOhm resistor
|
||||
#define IS31FL3733_PUR_16K_OHM 0b110 // 16 kOhm resistor
|
||||
#define IS31FL3733_PUR_32K_OHM 0b111 // 32 kOhm resistor
|
||||
|
||||
#define IS31FL3733_PWM_FREQUENCY_8K4_HZ 0b000
|
||||
#define IS31FL3733_PWM_FREQUENCY_4K2_HZ 0b001
|
||||
#define IS31FL3733_PWM_FREQUENCY_26K7_HZ 0b010
|
||||
#define IS31FL3733_PWM_FREQUENCY_2K1_HZ 0b011
|
||||
#define IS31FL3733_PWM_FREQUENCY_1K05_HZ 0b100
|
||||
|
||||
#define IS31FL3733_SYNC_NONE 0b00
|
||||
#define IS31FL3733_SYNC_MASTER 0b01
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue