You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ut...@apache.org on 2018/04/18 21:56:29 UTC

[mynewt-core] 06/13: stm32l1 i2c support

This is an automated email from the ASF dual-hosted git repository.

utzig pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 9e0d1ef42a7cbbe5776559c03fb4527e46d108f9
Author: Fabio Utzig <ut...@apache.org>
AuthorDate: Thu Mar 22 09:51:09 2018 -0300

    stm32l1 i2c support
---
 hw/bsp/stm32l152discovery/src/hal_bsp.c                 | 2 +-
 hw/mcu/stm/stm32l1xx/include/mcu/stm32_hal.h            | 5 +++++
 hw/mcu/stm/stm32l1xx/include/mcu/stm32l1xx_mynewt_hal.h | 2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/hw/bsp/stm32l152discovery/src/hal_bsp.c b/hw/bsp/stm32l152discovery/src/hal_bsp.c
index 0e8d521..42f88e3 100644
--- a/hw/bsp/stm32l152discovery/src/hal_bsp.c
+++ b/hw/bsp/stm32l152discovery/src/hal_bsp.c
@@ -69,7 +69,7 @@ static const struct stm32l1_uart_cfg uart_cfg[UART_CNT] = {
 #endif
 
 #if MYNEWT_VAL(I2C_0)
-static struct stm32l1_hal_i2c_cfg i2c_cfg0 = {
+static struct stm32_hal_i2c_cfg i2c_cfg0 = {
     .hic_i2c = I2C1,
     .hic_rcc_reg = &RCC->APB1ENR,
     .hic_rcc_dev = RCC_APB1ENR_I2C1EN,
diff --git a/hw/mcu/stm/stm32l1xx/include/mcu/stm32_hal.h b/hw/mcu/stm/stm32l1xx/include/mcu/stm32_hal.h
index ae557e6..77e1435 100644
--- a/hw/mcu/stm/stm32l1xx/include/mcu/stm32_hal.h
+++ b/hw/mcu/stm/stm32l1xx/include/mcu/stm32_hal.h
@@ -58,6 +58,11 @@ struct stm32_hal_spi_cfg {
     int irq_prio;
 };
 
+/* hal_i2c */
+#include "stm32l1xx_hal_i2c.h"
+#include "mcu/stm32l1xx_mynewt_hal.h"
+#include "mcu/stm32l1_bsp.h"
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/hw/mcu/stm/stm32l1xx/include/mcu/stm32l1xx_mynewt_hal.h b/hw/mcu/stm/stm32l1xx/include/mcu/stm32l1xx_mynewt_hal.h
index 987b46d..7651c5e 100644
--- a/hw/mcu/stm/stm32l1xx/include/mcu/stm32l1xx_mynewt_hal.h
+++ b/hw/mcu/stm/stm32l1xx/include/mcu/stm32l1xx_mynewt_hal.h
@@ -48,7 +48,7 @@ extern "C" {
 int hal_gpio_init_stm(int pin, GPIO_InitTypeDef *cfg);
 int hal_gpio_deinit_stm(int pin, GPIO_InitTypeDef *cfg);
 
-struct stm32l1_hal_i2c_cfg {
+struct stm32_hal_i2c_cfg {
     I2C_TypeDef *hic_i2c;
     volatile uint32_t *hic_rcc_reg;     /* RCC register to modify */
     uint32_t hic_rcc_dev;               /* RCC device ID */

-- 
To stop receiving notification emails like this one, please contact
utzig@apache.org.