Skip to content

Dev stm i2c f1 #3442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ struct analogin_s {
uint8_t channel;
};

struct i2c_s {
I2CName i2c;
uint32_t slave;
};

struct can_s {
CANName can;
int index;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ struct analogin_s {
uint8_t channel;
};

struct i2c_s {
I2CName i2c;
uint32_t slave;
};

#include "common_objects.h"
#include "gpio_object.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ struct analogin_s {
uint8_t channel;
};

struct i2c_s {
I2CName i2c;
uint32_t slave;
};

struct can_s {
CANName can;
int index;
Expand Down
28 changes: 28 additions & 0 deletions targets/TARGET_STM/TARGET_STM32F1/common_objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,34 @@ struct spi_s {
#endif
};

struct i2c_s {
/* The 1st 2 members I2CName i2c
* and I2C_HandleTypeDef handle should
* be kept as the first members of this struct
* to ensure i2c_get_obj to work as expected
*/
I2CName i2c;
I2C_HandleTypeDef handle;
uint8_t index;
int hz;
PinName sda;
PinName scl;
IRQn_Type event_i2cIRQ;
IRQn_Type error_i2cIRQ;
uint32_t XferOperation;
volatile uint8_t event;
#if DEVICE_I2CSLAVE
uint8_t slave;
volatile uint8_t pending_slave_tx_master_rx;
volatile uint8_t pending_slave_rx_maxter_tx;
#endif
#if DEVICE_I2C_ASYNCH
uint32_t address;
uint8_t stop;
uint8_t available_events;
#endif
};

#include "gpio_object.h"

#ifdef __cplusplus
Expand Down

Large diffs are not rendered by default.

75 changes: 75 additions & 0 deletions targets/TARGET_STM/TARGET_STM32F1/device/stm32_assert_template.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/**
******************************************************************************
* @file stm32_assert.h
* @author MCD Application Team
* @version $VERSION$
* @date $DATE$
* @brief STM32 assert template file.
* This file should be copied to the application folder and renamed
* to stm32_assert.h.
******************************************************************************
* @attention
*
* <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32_ASSERT_H
#define __STM32_ASSERT_H

#ifdef __cplusplus
extern "C" {
#endif

/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* Includes ------------------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
#ifdef USE_FULL_ASSERT
/**
* @brief The assert_param macro is used for function's parameters check.
* @param expr: If expr is false, it calls assert_failed function
* which reports the name of the source file and the source
* line number of the call that failed.
* If expr is true, it returns no value.
* @retval None
*/
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
/* Exported functions ------------------------------------------------------- */
void assert_failed(uint8_t* file, uint32_t line);
#else
#define assert_param(expr) ((void)0U)
#endif /* USE_FULL_ASSERT */

#ifdef __cplusplus
}
#endif

#endif /* __STM32_ASSERT_H */


/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
6 changes: 3 additions & 3 deletions targets/TARGET_STM/TARGET_STM32F1/device/stm32f1xx_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f1xx_hal.c
* @author MCD Application Team
* @version V1.0.4
* @date 29-April-2016
* @version V1.0.5
* @date 06-December-2016
* @brief HAL module driver.
* This is the common part of the HAL initialization
*
Expand Down Expand Up @@ -76,7 +76,7 @@
*/
#define __STM32F1xx_HAL_VERSION_MAIN (0x01) /*!< [31:24] main version */
#define __STM32F1xx_HAL_VERSION_SUB1 (0x00) /*!< [23:16] sub1 version */
#define __STM32F1xx_HAL_VERSION_SUB2 (0x04) /*!< [15:8] sub2 version */
#define __STM32F1xx_HAL_VERSION_SUB2 (0x05) /*!< [15:8] sub2 version */
#define __STM32F1xx_HAL_VERSION_RC (0x00) /*!< [7:0] release candidate */
#define __STM32F1xx_HAL_VERSION ((__STM32F1xx_HAL_VERSION_MAIN << 24)\
|(__STM32F1xx_HAL_VERSION_SUB1 << 16)\
Expand Down
4 changes: 2 additions & 2 deletions targets/TARGET_STM/TARGET_STM32F1/device/stm32f1xx_hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f1xx_hal.h
* @author MCD Application Team
* @version V1.0.4
* @date 29-April-2016
* @version V1.0.5
* @date 06-December-2016
* @brief This file contains all the functions prototypes for the HAL
* module driver.
******************************************************************************
Expand Down
4 changes: 2 additions & 2 deletions targets/TARGET_STM/TARGET_STM32F1/device/stm32f1xx_hal_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f1xx_hal_adc.c
* @author MCD Application Team
* @version V1.0.4
* @date 29-April-2016
* @version V1.0.5
* @date 06-December-2016
* @brief This file provides firmware functions to manage the following
* functionalities of the Analog to Digital Convertor (ADC)
* peripheral:
Expand Down
4 changes: 2 additions & 2 deletions targets/TARGET_STM/TARGET_STM32F1/device/stm32f1xx_hal_adc.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f1xx_hal_adc.h
* @author MCD Application Team
* @version V1.0.4
* @date 29-April-2016
* @version V1.0.5
* @date 06-December-2016
* @brief Header file containing functions prototypes of ADC HAL library.
******************************************************************************
* @attention
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f1xx_hal_adc_ex.c
* @author MCD Application Team
* @version V1.0.4
* @date 29-April-2016
* @version V1.0.5
* @date 06-December-2016
* @brief This file provides firmware functions to manage the following
* functionalities of the Analog to Digital Convertor (ADC)
* peripheral:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f1xx_hal_adc_ex.h
* @author MCD Application Team
* @version V1.0.4
* @date 29-April-2016
* @version V1.0.5
* @date 06-December-2016
* @brief Header file of ADC HAL extension module.
******************************************************************************
* @attention
Expand Down
Loading