diff options
author | yiancar <yiangosyiangou@cytanet.com.cy> | 2018-08-15 08:19:38 +0300 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2018-08-15 01:19:38 -0400 |
commit | ad2bb529c795be066b279f52bebec03257992fc2 (patch) | |
tree | addf2d3b665316c985f0b0d1c524a60977d3ed72 /quantum/rgb_matrix.c | |
parent | feec8ad4694814ed8953c6f72798f51f39724af5 (diff) | |
download | qmk_firmware-ad2bb529c795be066b279f52bebec03257992fc2.tar.gz qmk_firmware-ad2bb529c795be066b279f52bebec03257992fc2.zip |
Rgb matrix arm (#3648)
* Addition of I2C master driver for STM32, Generalization of ISSI3731 driver
- Addition of an i2c_master driver for STM32 to replicate expectations of AVR driver.
- Moved ISSI3731 driver one level up to make it accesible by both architectures.
- Renamed ISSI3731 functions to a more general name for preparation of other ISSI drivers.
- Added compiler directives where necessary to differenciate each architecture.
* converted tabs to spaces
Diffstat (limited to 'quantum/rgb_matrix.c')
-rw-r--r-- | quantum/rgb_matrix.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c index b4bbc3dc0..70ad1a178 100644 --- a/quantum/rgb_matrix.c +++ b/quantum/rgb_matrix.c | |||
@@ -106,16 +106,16 @@ void map_row_column_to_led( uint8_t row, uint8_t column, uint8_t *led_i, uint8_t | |||
106 | } | 106 | } |
107 | 107 | ||
108 | void rgb_matrix_update_pwm_buffers(void) { | 108 | void rgb_matrix_update_pwm_buffers(void) { |
109 | IS31FL3731_update_pwm_buffers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); | 109 | IS31_update_pwm_buffers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); |
110 | IS31FL3731_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); | 110 | IS31_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); |
111 | } | 111 | } |
112 | 112 | ||
113 | void rgb_matrix_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) { | 113 | void rgb_matrix_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) { |
114 | IS31FL3731_set_color( index, red, green, blue ); | 114 | IS31_set_color( index, red, green, blue ); |
115 | } | 115 | } |
116 | 116 | ||
117 | void rgb_matrix_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) { | 117 | void rgb_matrix_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) { |
118 | IS31FL3731_set_color_all( red, green, blue ); | 118 | IS31_set_color_all( red, green, blue ); |
119 | } | 119 | } |
120 | 120 | ||
121 | bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record) { | 121 | bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record) { |
@@ -752,16 +752,16 @@ void rgb_matrix_init(void) { | |||
752 | void rgb_matrix_setup_drivers(void) { | 752 | void rgb_matrix_setup_drivers(void) { |
753 | // Initialize TWI | 753 | // Initialize TWI |
754 | i2c_init(); | 754 | i2c_init(); |
755 | IS31FL3731_init( DRIVER_ADDR_1 ); | 755 | IS31_init( DRIVER_ADDR_1 ); |
756 | IS31FL3731_init( DRIVER_ADDR_2 ); | 756 | IS31_init( DRIVER_ADDR_2 ); |
757 | 757 | ||
758 | for ( int index = 0; index < DRIVER_LED_TOTAL; index++ ) { | 758 | for ( int index = 0; index < DRIVER_LED_TOTAL; index++ ) { |
759 | bool enabled = true; | 759 | bool enabled = true; |
760 | // This only caches it for later | 760 | // This only caches it for later |
761 | IS31FL3731_set_led_control_register( index, enabled, enabled, enabled ); | 761 | IS31_set_led_control_register( index, enabled, enabled, enabled ); |
762 | } | 762 | } |
763 | // This actually updates the LED drivers | 763 | // This actually updates the LED drivers |
764 | IS31FL3731_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); | 764 | IS31_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); |
765 | } | 765 | } |
766 | 766 | ||
767 | // Deals with the messy details of incrementing an integer | 767 | // Deals with the messy details of incrementing an integer |
@@ -811,11 +811,11 @@ void rgb_matrix_test_led( uint8_t index, bool red, bool green, bool blue ) { | |||
811 | { | 811 | { |
812 | if ( i == index ) | 812 | if ( i == index ) |
813 | { | 813 | { |
814 | IS31FL3731_set_led_control_register( i, red, green, blue ); | 814 | IS31_set_led_control_register( i, red, green, blue ); |
815 | } | 815 | } |
816 | else | 816 | else |
817 | { | 817 | { |
818 | IS31FL3731_set_led_control_register( i, false, false, false ); | 818 | IS31_set_led_control_register( i, false, false, false ); |
819 | } | 819 | } |
820 | } | 820 | } |
821 | } | 821 | } |