Update/Use enums for ports definitions
authorNathael Pajani <nathael.pajani@ed3l.fr>
Mon, 26 Sep 2016 16:11:21 +0000 (18:11 +0200)
committerNathael Pajani <nathael.pajani@ed3l.fr>
Fri, 10 Feb 2023 18:02:59 +0000 (19:02 +0100)
include/drivers/gpio.h
include/drivers/i2c.h

index c1d4f49..27ceff4 100644 (file)
@@ -72,6 +72,11 @@ struct lpc_gpio
 /***************************************************************************** */
 /*   Public access to GPIO setup   */
 
+enum gpio_ports {
+       GPIO_PORT0 = 0,
+       GPIO_PORT1,
+       GPIO_PORT2,
+};
 
 #define GPIO_DIR_IN 0
 #define GPIO_DIR_OUT 1
index f5a793d..079844a 100644 (file)
 #define I2C_READ_BIT 0x01
 #define I2C_WRITE_BIT 0x00
 
-#define I2C0  0
-#define I2C1  1
-#define I2C2  2
-#define I2C3  3
+enum i2c_busses {
+       I2C0 = 0,
+       I2C1,
+       I2C2,
+       I2C3,
+};
 
 
-enum i2c_type {
+enum i2c_modes {
        I2C_MASTER = 0,
        I2C_SLAVE,
        I2C_MONITOR,