aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRyan <[email protected]>2024-03-30 03:57:21 +1100
committerGitHub <[email protected]>2024-03-29 16:57:21 +0000
commitd0cf7b85192ce4431bb4c8c57e2d7501df83ac43 (patch)
treee182500e7df7bf2886300e53e5c7d7c03b01bb40 /drivers
parente891109c4e115a303e109b179bf9d24edbdd7ad7 (diff)
downloadqmk_firmware-d0cf7b85192ce4431bb4c8c57e2d7501df83ac43.tar.gz
qmk_firmware-d0cf7b85192ce4431bb4c8c57e2d7501df83ac43.zip
Update GPIO expander API naming (#23375)
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpio/mcp23018.c8
-rw-r--r--drivers/gpio/mcp23018.h9
-rw-r--r--drivers/gpio/pca9505.c4
-rw-r--r--drivers/gpio/pca9505.h6
-rw-r--r--drivers/gpio/pca9555.c8
-rw-r--r--drivers/gpio/pca9555.h9
6 files changed, 29 insertions, 15 deletions
diff --git a/drivers/gpio/mcp23018.c b/drivers/gpio/mcp23018.c
index 3eca4f9d34..0791db08dd 100644
--- a/drivers/gpio/mcp23018.c
+++ b/drivers/gpio/mcp23018.c
@@ -74,20 +74,20 @@ bool mcp23018_set_output_all(uint8_t slave_addr, uint8_t confA, uint8_t confB) {
return true;
}
-bool mcp23018_readPins(uint8_t slave_addr, mcp23018_port_t port, uint8_t* out) {
+bool mcp23018_read_pins(uint8_t slave_addr, mcp23018_port_t port, uint8_t* out) {
uint8_t addr = SLAVE_TO_ADDR(slave_addr);
uint8_t cmd = port ? CMD_GPIOB : CMD_GPIOA;
i2c_status_t ret = i2c_read_register(addr, cmd, out, sizeof(uint8_t), TIMEOUT);
if (ret != I2C_STATUS_SUCCESS) {
- dprintf("mcp23018_readPins::FAILED::%u\n", ret);
+ dprintf("mcp23018_read_pins::FAILED::%u\n", ret);
return false;
}
return true;
}
-bool mcp23018_readPins_all(uint8_t slave_addr, uint16_t* out) {
+bool mcp23018_read_pins_all(uint8_t slave_addr, uint16_t* out) {
uint8_t addr = SLAVE_TO_ADDR(slave_addr);
typedef union {
@@ -99,7 +99,7 @@ bool mcp23018_readPins_all(uint8_t slave_addr, uint16_t* out) {
i2c_status_t ret = i2c_read_register(addr, CMD_GPIOA, &data.u8[0], sizeof(data), TIMEOUT);
if (ret != I2C_STATUS_SUCCESS) {
- dprintf("mcp23018_readPins::FAILED::%u\n", ret);
+ dprintf("mcp23018_read_pins_all::FAILED::%u\n", ret);
return false;
}
diff --git a/drivers/gpio/mcp23018.h b/drivers/gpio/mcp23018.h
index e7c2730dd1..98c818fb8d 100644
--- a/drivers/gpio/mcp23018.h
+++ b/drivers/gpio/mcp23018.h
@@ -55,11 +55,16 @@ bool mcp23018_set_output_all(uint8_t slave_addr, uint8_t confA, uint8_t confB);
/**
* Read state of a given port
*/
-bool mcp23018_readPins(uint8_t slave_addr, mcp23018_port_t port, uint8_t* ret);
+bool mcp23018_read_pins(uint8_t slave_addr, mcp23018_port_t port, uint8_t* ret);
/**
* Read state of both ports sequentially
*
* - slightly faster than multiple readPins
*/
-bool mcp23018_readPins_all(uint8_t slave_addr, uint16_t* ret);
+bool mcp23018_read_pins_all(uint8_t slave_addr, uint16_t* ret);
+
+// DEPRECATED - DO NOT USE
+
+#define mcp23018_readPins mcp23018_read_pins
+#define mcp23018_readPins_all mcp23018_read_pins_all
diff --git a/drivers/gpio/pca9505.c b/drivers/gpio/pca9505.c
index 5617a14a8b..d1adc61a23 100644
--- a/drivers/gpio/pca9505.c
+++ b/drivers/gpio/pca9505.c
@@ -133,7 +133,7 @@ bool pca9505_set_output(uint8_t slave_addr, pca9505_port_t port, uint8_t conf) {
return true;
}
-bool pca9505_readPins(uint8_t slave_addr, pca9505_port_t port, uint8_t* out) {
+bool pca9505_read_pins(uint8_t slave_addr, pca9505_port_t port, uint8_t* out) {
uint8_t addr = SLAVE_TO_ADDR(slave_addr);
uint8_t cmd = 0;
switch (port) {
@@ -156,7 +156,7 @@ bool pca9505_readPins(uint8_t slave_addr, pca9505_port_t port, uint8_t* out) {
i2c_status_t ret = i2c_read_register(addr, cmd, out, sizeof(uint8_t), TIMEOUT);
if (ret != I2C_STATUS_SUCCESS) {
- print("pca9505_readPins::FAILED\n");
+ print("pca9505_read_pins::FAILED\n");
return false;
}
diff --git a/drivers/gpio/pca9505.h b/drivers/gpio/pca9505.h
index 732ddb88ea..0cec8610d9 100644
--- a/drivers/gpio/pca9505.h
+++ b/drivers/gpio/pca9505.h
@@ -64,4 +64,8 @@ bool pca9505_set_output(uint8_t slave_addr, pca9505_port_t port, uint8_t conf);
/**
* Read state of a given port
*/
-bool pca9505_readPins(uint8_t slave_addr, pca9505_port_t port, uint8_t* ret);
+bool pca9505_read_pins(uint8_t slave_addr, pca9505_port_t port, uint8_t* ret);
+
+// DEPRECATED - DO NOT USE
+
+#define pca9505_readPins pca9505_read_pins
diff --git a/drivers/gpio/pca9555.c b/drivers/gpio/pca9555.c
index 0fc30099ac..28b74e1a70 100644
--- a/drivers/gpio/pca9555.c
+++ b/drivers/gpio/pca9555.c
@@ -70,20 +70,20 @@ bool pca9555_set_output_all(uint8_t slave_addr, uint8_t confA, uint8_t confB) {
return true;
}
-bool pca9555_readPins(uint8_t slave_addr, pca9555_port_t port, uint8_t* out) {
+bool pca9555_read_pins(uint8_t slave_addr, pca9555_port_t port, uint8_t* out) {
uint8_t addr = SLAVE_TO_ADDR(slave_addr);
uint8_t cmd = port ? CMD_INPUT_1 : CMD_INPUT_0;
i2c_status_t ret = i2c_read_register(addr, cmd, out, sizeof(uint8_t), TIMEOUT);
if (ret != I2C_STATUS_SUCCESS) {
- print("pca9555_readPins::FAILED\n");
+ print("pca9555_read_pins::FAILED\n");
return false;
}
return true;
}
-bool pca9555_readPins_all(uint8_t slave_addr, uint16_t* out) {
+bool pca9555_read_pins_all(uint8_t slave_addr, uint16_t* out) {
uint8_t addr = SLAVE_TO_ADDR(slave_addr);
typedef union {
@@ -95,7 +95,7 @@ bool pca9555_readPins_all(uint8_t slave_addr, uint16_t* out) {
i2c_status_t ret = i2c_read_register(addr, CMD_INPUT_0, &data.u8[0], sizeof(data), TIMEOUT);
if (ret != I2C_STATUS_SUCCESS) {
- print("pca9555_readPins_all::FAILED\n");
+ print("pca9555_read_pins_all::FAILED\n");
return false;
}
diff --git a/drivers/gpio/pca9555.h b/drivers/gpio/pca9555.h
index 6362ab68ae..f089022e84 100644
--- a/drivers/gpio/pca9555.h
+++ b/drivers/gpio/pca9555.h
@@ -78,11 +78,16 @@ bool pca9555_set_output_all(uint8_t slave_addr, uint8_t confA, uint8_t confB);
/**
* Read state of a given port
*/
-bool pca9555_readPins(uint8_t slave_addr, pca9555_port_t port, uint8_t* ret);
+bool pca9555_read_pins(uint8_t slave_addr, pca9555_port_t port, uint8_t* ret);
/**
* Read state of both ports sequentially
*
* - slightly faster than multiple readPins
*/
-bool pca9555_readPins_all(uint8_t slave_addr, uint16_t* ret);
+bool pca9555_read_pins_all(uint8_t slave_addr, uint16_t* ret);
+
+// DEPRECATED - DO NOT USE
+
+#define pca9555_readPins pca9555_read_pins
+#define pca9555_readPins_all pca9555_read_pins_all