summaryrefslogtreecommitdiff
path: root/drivers/issi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/issi')
-rw-r--r--drivers/issi/is31fl3218.h1
-rw-r--r--drivers/issi/is31fl3731-simple.c15
-rw-r--r--drivers/issi/is31fl3731-simple.h8
-rw-r--r--drivers/issi/is31fl3731.c18
-rw-r--r--drivers/issi/is31fl3731.h5
-rw-r--r--drivers/issi/is31fl3733.c19
-rw-r--r--drivers/issi/is31fl3733.h5
-rw-r--r--drivers/issi/is31fl3736.c21
-rw-r--r--drivers/issi/is31fl3737.c23
-rw-r--r--drivers/issi/is31fl3737.h5
10 files changed, 25 insertions, 95 deletions
diff --git a/drivers/issi/is31fl3218.h b/drivers/issi/is31fl3218.h
index a70cc1e793..fa760da191 100644
--- a/drivers/issi/is31fl3218.h
+++ b/drivers/issi/is31fl3218.h
@@ -13,6 +13,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+
#pragma once
#include <stdint.h>
diff --git a/drivers/issi/is31fl3731-simple.c b/drivers/issi/is31fl3731-simple.c
index fad4676def..bd3bb47460 100644
--- a/drivers/issi/is31fl3731-simple.c
+++ b/drivers/issi/is31fl3731-simple.c
@@ -16,21 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifdef __AVR__
-# include <avr/interrupt.h>
-# include <avr/io.h>
-# include <util/delay.h>
-#else
-# include "wait.h"
-#endif
-
-#include <stdint.h>
-#include <stdbool.h>
-#include <string.h>
#include "is31fl3731-simple.h"
#include "i2c_master.h"
-#include "progmem.h"
-#include "print.h"
+#include "wait.h"
// This is a 7-bit address, that gets left-shifted and bit 0
// set to 0 for write, 1 for read (as per I2C protocol)
@@ -156,6 +144,7 @@ void IS31FL3731_init(uint8_t addr) {
// enable software shutdown
IS31FL3731_write_register(addr, ISSI_REG_SHUTDOWN, 0x00);
+
// this delay was copied from other drivers, might not be needed
wait_ms(10);
diff --git a/drivers/issi/is31fl3731-simple.h b/drivers/issi/is31fl3731-simple.h
index a223c351e8..85b458753c 100644
--- a/drivers/issi/is31fl3731-simple.h
+++ b/drivers/issi/is31fl3731-simple.h
@@ -16,8 +16,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef IS31FL3731_DRIVER_H
-#define IS31FL3731_DRIVER_H
+#pragma once
+
+#include <stdint.h>
+#include <stdbool.h>
typedef struct is31_led {
uint8_t driver : 2;
@@ -203,5 +205,3 @@ void IS31FL3731_update_led_control_registers(uint8_t addr, uint8_t index);
#define C9_14 0xB1
#define C9_15 0xB2
#define C9_16 0xB3
-
-#endif // IS31FL3731_DRIVER_H
diff --git a/drivers/issi/is31fl3731.c b/drivers/issi/is31fl3731.c
index 0b6f3e985d..9f006b8174 100644
--- a/drivers/issi/is31fl3731.c
+++ b/drivers/issi/is31fl3731.c
@@ -15,18 +15,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifdef __AVR__
-# include <avr/interrupt.h>
-# include <avr/io.h>
-# include <util/delay.h>
-#else
-# include "wait.h"
-#endif
-
#include "is31fl3731.h"
-#include <string.h>
#include "i2c_master.h"
-#include "progmem.h"
+#include "wait.h"
// This is a 7-bit address, that gets left-shifted and bit 0
// set to 0 for write, 1 for read (as per I2C protocol)
@@ -141,12 +132,9 @@ void IS31FL3731_init(uint8_t addr) {
// enable software shutdown
IS31FL3731_write_register(addr, ISSI_REG_SHUTDOWN, 0x00);
-// this delay was copied from other drivers, might not be needed
-#ifdef __AVR__
- _delay_ms(10);
-#else
+
+ // this delay was copied from other drivers, might not be needed
wait_ms(10);
-#endif
// picture mode
IS31FL3731_write_register(addr, ISSI_REG_CONFIG, ISSI_REG_CONFIG_PICTUREMODE);
diff --git a/drivers/issi/is31fl3731.h b/drivers/issi/is31fl3731.h
index 6a7a45d8ff..19e8e6251f 100644
--- a/drivers/issi/is31fl3731.h
+++ b/drivers/issi/is31fl3731.h
@@ -15,8 +15,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef IS31FL3731_DRIVER_H
-#define IS31FL3731_DRIVER_H
+#pragma once
#include <stdint.h>
#include <stdbool.h>
@@ -207,5 +206,3 @@ void IS31FL3731_update_led_control_registers(uint8_t addr, uint8_t index);
#define C9_14 0xB1
#define C9_15 0xB2
#define C9_16 0xB3
-
-#endif // IS31FL3731_DRIVER_H
diff --git a/drivers/issi/is31fl3733.c b/drivers/issi/is31fl3733.c
index e60f0e878e..b913922b07 100644
--- a/drivers/issi/is31fl3733.c
+++ b/drivers/issi/is31fl3733.c
@@ -16,18 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifdef __AVR__
-# include <avr/interrupt.h>
-# include <avr/io.h>
-# include <util/delay.h>
-#else
-# include "wait.h"
-#endif
-
-#include <string.h>
-#include "i2c_master.h"
-#include "progmem.h"
#include "is31fl3733.h"
+#include "i2c_master.h"
+#include "wait.h"
// This is a 7-bit address, that gets left-shifted and bit 0
// set to 0 for write, 1 for read (as per I2C protocol)
@@ -168,12 +159,8 @@ void IS31FL3733_init(uint8_t addr, uint8_t sync) {
// Disable software shutdown.
IS31FL3733_write_register(addr, ISSI_REG_CONFIGURATION, (sync << 6) | 0x01);
-// Wait 10ms to ensure the device has woken up.
-#ifdef __AVR__
- _delay_ms(10);
-#else
+ // Wait 10ms to ensure the device has woken up.
wait_ms(10);
-#endif
}
void IS31FL3733_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
diff --git a/drivers/issi/is31fl3733.h b/drivers/issi/is31fl3733.h
index 4cf1867334..603d505a13 100644
--- a/drivers/issi/is31fl3733.h
+++ b/drivers/issi/is31fl3733.h
@@ -16,8 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef IS31FL3733_DRIVER_H
-#define IS31FL3733_DRIVER_H
+#pragma once
#include <stdint.h>
#include <stdbool.h>
@@ -250,5 +249,3 @@ void IS31FL3733_update_led_control_registers(uint8_t addr, uint8_t index);
#define L_14 0xBD
#define L_15 0xBE
#define L_16 0xBF
-
-#endif // IS31FL3733_DRIVER_H
diff --git a/drivers/issi/is31fl3736.c b/drivers/issi/is31fl3736.c
index 754292425e..9bd8fecfb2 100644
--- a/drivers/issi/is31fl3736.c
+++ b/drivers/issi/is31fl3736.c
@@ -14,18 +14,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifdef __AVR__
-# include <avr/interrupt.h>
-# include <avr/io.h>
-# include <util/delay.h>
-#else
-# include "wait.h"
-#endif
-
#include "is31fl3736.h"
-#include <string.h>
#include "i2c_master.h"
-#include "progmem.h"
+#include "wait.h"
// This is a 7-bit address, that gets left-shifted and bit 0
// set to 0 for write, 1 for read (as per I2C protocol)
@@ -154,12 +145,8 @@ void IS31FL3736_init(uint8_t addr) {
// Disable software shutdown.
IS31FL3736_write_register(addr, ISSI_REG_CONFIGURATION, 0x01);
-// Wait 10ms to ensure the device has woken up.
-#ifdef __AVR__
- _delay_ms(10);
-#else
+ // Wait 10ms to ensure the device has woken up.
wait_ms(10);
-#endif
}
void IS31FL3736_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
@@ -263,7 +250,7 @@ void IS31FL3736_update_pwm_buffers(uint8_t addr1, uint8_t addr2) {
IS31FL3736_write_register(addr1, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM);
IS31FL3736_write_pwm_buffer(addr1, g_pwm_buffer[0]);
- // IS31FL3736_write_pwm_buffer( addr2, g_pwm_buffer[1] );
+ // IS31FL3736_write_pwm_buffer(addr2, g_pwm_buffer[1]);
}
g_pwm_buffer_update_required = false;
}
@@ -275,7 +262,7 @@ void IS31FL3736_update_led_control_registers(uint8_t addr1, uint8_t addr2) {
IS31FL3736_write_register(addr1, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL);
for (int i = 0; i < 24; i++) {
IS31FL3736_write_register(addr1, i, g_led_control_registers[0][i]);
- // IS31FL3736_write_register(addr2, i, g_led_control_registers[1][i] );
+ // IS31FL3736_write_register(addr2, i, g_led_control_registers[1][i]);
}
}
}
diff --git a/drivers/issi/is31fl3737.c b/drivers/issi/is31fl3737.c
index 4cc46272e2..37c5c58e42 100644
--- a/drivers/issi/is31fl3737.c
+++ b/drivers/issi/is31fl3737.c
@@ -16,18 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifdef __AVR__
-# include <avr/interrupt.h>
-# include <avr/io.h>
-# include <util/delay.h>
-#else
-# include "wait.h"
-#endif
-
-#include <string.h>
+#include "is31fl3737.h"
#include "i2c_master.h"
-#include "progmem.h"
-#include "rgb_matrix.h"
+#include "wait.h"
// This is a 7-bit address, that gets left-shifted and bit 0
// set to 0 for write, 1 for read (as per I2C protocol)
@@ -156,12 +147,8 @@ void IS31FL3737_init(uint8_t addr) {
// Disable software shutdown.
IS31FL3737_write_register(addr, ISSI_REG_CONFIGURATION, 0x01);
-// Wait 10ms to ensure the device has woken up.
-#ifdef __AVR__
- _delay_ms(10);
-#else
+ // Wait 10ms to ensure the device has woken up.
wait_ms(10);
-#endif
}
void IS31FL3737_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
@@ -217,7 +204,7 @@ void IS31FL3737_update_pwm_buffers(uint8_t addr1, uint8_t addr2) {
IS31FL3737_write_register(addr1, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM);
IS31FL3737_write_pwm_buffer(addr1, g_pwm_buffer[0]);
- // IS31FL3737_write_pwm_buffer( addr2, g_pwm_buffer[1] );
+ // IS31FL3737_write_pwm_buffer(addr2, g_pwm_buffer[1]);
}
g_pwm_buffer_update_required = false;
}
@@ -229,7 +216,7 @@ void IS31FL3737_update_led_control_registers(uint8_t addr1, uint8_t addr2) {
IS31FL3737_write_register(addr1, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL);
for (int i = 0; i < 24; i++) {
IS31FL3737_write_register(addr1, i, g_led_control_registers[0][i]);
- // IS31FL3737_write_register(addr2, i, g_led_control_registers[1][i] );
+ // IS31FL3737_write_register(addr2, i, g_led_control_registers[1][i]);
}
}
}
diff --git a/drivers/issi/is31fl3737.h b/drivers/issi/is31fl3737.h
index 2c2fb19641..a1d2281778 100644
--- a/drivers/issi/is31fl3737.h
+++ b/drivers/issi/is31fl3737.h
@@ -16,8 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef IS31FL3737_DRIVER_H
-#define IS31FL3737_DRIVER_H
+#pragma once
#include <stdint.h>
#include <stdbool.h>
@@ -202,5 +201,3 @@ void IS31FL3737_update_led_control_registers(uint8_t addr1, uint8_t addr2);
#define L_10 0xBB
#define L_11 0xBC
#define L_12 0xBD
-
-#endif // IS31FL3737_DRIVER_H