From 371122e1ec98c99f36da12fbf5ceec4d44732af6 Mon Sep 17 00:00:00 2001 From: Nathael Pajani Date: Mon, 26 Sep 2016 18:11:21 +0200 Subject: [PATCH] Update/Use enums for ports definitions --- include/drivers/gpio.h | 5 +++++ include/drivers/i2c.h | 12 +++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/include/drivers/gpio.h b/include/drivers/gpio.h index c1d4f49..27ceff4 100644 --- a/include/drivers/gpio.h +++ b/include/drivers/gpio.h @@ -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 diff --git a/include/drivers/i2c.h b/include/drivers/i2c.h index f5a793d..079844a 100644 --- a/include/drivers/i2c.h +++ b/include/drivers/i2c.h @@ -42,13 +42,15 @@ #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, -- 2.43.0