diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-04-23 09:45:28 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-04-23 15:18:43 +0200 |
commit | a2dad96ab736f66ed54421cad53caf31f250e181 (patch) | |
tree | 1935320b5b52276ed2e52741cdae71637f209f77 /bsps/arm/stm32f4/i2c/i2c-config.c | |
parent | bsps/arm: Remove unused stm32f* files (diff) | |
download | rtems-a2dad96ab736f66ed54421cad53caf31f250e181.tar.bz2 |
bsps: Move I2C drivers to bsps
This patch is a part of the BSP source reorganization.
Update #3285.
Diffstat (limited to 'bsps/arm/stm32f4/i2c/i2c-config.c')
-rw-r--r-- | bsps/arm/stm32f4/i2c/i2c-config.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/bsps/arm/stm32f4/i2c/i2c-config.c b/bsps/arm/stm32f4/i2c/i2c-config.c new file mode 100644 index 0000000000..eac16bafc0 --- /dev/null +++ b/bsps/arm/stm32f4/i2c/i2c-config.c @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2013 Christian Mauderer. All rights reserved. + * + * embedded brains GmbH + * Obere Lagerstr. 30 + * 82178 Puchheim + * Germany + * <rtems@embedded-brains.de> + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#include <bspopts.h> +#include <bsp/i2c.h> +#include <bsp/irq.h> + +#ifdef STM32F4_ENABLE_I2C1 + static stm32f4_i2c_bus_entry stm32f4_i2c1_entry = { + .regs = STM32F4_I2C1, + .index = 0, + .vector = STM32F4_IRQ_I2C1_EV, + }; + + stm32f4_i2c_bus_entry *const stm32f4_i2c1 = &stm32f4_i2c1_entry; +#endif + +#ifdef STM32F4_ENABLE_I2C2 + static stm32f4_i2c_bus_entry stm32f4_i2c2_entry = { + .regs = STM32F4_I2C2, + .index = 1, + .vector = STM32F4_IRQ_I2C2_EV, + }; + + stm32f4_i2c_bus_entry *const stm32f4_i2c2 = &stm32f4_i2c2_entry; +#endif |