Skip to content

Commit f2ce7eb

Browse files
authored
Merge pull request #3442 from LMESTM/dev_stm_i2c_f1
Dev stm i2c f1
2 parents e182ff4 + 57eb4a0 commit f2ce7eb

File tree

113 files changed

+14094
-2507
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+14094
-2507
lines changed

targets/TARGET_STM/TARGET_STM32F1/TARGET_BLUEPILL_F103C8/objects.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,6 @@ struct analogin_s {
6060
uint8_t channel;
6161
};
6262

63-
struct i2c_s {
64-
I2CName i2c;
65-
uint32_t slave;
66-
};
67-
6863
struct can_s {
6964
CANName can;
7065
int index;

targets/TARGET_STM/TARGET_STM32F1/TARGET_DISCO_F100RB/objects.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,6 @@ struct analogin_s {
6060
uint8_t channel;
6161
};
6262

63-
struct i2c_s {
64-
I2CName i2c;
65-
uint32_t slave;
66-
};
67-
6863
#include "common_objects.h"
6964
#include "gpio_object.h"
7065

targets/TARGET_STM/TARGET_STM32F1/TARGET_NUCLEO_F103RB/objects.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,6 @@ struct analogin_s {
6060
uint8_t channel;
6161
};
6262

63-
struct i2c_s {
64-
I2CName i2c;
65-
uint32_t slave;
66-
};
67-
6863
struct can_s {
6964
CANName can;
7065
int index;

targets/TARGET_STM/TARGET_STM32F1/common_objects.h

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,34 @@ struct spi_s {
8282
#endif
8383
};
8484

85+
struct i2c_s {
86+
/* The 1st 2 members I2CName i2c
87+
* and I2C_HandleTypeDef handle should
88+
* be kept as the first members of this struct
89+
* to ensure i2c_get_obj to work as expected
90+
*/
91+
I2CName i2c;
92+
I2C_HandleTypeDef handle;
93+
uint8_t index;
94+
int hz;
95+
PinName sda;
96+
PinName scl;
97+
IRQn_Type event_i2cIRQ;
98+
IRQn_Type error_i2cIRQ;
99+
uint32_t XferOperation;
100+
volatile uint8_t event;
101+
#if DEVICE_I2CSLAVE
102+
uint8_t slave;
103+
volatile uint8_t pending_slave_tx_master_rx;
104+
volatile uint8_t pending_slave_rx_maxter_tx;
105+
#endif
106+
#if DEVICE_I2C_ASYNCH
107+
uint32_t address;
108+
uint8_t stop;
109+
uint8_t available_events;
110+
#endif
111+
};
112+
85113
#include "gpio_object.h"
86114

87115
#ifdef __cplusplus

targets/TARGET_STM/TARGET_STM32F1/device/Release_Notes_stm32f1xx_hal.html

Lines changed: 33 additions & 1 deletion
Large diffs are not rendered by default.
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/**
2+
******************************************************************************
3+
* @file stm32_assert.h
4+
* @author MCD Application Team
5+
* @version $VERSION$
6+
* @date $DATE$
7+
* @brief STM32 assert template file.
8+
* This file should be copied to the application folder and renamed
9+
* to stm32_assert.h.
10+
******************************************************************************
11+
* @attention
12+
*
13+
* <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
14+
*
15+
* Redistribution and use in source and binary forms, with or without modification,
16+
* are permitted provided that the following conditions are met:
17+
* 1. Redistributions of source code must retain the above copyright notice,
18+
* this list of conditions and the following disclaimer.
19+
* 2. Redistributions in binary form must reproduce the above copyright notice,
20+
* this list of conditions and the following disclaimer in the documentation
21+
* and/or other materials provided with the distribution.
22+
* 3. Neither the name of STMicroelectronics nor the names of its contributors
23+
* may be used to endorse or promote products derived from this software
24+
* without specific prior written permission.
25+
*
26+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
30+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
33+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
34+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36+
*
37+
******************************************************************************
38+
*/
39+
40+
/* Define to prevent recursive inclusion -------------------------------------*/
41+
#ifndef __STM32_ASSERT_H
42+
#define __STM32_ASSERT_H
43+
44+
#ifdef __cplusplus
45+
extern "C" {
46+
#endif
47+
48+
/* Exported types ------------------------------------------------------------*/
49+
/* Exported constants --------------------------------------------------------*/
50+
/* Includes ------------------------------------------------------------------*/
51+
/* Exported macro ------------------------------------------------------------*/
52+
#ifdef USE_FULL_ASSERT
53+
/**
54+
* @brief The assert_param macro is used for function's parameters check.
55+
* @param expr: If expr is false, it calls assert_failed function
56+
* which reports the name of the source file and the source
57+
* line number of the call that failed.
58+
* If expr is true, it returns no value.
59+
* @retval None
60+
*/
61+
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
62+
/* Exported functions ------------------------------------------------------- */
63+
void assert_failed(uint8_t* file, uint32_t line);
64+
#else
65+
#define assert_param(expr) ((void)0U)
66+
#endif /* USE_FULL_ASSERT */
67+
68+
#ifdef __cplusplus
69+
}
70+
#endif
71+
72+
#endif /* __STM32_ASSERT_H */
73+
74+
75+
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

targets/TARGET_STM/TARGET_STM32F1/device/stm32f1xx_hal.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
******************************************************************************
33
* @file stm32f1xx_hal.c
44
* @author MCD Application Team
5-
* @version V1.0.4
6-
* @date 29-April-2016
5+
* @version V1.0.5
6+
* @date 06-December-2016
77
* @brief HAL module driver.
88
* This is the common part of the HAL initialization
99
*
@@ -76,7 +76,7 @@
7676
*/
7777
#define __STM32F1xx_HAL_VERSION_MAIN (0x01) /*!< [31:24] main version */
7878
#define __STM32F1xx_HAL_VERSION_SUB1 (0x00) /*!< [23:16] sub1 version */
79-
#define __STM32F1xx_HAL_VERSION_SUB2 (0x04) /*!< [15:8] sub2 version */
79+
#define __STM32F1xx_HAL_VERSION_SUB2 (0x05) /*!< [15:8] sub2 version */
8080
#define __STM32F1xx_HAL_VERSION_RC (0x00) /*!< [7:0] release candidate */
8181
#define __STM32F1xx_HAL_VERSION ((__STM32F1xx_HAL_VERSION_MAIN << 24)\
8282
|(__STM32F1xx_HAL_VERSION_SUB1 << 16)\

targets/TARGET_STM/TARGET_STM32F1/device/stm32f1xx_hal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
******************************************************************************
33
* @file stm32f1xx_hal.h
44
* @author MCD Application Team
5-
* @version V1.0.4
6-
* @date 29-April-2016
5+
* @version V1.0.5
6+
* @date 06-December-2016
77
* @brief This file contains all the functions prototypes for the HAL
88
* module driver.
99
******************************************************************************

targets/TARGET_STM/TARGET_STM32F1/device/stm32f1xx_hal_adc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
******************************************************************************
33
* @file stm32f1xx_hal_adc.c
44
* @author MCD Application Team
5-
* @version V1.0.4
6-
* @date 29-April-2016
5+
* @version V1.0.5
6+
* @date 06-December-2016
77
* @brief This file provides firmware functions to manage the following
88
* functionalities of the Analog to Digital Convertor (ADC)
99
* peripheral:

targets/TARGET_STM/TARGET_STM32F1/device/stm32f1xx_hal_adc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
******************************************************************************
33
* @file stm32f1xx_hal_adc.h
44
* @author MCD Application Team
5-
* @version V1.0.4
6-
* @date 29-April-2016
5+
* @version V1.0.5
6+
* @date 06-December-2016
77
* @brief Header file containing functions prototypes of ADC HAL library.
88
******************************************************************************
99
* @attention

targets/TARGET_STM/TARGET_STM32F1/device/stm32f1xx_hal_adc_ex.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
******************************************************************************
33
* @file stm32f1xx_hal_adc_ex.c
44
* @author MCD Application Team
5-
* @version V1.0.4
6-
* @date 29-April-2016
5+
* @version V1.0.5
6+
* @date 06-December-2016
77
* @brief This file provides firmware functions to manage the following
88
* functionalities of the Analog to Digital Convertor (ADC)
99
* peripheral:

targets/TARGET_STM/TARGET_STM32F1/device/stm32f1xx_hal_adc_ex.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
******************************************************************************
33
* @file stm32f1xx_hal_adc_ex.h
44
* @author MCD Application Team
5-
* @version V1.0.4
6-
* @date 29-April-2016
5+
* @version V1.0.5
6+
* @date 06-December-2016
77
* @brief Header file of ADC HAL extension module.
88
******************************************************************************
99
* @attention

0 commit comments

Comments
 (0)