Move to latest HAL release trying to get I2C DMA to be more reliable, and known good point.
Cleans up some redundant calls as well to make some flash room.
This commit is contained in:
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32_assert.h
|
* @file stm32_assert.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief STM32 assert template file.
|
* @brief STM32 assert template file.
|
||||||
* This file should be copied to the application folder and renamed
|
* This file should be copied to the application folder and renamed
|
||||||
* to stm32_assert.h.
|
* to stm32_assert.h.
|
||||||
@@ -42,7 +40,7 @@
|
|||||||
#define __STM32_ASSERT_H
|
#define __STM32_ASSERT_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Exported types ------------------------------------------------------------*/
|
/* Exported types ------------------------------------------------------------*/
|
||||||
@@ -58,11 +56,11 @@
|
|||||||
* If expr is true, it returns no value.
|
* If expr is true, it returns no value.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
|
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
|
||||||
/* Exported functions ------------------------------------------------------- */
|
/* Exported functions ------------------------------------------------------- */
|
||||||
void assert_failed(uint8_t* file, uint32_t line);
|
void assert_failed(uint8_t *file, uint32_t line);
|
||||||
#else
|
#else
|
||||||
#define assert_param(expr) ((void)0U)
|
#define assert_param(expr) ((void)0U)
|
||||||
#endif /* USE_FULL_ASSERT */
|
#endif /* USE_FULL_ASSERT */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal.h
|
* @file stm32f1xx_hal.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief This file contains all the functions prototypes for the HAL
|
* @brief This file contains all the functions prototypes for the HAL
|
||||||
* module driver.
|
* module driver.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
@@ -41,7 +39,7 @@
|
|||||||
#define __STM32F1xx_HAL_H
|
#define __STM32F1xx_HAL_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
@@ -55,9 +53,32 @@
|
|||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Exported types ------------------------------------------------------------*/
|
|
||||||
/* Exported constants --------------------------------------------------------*/
|
/* Exported constants --------------------------------------------------------*/
|
||||||
|
|
||||||
|
/** @defgroup HAL_Exported_Constants HAL Exported Constants
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup HAL_TICK_FREQ Tick Frequency
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
HAL_TICK_FREQ_10HZ = 100U,
|
||||||
|
HAL_TICK_FREQ_100HZ = 10U,
|
||||||
|
HAL_TICK_FREQ_1KHZ = 1U,
|
||||||
|
HAL_TICK_FREQ_DEFAULT = HAL_TICK_FREQ_1KHZ
|
||||||
|
} HAL_TickFreqTypeDef;
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
extern uint32_t uwTickPrio;
|
||||||
|
extern HAL_TickFreqTypeDef uwTickFreq;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
/* Exported macro ------------------------------------------------------------*/
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
/** @defgroup HAL_Exported_Macros HAL Exported Macros
|
/** @defgroup HAL_Exported_Macros HAL Exported Macros
|
||||||
* @{
|
* @{
|
||||||
@@ -256,6 +277,12 @@
|
|||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/** @defgroup HAL_Private_Macros HAL Private Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define IS_TICKFREQ(FREQ) (((FREQ) == HAL_TICK_FREQ_10HZ) || \
|
||||||
|
((FREQ) == HAL_TICK_FREQ_100HZ) || \
|
||||||
|
((FREQ) == HAL_TICK_FREQ_1KHZ))
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
@@ -272,7 +299,7 @@ HAL_StatusTypeDef HAL_Init(void);
|
|||||||
HAL_StatusTypeDef HAL_DeInit(void);
|
HAL_StatusTypeDef HAL_DeInit(void);
|
||||||
void HAL_MspInit(void);
|
void HAL_MspInit(void);
|
||||||
void HAL_MspDeInit(void);
|
void HAL_MspDeInit(void);
|
||||||
HAL_StatusTypeDef HAL_InitTick (uint32_t TickPriority);
|
HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority);
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
@@ -282,8 +309,11 @@ HAL_StatusTypeDef HAL_InitTick (uint32_t TickPriority);
|
|||||||
*/
|
*/
|
||||||
/* Peripheral Control functions ************************************************/
|
/* Peripheral Control functions ************************************************/
|
||||||
void HAL_IncTick(void);
|
void HAL_IncTick(void);
|
||||||
void HAL_Delay(__IO uint32_t Delay);
|
void HAL_Delay(uint32_t Delay);
|
||||||
uint32_t HAL_GetTick(void);
|
uint32_t HAL_GetTick(void);
|
||||||
|
uint32_t HAL_GetTickPrio(void);
|
||||||
|
HAL_StatusTypeDef HAL_SetTickFreq(HAL_TickFreqTypeDef Freq);
|
||||||
|
HAL_TickFreqTypeDef HAL_GetTickFreq(void);
|
||||||
void HAL_SuspendTick(void);
|
void HAL_SuspendTick(void);
|
||||||
void HAL_ResumeTick(void);
|
void HAL_ResumeTick(void);
|
||||||
uint32_t HAL_GetHalVersion(void);
|
uint32_t HAL_GetHalVersion(void);
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_adc.h
|
* @file stm32f1xx_hal_adc.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file containing functions prototypes of ADC HAL library.
|
* @brief Header file containing functions prototypes of ADC HAL library.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_adc_ex.h
|
* @file stm32f1xx_hal_adc_ex.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of ADC HAL extension module.
|
* @brief Header file of ADC HAL extension module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_cec.h
|
* @file stm32f1xx_hal_cec.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of CEC HAL module.
|
* @brief Header file of CEC HAL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
386
workspace/TS100/HAL_Driver/Inc/stm32f1xx_hal_conf_template.h
Normal file
386
workspace/TS100/HAL_Driver/Inc/stm32f1xx_hal_conf_template.h
Normal file
@@ -0,0 +1,386 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file stm32f1xx_hal_conf.h
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief HAL configuration template file.
|
||||||
|
* This file should be copied to the application folder and renamed
|
||||||
|
* to stm32f1xx_hal_conf.h.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* <h2><center>© COPYRIGHT(c) 2017 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 __STM32F1xx_HAL_CONF_H
|
||||||
|
#define __STM32F1xx_HAL_CONF_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
/* Exported constants --------------------------------------------------------*/
|
||||||
|
|
||||||
|
/* ########################## Module Selection ############################## */
|
||||||
|
/**
|
||||||
|
* @brief This is the list of modules to be used in the HAL driver
|
||||||
|
*/
|
||||||
|
#define HAL_MODULE_ENABLED
|
||||||
|
#define HAL_ADC_MODULE_ENABLED
|
||||||
|
#define HAL_CAN_MODULE_ENABLED
|
||||||
|
/* #define HAL_CAN_LEGACY_MODULE_ENABLED */
|
||||||
|
#define HAL_CEC_MODULE_ENABLED
|
||||||
|
#define HAL_CORTEX_MODULE_ENABLED
|
||||||
|
#define HAL_CRC_MODULE_ENABLED
|
||||||
|
#define HAL_DAC_MODULE_ENABLED
|
||||||
|
#define HAL_DMA_MODULE_ENABLED
|
||||||
|
#define HAL_ETH_MODULE_ENABLED
|
||||||
|
#define HAL_FLASH_MODULE_ENABLED
|
||||||
|
#define HAL_GPIO_MODULE_ENABLED
|
||||||
|
#define HAL_HCD_MODULE_ENABLED
|
||||||
|
#define HAL_I2C_MODULE_ENABLED
|
||||||
|
#define HAL_I2S_MODULE_ENABLED
|
||||||
|
#define HAL_IRDA_MODULE_ENABLED
|
||||||
|
#define HAL_IWDG_MODULE_ENABLED
|
||||||
|
#define HAL_NAND_MODULE_ENABLED
|
||||||
|
#define HAL_NOR_MODULE_ENABLED
|
||||||
|
#define HAL_PCCARD_MODULE_ENABLED
|
||||||
|
#define HAL_PCD_MODULE_ENABLED
|
||||||
|
#define HAL_PWR_MODULE_ENABLED
|
||||||
|
#define HAL_RCC_MODULE_ENABLED
|
||||||
|
#define HAL_RTC_MODULE_ENABLED
|
||||||
|
#define HAL_SD_MODULE_ENABLED
|
||||||
|
#define HAL_SMARTCARD_MODULE_ENABLED
|
||||||
|
#define HAL_SPI_MODULE_ENABLED
|
||||||
|
#define HAL_SRAM_MODULE_ENABLED
|
||||||
|
#define HAL_TIM_MODULE_ENABLED
|
||||||
|
#define HAL_UART_MODULE_ENABLED
|
||||||
|
#define HAL_USART_MODULE_ENABLED
|
||||||
|
#define HAL_WWDG_MODULE_ENABLED
|
||||||
|
#define HAL_MMC_MODULE_ENABLED
|
||||||
|
|
||||||
|
/* ########################## Oscillator Values adaptation ####################*/
|
||||||
|
/**
|
||||||
|
* @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
|
||||||
|
* This value is used by the RCC HAL module to compute the system frequency
|
||||||
|
* (when HSE is used as system clock source, directly or through the PLL).
|
||||||
|
*/
|
||||||
|
#if !defined (HSE_VALUE)
|
||||||
|
#if defined(USE_STM3210C_EVAL)
|
||||||
|
#define HSE_VALUE 25000000U /*!< Value of the External oscillator in Hz */
|
||||||
|
#else
|
||||||
|
#define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */
|
||||||
|
#endif
|
||||||
|
#endif /* HSE_VALUE */
|
||||||
|
|
||||||
|
#if !defined (HSE_STARTUP_TIMEOUT)
|
||||||
|
#define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */
|
||||||
|
#endif /* HSE_STARTUP_TIMEOUT */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Internal High Speed oscillator (HSI) value.
|
||||||
|
* This value is used by the RCC HAL module to compute the system frequency
|
||||||
|
* (when HSI is used as system clock source, directly or through the PLL).
|
||||||
|
*/
|
||||||
|
#if !defined (HSI_VALUE)
|
||||||
|
#define HSI_VALUE 8000000U /*!< Value of the Internal oscillator in Hz */
|
||||||
|
#endif /* HSI_VALUE */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Internal Low Speed oscillator (LSI) value.
|
||||||
|
*/
|
||||||
|
#if !defined (LSI_VALUE)
|
||||||
|
#define LSI_VALUE 32000U /*!< LSI Typical Value in Hz */
|
||||||
|
#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
|
||||||
|
The real value may vary depending on the variations
|
||||||
|
in voltage and temperature. */
|
||||||
|
/**
|
||||||
|
* @brief External Low Speed oscillator (LSE) value.
|
||||||
|
* This value is used by the UART, RTC HAL module to compute the system frequency
|
||||||
|
*/
|
||||||
|
#if !defined (LSE_VALUE)
|
||||||
|
#define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */
|
||||||
|
#endif /* LSE_VALUE */
|
||||||
|
|
||||||
|
#if !defined (LSE_STARTUP_TIMEOUT)
|
||||||
|
#define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */
|
||||||
|
#endif /* LSE_STARTUP_TIMEOUT */
|
||||||
|
|
||||||
|
/* Tip: To avoid modifying this file each time you need to use different HSE,
|
||||||
|
=== you can define the HSE value in your toolchain compiler preprocessor. */
|
||||||
|
|
||||||
|
/* ########################### System Configuration ######################### */
|
||||||
|
/**
|
||||||
|
* @brief This is the HAL system configuration section
|
||||||
|
*/
|
||||||
|
#define VDD_VALUE 3300U /*!< Value of VDD in mv */
|
||||||
|
#define TICK_INT_PRIORITY 0x0FU /*!< tick interrupt priority */
|
||||||
|
#define USE_RTOS 0U
|
||||||
|
#define PREFETCH_ENABLE 1U
|
||||||
|
|
||||||
|
/* ########################## Assert Selection ############################## */
|
||||||
|
/**
|
||||||
|
* @brief Uncomment the line below to expanse the "assert_param" macro in the
|
||||||
|
* HAL drivers code
|
||||||
|
*/
|
||||||
|
/* #define USE_FULL_ASSERT 1U */
|
||||||
|
|
||||||
|
/* ################## Ethernet peripheral configuration ##################### */
|
||||||
|
|
||||||
|
/* Section 1 : Ethernet peripheral configuration */
|
||||||
|
|
||||||
|
/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */
|
||||||
|
#define MAC_ADDR0 2U
|
||||||
|
#define MAC_ADDR1 0U
|
||||||
|
#define MAC_ADDR2 0U
|
||||||
|
#define MAC_ADDR3 0U
|
||||||
|
#define MAC_ADDR4 0U
|
||||||
|
#define MAC_ADDR5 0U
|
||||||
|
|
||||||
|
/* Definition of the Ethernet driver buffers size and count */
|
||||||
|
#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
|
||||||
|
#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
|
||||||
|
#define ETH_RXBUFNB 8U /* 8 Rx buffers of size ETH_RX_BUF_SIZE */
|
||||||
|
#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */
|
||||||
|
|
||||||
|
/* Section 2: PHY configuration section */
|
||||||
|
|
||||||
|
/* DP83848 PHY Address*/
|
||||||
|
#define DP83848_PHY_ADDRESS 0x01U
|
||||||
|
/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
|
||||||
|
#define PHY_RESET_DELAY 0x000000FFU
|
||||||
|
/* PHY Configuration delay */
|
||||||
|
#define PHY_CONFIG_DELAY 0x00000FFFU
|
||||||
|
|
||||||
|
#define PHY_READ_TO 0x0000FFFFU
|
||||||
|
#define PHY_WRITE_TO 0x0000FFFFU
|
||||||
|
|
||||||
|
/* Section 3: Common PHY Registers */
|
||||||
|
|
||||||
|
#define PHY_BCR ((uint16_t)0x0000) /*!< Transceiver Basic Control Register */
|
||||||
|
#define PHY_BSR ((uint16_t)0x0001) /*!< Transceiver Basic Status Register */
|
||||||
|
|
||||||
|
#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */
|
||||||
|
#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */
|
||||||
|
#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */
|
||||||
|
#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */
|
||||||
|
#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */
|
||||||
|
#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */
|
||||||
|
#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */
|
||||||
|
#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */
|
||||||
|
#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */
|
||||||
|
#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */
|
||||||
|
|
||||||
|
#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */
|
||||||
|
#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */
|
||||||
|
#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */
|
||||||
|
|
||||||
|
/* Section 4: Extended PHY Registers */
|
||||||
|
|
||||||
|
#define PHY_SR ((uint16_t)0x0010) /*!< PHY status register Offset */
|
||||||
|
#define PHY_MICR ((uint16_t)0x0011) /*!< MII Interrupt Control Register */
|
||||||
|
#define PHY_MISR ((uint16_t)0x0012) /*!< MII Interrupt Status and Misc. Control Register */
|
||||||
|
|
||||||
|
#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */
|
||||||
|
#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */
|
||||||
|
#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */
|
||||||
|
|
||||||
|
#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */
|
||||||
|
#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */
|
||||||
|
|
||||||
|
#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */
|
||||||
|
#define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */
|
||||||
|
|
||||||
|
/* ################## SPI peripheral configuration ########################## */
|
||||||
|
|
||||||
|
/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
|
||||||
|
* Activated: CRC code is present inside driver
|
||||||
|
* Deactivated: CRC code cleaned from driver
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define USE_SPI_CRC 1U
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
/**
|
||||||
|
* @brief Include module's header file
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef HAL_RCC_MODULE_ENABLED
|
||||||
|
#include "stm32f1xx_hal_rcc.h"
|
||||||
|
#endif /* HAL_RCC_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_GPIO_MODULE_ENABLED
|
||||||
|
#include "stm32f1xx_hal_gpio.h"
|
||||||
|
#endif /* HAL_GPIO_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_DMA_MODULE_ENABLED
|
||||||
|
#include "stm32f1xx_hal_dma.h"
|
||||||
|
#endif /* HAL_DMA_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_ETH_MODULE_ENABLED
|
||||||
|
#include "stm32f1xx_hal_eth.h"
|
||||||
|
#endif /* HAL_ETH_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_CAN_MODULE_ENABLED
|
||||||
|
#include "stm32f1xx_hal_can.h"
|
||||||
|
#endif /* HAL_CAN_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_CAN_LEGACY_MODULE_ENABLED
|
||||||
|
#include "Legacy/stm32f1xx_hal_can_legacy.h"
|
||||||
|
#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_CEC_MODULE_ENABLED
|
||||||
|
#include "stm32f1xx_hal_cec.h"
|
||||||
|
#endif /* HAL_CEC_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_CORTEX_MODULE_ENABLED
|
||||||
|
#include "stm32f1xx_hal_cortex.h"
|
||||||
|
#endif /* HAL_CORTEX_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_ADC_MODULE_ENABLED
|
||||||
|
#include "stm32f1xx_hal_adc.h"
|
||||||
|
#endif /* HAL_ADC_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_CRC_MODULE_ENABLED
|
||||||
|
#include "stm32f1xx_hal_crc.h"
|
||||||
|
#endif /* HAL_CRC_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_DAC_MODULE_ENABLED
|
||||||
|
#include "stm32f1xx_hal_dac.h"
|
||||||
|
#endif /* HAL_DAC_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_FLASH_MODULE_ENABLED
|
||||||
|
#include "stm32f1xx_hal_flash.h"
|
||||||
|
#endif /* HAL_FLASH_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_SRAM_MODULE_ENABLED
|
||||||
|
#include "stm32f1xx_hal_sram.h"
|
||||||
|
#endif /* HAL_SRAM_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_NOR_MODULE_ENABLED
|
||||||
|
#include "stm32f1xx_hal_nor.h"
|
||||||
|
#endif /* HAL_NOR_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_I2C_MODULE_ENABLED
|
||||||
|
#include "stm32f1xx_hal_i2c.h"
|
||||||
|
#endif /* HAL_I2C_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_I2S_MODULE_ENABLED
|
||||||
|
#include "stm32f1xx_hal_i2s.h"
|
||||||
|
#endif /* HAL_I2S_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_IWDG_MODULE_ENABLED
|
||||||
|
#include "stm32f1xx_hal_iwdg.h"
|
||||||
|
#endif /* HAL_IWDG_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_PWR_MODULE_ENABLED
|
||||||
|
#include "stm32f1xx_hal_pwr.h"
|
||||||
|
#endif /* HAL_PWR_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_RTC_MODULE_ENABLED
|
||||||
|
#include "stm32f1xx_hal_rtc.h"
|
||||||
|
#endif /* HAL_RTC_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_PCCARD_MODULE_ENABLED
|
||||||
|
#include "stm32f1xx_hal_pccard.h"
|
||||||
|
#endif /* HAL_PCCARD_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_SD_MODULE_ENABLED
|
||||||
|
#include "stm32f1xx_hal_sd.h"
|
||||||
|
#endif /* HAL_SD_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_NAND_MODULE_ENABLED
|
||||||
|
#include "stm32f1xx_hal_nand.h"
|
||||||
|
#endif /* HAL_NAND_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_SPI_MODULE_ENABLED
|
||||||
|
#include "stm32f1xx_hal_spi.h"
|
||||||
|
#endif /* HAL_SPI_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_TIM_MODULE_ENABLED
|
||||||
|
#include "stm32f1xx_hal_tim.h"
|
||||||
|
#endif /* HAL_TIM_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_UART_MODULE_ENABLED
|
||||||
|
#include "stm32f1xx_hal_uart.h"
|
||||||
|
#endif /* HAL_UART_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_USART_MODULE_ENABLED
|
||||||
|
#include "stm32f1xx_hal_usart.h"
|
||||||
|
#endif /* HAL_USART_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_IRDA_MODULE_ENABLED
|
||||||
|
#include "stm32f1xx_hal_irda.h"
|
||||||
|
#endif /* HAL_IRDA_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_SMARTCARD_MODULE_ENABLED
|
||||||
|
#include "stm32f1xx_hal_smartcard.h"
|
||||||
|
#endif /* HAL_SMARTCARD_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_WWDG_MODULE_ENABLED
|
||||||
|
#include "stm32f1xx_hal_wwdg.h"
|
||||||
|
#endif /* HAL_WWDG_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_PCD_MODULE_ENABLED
|
||||||
|
#include "stm32f1xx_hal_pcd.h"
|
||||||
|
#endif /* HAL_PCD_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_HCD_MODULE_ENABLED
|
||||||
|
#include "stm32f1xx_hal_hcd.h"
|
||||||
|
#endif /* HAL_HCD_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_MMC_MODULE_ENABLED
|
||||||
|
#include "stm32f1xx_hal_mmc.h"
|
||||||
|
#endif /* HAL_MMC_MODULE_ENABLED */
|
||||||
|
|
||||||
|
/* 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 /* __STM32F1xx_HAL_CONF_H */
|
||||||
|
|
||||||
|
|
||||||
|
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_cortex.h
|
* @file stm32f1xx_hal_cortex.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of CORTEX HAL module.
|
* @brief Header file of CORTEX HAL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_crc.h
|
* @file stm32f1xx_hal_crc.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of CRC HAL module.
|
* @brief Header file of CRC HAL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_dac.h
|
* @file stm32f1xx_hal_dac.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of DAC HAL module.
|
* @brief Header file of DAC HAL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_dac_ex.h
|
* @file stm32f1xx_hal_dac_ex.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of DAC HAL Extension module.
|
* @brief Header file of DAC HAL Extension module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_def.h
|
* @file stm32f1xx_hal_def.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief This file contains HAL common defines, enumeration, macros and
|
* @brief This file contains HAL common defines, enumeration, macros and
|
||||||
* structures definitions.
|
* structures definitions.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
@@ -41,7 +39,7 @@
|
|||||||
#define __STM32F1xx_HAL_DEF
|
#define __STM32F1xx_HAL_DEF
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
@@ -76,8 +74,8 @@ typedef enum
|
|||||||
/* Exported macro ------------------------------------------------------------*/
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
#define HAL_MAX_DELAY 0xFFFFFFFFU
|
#define HAL_MAX_DELAY 0xFFFFFFFFU
|
||||||
|
|
||||||
#define HAL_IS_BIT_SET(REG, BIT) (((REG) & (BIT)) != RESET)
|
#define HAL_IS_BIT_SET(REG, BIT) (((REG) & (BIT)) != 0U)
|
||||||
#define HAL_IS_BIT_CLR(REG, BIT) (((REG) & (BIT)) == RESET)
|
#define HAL_IS_BIT_CLR(REG, BIT) (((REG) & (BIT)) == 0U)
|
||||||
|
|
||||||
#define __HAL_LINKDMA(__HANDLE__, __PPP_DMA_FIELD__, __DMA_HANDLE__) \
|
#define __HAL_LINKDMA(__HANDLE__, __PPP_DMA_FIELD__, __DMA_HANDLE__) \
|
||||||
do{ \
|
do{ \
|
||||||
@@ -85,7 +83,7 @@ typedef enum
|
|||||||
(__DMA_HANDLE__).Parent = (__HANDLE__); \
|
(__DMA_HANDLE__).Parent = (__HANDLE__); \
|
||||||
} while(0U)
|
} while(0U)
|
||||||
|
|
||||||
#define UNUSED(x) ((void)(x))
|
#define UNUSED(X) (void)X /* To avoid gcc/g++ warnings */
|
||||||
|
|
||||||
/** @brief Reset the Handle's State field.
|
/** @brief Reset the Handle's State field.
|
||||||
* @param __HANDLE__: specifies the Peripheral Handle.
|
* @param __HANDLE__: specifies the Peripheral Handle.
|
||||||
@@ -105,10 +103,10 @@ typedef enum
|
|||||||
#define __HAL_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = 0U)
|
#define __HAL_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = 0U)
|
||||||
|
|
||||||
#if (USE_RTOS == 1U)
|
#if (USE_RTOS == 1U)
|
||||||
/* Reserved for future use */
|
/* Reserved for future use */
|
||||||
#error "USE_RTOS should be 0 in the current HAL release"
|
#error "USE_RTOS should be 0 in the current HAL release"
|
||||||
#else
|
#else
|
||||||
#define __HAL_LOCK(__HANDLE__) \
|
#define __HAL_LOCK(__HANDLE__) \
|
||||||
do{ \
|
do{ \
|
||||||
if((__HANDLE__)->Lock == HAL_LOCKED) \
|
if((__HANDLE__)->Lock == HAL_LOCKED) \
|
||||||
{ \
|
{ \
|
||||||
@@ -120,41 +118,41 @@ typedef enum
|
|||||||
} \
|
} \
|
||||||
}while (0U)
|
}while (0U)
|
||||||
|
|
||||||
#define __HAL_UNLOCK(__HANDLE__) \
|
#define __HAL_UNLOCK(__HANDLE__) \
|
||||||
do{ \
|
do{ \
|
||||||
(__HANDLE__)->Lock = HAL_UNLOCKED; \
|
(__HANDLE__)->Lock = HAL_UNLOCKED; \
|
||||||
}while (0U)
|
}while (0U)
|
||||||
#endif /* USE_RTOS */
|
#endif /* USE_RTOS */
|
||||||
|
|
||||||
#if defined ( __GNUC__ )
|
#if defined ( __GNUC__ ) && !defined (__CC_ARM) /* GNU Compiler */
|
||||||
#ifndef __weak
|
#ifndef __weak
|
||||||
#define __weak __attribute__((weak))
|
#define __weak __attribute__((weak))
|
||||||
#endif /* __weak */
|
#endif /* __weak */
|
||||||
#ifndef __packed
|
#ifndef __packed
|
||||||
#define __packed __attribute__((__packed__))
|
#define __packed __attribute__((__packed__))
|
||||||
#endif /* __packed */
|
#endif /* __packed */
|
||||||
#endif /* __GNUC__ */
|
#endif /* __GNUC__ */
|
||||||
|
|
||||||
|
|
||||||
/* Macro to get variable aligned on 4-bytes, for __ICCARM__ the directive "#pragma data_alignment=4" must be used instead */
|
/* Macro to get variable aligned on 4-bytes, for __ICCARM__ the directive "#pragma data_alignment=4" must be used instead */
|
||||||
#if defined (__GNUC__) /* GNU Compiler */
|
#if defined ( __GNUC__ ) && !defined (__CC_ARM) /* GNU Compiler */
|
||||||
#ifndef __ALIGN_END
|
#ifndef __ALIGN_END
|
||||||
#define __ALIGN_END __attribute__ ((aligned (4)))
|
#define __ALIGN_END __attribute__ ((aligned (4)))
|
||||||
#endif /* __ALIGN_END */
|
#endif /* __ALIGN_END */
|
||||||
#ifndef __ALIGN_BEGIN
|
#ifndef __ALIGN_BEGIN
|
||||||
#define __ALIGN_BEGIN
|
#define __ALIGN_BEGIN
|
||||||
#endif /* __ALIGN_BEGIN */
|
#endif /* __ALIGN_BEGIN */
|
||||||
#else
|
#else
|
||||||
#ifndef __ALIGN_END
|
#ifndef __ALIGN_END
|
||||||
#define __ALIGN_END
|
#define __ALIGN_END
|
||||||
#endif /* __ALIGN_END */
|
#endif /* __ALIGN_END */
|
||||||
#ifndef __ALIGN_BEGIN
|
#ifndef __ALIGN_BEGIN
|
||||||
#if defined (__CC_ARM) /* ARM Compiler */
|
#if defined (__CC_ARM) /* ARM Compiler */
|
||||||
#define __ALIGN_BEGIN __align(4)
|
#define __ALIGN_BEGIN __align(4)
|
||||||
#elif defined (__ICCARM__) /* IAR Compiler */
|
#elif defined (__ICCARM__) /* IAR Compiler */
|
||||||
#define __ALIGN_BEGIN
|
#define __ALIGN_BEGIN
|
||||||
#endif /* __CC_ARM */
|
#endif /* __CC_ARM */
|
||||||
#endif /* __ALIGN_BEGIN */
|
#endif /* __ALIGN_BEGIN */
|
||||||
#endif /* __GNUC__ */
|
#endif /* __GNUC__ */
|
||||||
|
|
||||||
|
|
||||||
@@ -171,14 +169,14 @@ typedef enum
|
|||||||
Available memory areas are declared in the 'Target' tab of the 'Options for Target'
|
Available memory areas are declared in the 'Target' tab of the 'Options for Target'
|
||||||
dialog.
|
dialog.
|
||||||
*/
|
*/
|
||||||
#define __RAM_FUNC HAL_StatusTypeDef
|
#define __RAM_FUNC
|
||||||
|
|
||||||
#elif defined ( __ICCARM__ )
|
#elif defined ( __ICCARM__ )
|
||||||
/* ICCARM Compiler
|
/* ICCARM Compiler
|
||||||
---------------
|
---------------
|
||||||
RAM functions are defined using a specific toolchain keyword "__ramfunc".
|
RAM functions are defined using a specific toolchain keyword "__ramfunc".
|
||||||
*/
|
*/
|
||||||
#define __RAM_FUNC __ramfunc HAL_StatusTypeDef
|
#define __RAM_FUNC __ramfunc
|
||||||
|
|
||||||
#elif defined ( __GNUC__ )
|
#elif defined ( __GNUC__ )
|
||||||
/* GNU Compiler
|
/* GNU Compiler
|
||||||
@@ -186,7 +184,7 @@ typedef enum
|
|||||||
RAM functions are defined using a specific toolchain attribute
|
RAM functions are defined using a specific toolchain attribute
|
||||||
"__attribute__((section(".RamFunc")))".
|
"__attribute__((section(".RamFunc")))".
|
||||||
*/
|
*/
|
||||||
#define __RAM_FUNC HAL_StatusTypeDef __attribute__((section(".RamFunc")))
|
#define __RAM_FUNC __attribute__((section(".RamFunc")))
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_dma.h
|
* @file stm32f1xx_hal_dma.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of DMA HAL module.
|
* @brief Header file of DMA HAL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_dma_ex.h
|
* @file stm32f1xx_hal_dma_ex.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of DMA HAL extension module.
|
* @brief Header file of DMA HAL extension module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_eth.h
|
* @file stm32f1xx_hal_eth.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of ETH HAL module.
|
* @brief Header file of ETH HAL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
@@ -40,7 +38,7 @@
|
|||||||
#define __STM32F1xx_HAL_ETH_H
|
#define __STM32F1xx_HAL_ETH_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
@@ -355,7 +353,7 @@
|
|||||||
|
|
||||||
/* ETHERNET Missed frames counter Shift */
|
/* ETHERNET Missed frames counter Shift */
|
||||||
#define ETH_DMA_RX_OVERFLOW_MISSEDFRAMES_COUNTERSHIFT 17U
|
#define ETH_DMA_RX_OVERFLOW_MISSEDFRAMES_COUNTERSHIFT 17U
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -379,7 +377,7 @@ typedef enum
|
|||||||
HAL_ETH_STATE_BUSY_RD = 0x82U, /*!< Read process is ongoing */
|
HAL_ETH_STATE_BUSY_RD = 0x82U, /*!< Read process is ongoing */
|
||||||
HAL_ETH_STATE_TIMEOUT = 0x03U, /*!< Timeout state */
|
HAL_ETH_STATE_TIMEOUT = 0x03U, /*!< Timeout state */
|
||||||
HAL_ETH_STATE_ERROR = 0x04U /*!< Reception process is ongoing */
|
HAL_ETH_STATE_ERROR = 0x04U /*!< Reception process is ongoing */
|
||||||
}HAL_ETH_StateTypeDef;
|
} HAL_ETH_StateTypeDef;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief ETH Init Structure definition
|
* @brief ETH Init Structure definition
|
||||||
@@ -415,7 +413,7 @@ typedef struct
|
|||||||
} ETH_InitTypeDef;
|
} ETH_InitTypeDef;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief ETH MAC Configuration Structure definition
|
* @brief ETH MAC Configuration Structure definition
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -633,7 +631,7 @@ typedef struct
|
|||||||
|
|
||||||
} ETH_HandleTypeDef;
|
} ETH_HandleTypeDef;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -654,7 +652,7 @@ typedef struct
|
|||||||
#define ETH_MAX_ETH_PAYLOAD 1500U /*!< Maximum Ethernet payload size */
|
#define ETH_MAX_ETH_PAYLOAD 1500U /*!< Maximum Ethernet payload size */
|
||||||
#define ETH_JUMBO_FRAME_PAYLOAD 9000U /*!< Jumbo frame payload size */
|
#define ETH_JUMBO_FRAME_PAYLOAD 9000U /*!< Jumbo frame payload size */
|
||||||
|
|
||||||
/* Ethernet driver receive buffers are organized in a chained linked-list, when
|
/* Ethernet driver receive buffers are organized in a chained linked-list, when
|
||||||
an ethernet packet is received, the Rx-DMA will transfer the packet from RxFIFO
|
an ethernet packet is received, the Rx-DMA will transfer the packet from RxFIFO
|
||||||
to the driver receive buffers memory.
|
to the driver receive buffers memory.
|
||||||
|
|
||||||
@@ -672,16 +670,16 @@ typedef struct
|
|||||||
/* Here we configure each Ethernet driver receive buffer to fit the Max size Ethernet
|
/* Here we configure each Ethernet driver receive buffer to fit the Max size Ethernet
|
||||||
packet */
|
packet */
|
||||||
#ifndef ETH_RX_BUF_SIZE
|
#ifndef ETH_RX_BUF_SIZE
|
||||||
#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE
|
#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* 5 Ethernet driver receive buffers are used (in a chained linked list)*/
|
/* 5 Ethernet driver receive buffers are used (in a chained linked list)*/
|
||||||
#ifndef ETH_RXBUFNB
|
#ifndef ETH_RXBUFNB
|
||||||
#define ETH_RXBUFNB 5U /* 5 Rx buffers of size ETH_RX_BUF_SIZE */
|
#define ETH_RXBUFNB 5U /* 5 Rx buffers of size ETH_RX_BUF_SIZE */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Ethernet driver transmit buffers are organized in a chained linked-list, when
|
/* Ethernet driver transmit buffers are organized in a chained linked-list, when
|
||||||
an ethernet packet is transmitted, Tx-DMA will transfer the packet from the
|
an ethernet packet is transmitted, Tx-DMA will transfer the packet from the
|
||||||
driver transmit buffers memory to the TxFIFO.
|
driver transmit buffers memory to the TxFIFO.
|
||||||
|
|
||||||
@@ -699,15 +697,15 @@ typedef struct
|
|||||||
/* Here we configure each Ethernet driver transmit buffer to fit the Max size Ethernet
|
/* Here we configure each Ethernet driver transmit buffer to fit the Max size Ethernet
|
||||||
packet */
|
packet */
|
||||||
#ifndef ETH_TX_BUF_SIZE
|
#ifndef ETH_TX_BUF_SIZE
|
||||||
#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE
|
#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* 5 ethernet driver transmit buffers are used (in a chained linked list)*/
|
/* 5 ethernet driver transmit buffers are used (in a chained linked list)*/
|
||||||
#ifndef ETH_TXBUFNB
|
#ifndef ETH_TXBUFNB
|
||||||
#define ETH_TXBUFNB 5U /* 5 Tx buffers of size ETH_TX_BUF_SIZE */
|
#define ETH_TXBUFNB 5U /* 5 Tx buffers of size ETH_TX_BUF_SIZE */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -842,7 +840,7 @@ typedef struct
|
|||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
/** @defgroup ETH_AutoNegotiation ETH AutoNegotiation
|
/** @defgroup ETH_AutoNegotiation ETH AutoNegotiation
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
#define ETH_AUTONEGOTIATION_ENABLE 0x00000001U
|
#define ETH_AUTONEGOTIATION_ENABLE 0x00000001U
|
||||||
@@ -2039,7 +2037,7 @@ HAL_StatusTypeDef HAL_ETH_Init(ETH_HandleTypeDef *heth);
|
|||||||
HAL_StatusTypeDef HAL_ETH_DeInit(ETH_HandleTypeDef *heth);
|
HAL_StatusTypeDef HAL_ETH_DeInit(ETH_HandleTypeDef *heth);
|
||||||
void HAL_ETH_MspInit(ETH_HandleTypeDef *heth);
|
void HAL_ETH_MspInit(ETH_HandleTypeDef *heth);
|
||||||
void HAL_ETH_MspDeInit(ETH_HandleTypeDef *heth);
|
void HAL_ETH_MspDeInit(ETH_HandleTypeDef *heth);
|
||||||
HAL_StatusTypeDef HAL_ETH_DMATxDescListInit(ETH_HandleTypeDef *heth, ETH_DMADescTypeDef *DMATxDescTab, uint8_t* TxBuff, uint32_t TxBuffCount);
|
HAL_StatusTypeDef HAL_ETH_DMATxDescListInit(ETH_HandleTypeDef *heth, ETH_DMADescTypeDef *DMATxDescTab, uint8_t *TxBuff, uint32_t TxBuffCount);
|
||||||
HAL_StatusTypeDef HAL_ETH_DMARxDescListInit(ETH_HandleTypeDef *heth, ETH_DMADescTypeDef *DMARxDescTab, uint8_t *RxBuff, uint32_t RxBuffCount);
|
HAL_StatusTypeDef HAL_ETH_DMARxDescListInit(ETH_HandleTypeDef *heth, ETH_DMADescTypeDef *DMARxDescTab, uint8_t *RxBuff, uint32_t RxBuffCount);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_flash.h
|
* @file stm32f1xx_hal_flash.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of Flash HAL module.
|
* @brief Header file of Flash HAL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_flash_ex.h
|
* @file stm32f1xx_hal_flash_ex.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of Flash HAL Extended module.
|
* @brief Header file of Flash HAL Extended module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_gpio.h
|
* @file stm32f1xx_hal_gpio.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of GPIO HAL module.
|
* @brief Header file of GPIO HAL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
@@ -40,7 +38,7 @@
|
|||||||
#define __STM32F1xx_HAL_GPIO_H
|
#define __STM32F1xx_HAL_GPIO_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
@@ -75,7 +73,7 @@ typedef struct
|
|||||||
|
|
||||||
uint32_t Speed; /*!< Specifies the speed for the selected pins.
|
uint32_t Speed; /*!< Specifies the speed for the selected pins.
|
||||||
This parameter can be a value of @ref GPIO_speed_define */
|
This parameter can be a value of @ref GPIO_speed_define */
|
||||||
}GPIO_InitTypeDef;
|
} GPIO_InitTypeDef;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief GPIO Bit SET and Bit RESET enumeration
|
* @brief GPIO Bit SET and Bit RESET enumeration
|
||||||
@@ -84,7 +82,7 @@ typedef enum
|
|||||||
{
|
{
|
||||||
GPIO_PIN_RESET = 0U,
|
GPIO_PIN_RESET = 0U,
|
||||||
GPIO_PIN_SET
|
GPIO_PIN_SET
|
||||||
}GPIO_PinState;
|
} GPIO_PinState;
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
@@ -164,7 +162,7 @@ typedef enum
|
|||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** @defgroup GPIO_pull_define GPIO pull define
|
/** @defgroup GPIO_pull_define GPIO pull define
|
||||||
* @brief GPIO Pull-Up or Pull-Down Activation
|
* @brief GPIO Pull-Up or Pull-Down Activation
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
@@ -249,21 +247,10 @@ void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin);
|
|||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
/* IO operation functions *****************************************************/
|
/* IO operation functions *****************************************************/
|
||||||
GPIO_PinState HAL_GPIO_ReadPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);
|
GPIO_PinState HAL_GPIO_ReadPin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin);
|
||||||
inline void HAL_GPIO_WritePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState)
|
void HAL_GPIO_WritePin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState);
|
||||||
{
|
void HAL_GPIO_TogglePin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin);
|
||||||
|
HAL_StatusTypeDef HAL_GPIO_LockPin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin);
|
||||||
if(PinState != GPIO_PIN_RESET)
|
|
||||||
{
|
|
||||||
GPIOx->BSRR = GPIO_Pin;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GPIOx->BSRR = (uint32_t)GPIO_Pin << 16U;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
void HAL_GPIO_TogglePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);
|
|
||||||
HAL_StatusTypeDef HAL_GPIO_LockPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);
|
|
||||||
void HAL_GPIO_EXTI_IRQHandler(uint16_t GPIO_Pin);
|
void HAL_GPIO_EXTI_IRQHandler(uint16_t GPIO_Pin);
|
||||||
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin);
|
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin);
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_gpio_ex.h
|
* @file stm32f1xx_hal_gpio_ex.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of GPIO HAL Extension module.
|
* @brief Header file of GPIO HAL Extension module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
@@ -40,7 +38,7 @@
|
|||||||
#define __STM32F1xx_HAL_GPIO_EX_H
|
#define __STM32F1xx_HAL_GPIO_EX_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
@@ -53,9 +51,7 @@
|
|||||||
/** @defgroup GPIOEx GPIOEx
|
/** @defgroup GPIOEx GPIOEx
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Exported types ------------------------------------------------------------*/
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
|
||||||
/* Exported constants --------------------------------------------------------*/
|
/* Exported constants --------------------------------------------------------*/
|
||||||
|
|
||||||
/** @defgroup GPIOEx_Exported_Constants GPIOEx Exported Constants
|
/** @defgroup GPIOEx_Exported_Constants GPIOEx Exported Constants
|
||||||
@@ -141,145 +137,126 @@
|
|||||||
* @note ENABLE: Remap (NSS/PA15, SCK/PB3, MISO/PB4, MOSI/PB5)
|
* @note ENABLE: Remap (NSS/PA15, SCK/PB3, MISO/PB4, MOSI/PB5)
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_SPI1_ENABLE() SET_BIT(AFIO->MAPR, AFIO_MAPR_SPI1_REMAP)
|
#define __HAL_AFIO_REMAP_SPI1_ENABLE() AFIO_REMAP_ENABLE(AFIO_MAPR_SPI1_REMAP)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Disable the remapping of SPI1 alternate function NSS, SCK, MISO and MOSI.
|
* @brief Disable the remapping of SPI1 alternate function NSS, SCK, MISO and MOSI.
|
||||||
* @note DISABLE: No remap (NSS/PA4, SCK/PA5, MISO/PA6, MOSI/PA7)
|
* @note DISABLE: No remap (NSS/PA4, SCK/PA5, MISO/PA6, MOSI/PA7)
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_SPI1_DISABLE() CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_SPI1_REMAP)
|
#define __HAL_AFIO_REMAP_SPI1_DISABLE() AFIO_REMAP_DISABLE(AFIO_MAPR_SPI1_REMAP)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Enable the remapping of I2C1 alternate function SCL and SDA.
|
* @brief Enable the remapping of I2C1 alternate function SCL and SDA.
|
||||||
* @note ENABLE: Remap (SCL/PB8, SDA/PB9)
|
* @note ENABLE: Remap (SCL/PB8, SDA/PB9)
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_I2C1_ENABLE() SET_BIT(AFIO->MAPR, AFIO_MAPR_I2C1_REMAP)
|
#define __HAL_AFIO_REMAP_I2C1_ENABLE() AFIO_REMAP_ENABLE(AFIO_MAPR_I2C1_REMAP)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Disable the remapping of I2C1 alternate function SCL and SDA.
|
* @brief Disable the remapping of I2C1 alternate function SCL and SDA.
|
||||||
* @note DISABLE: No remap (SCL/PB6, SDA/PB7)
|
* @note DISABLE: No remap (SCL/PB6, SDA/PB7)
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_I2C1_DISABLE() CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_I2C1_REMAP)
|
#define __HAL_AFIO_REMAP_I2C1_DISABLE() AFIO_REMAP_DISABLE(AFIO_MAPR_I2C1_REMAP)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Enable the remapping of USART1 alternate function TX and RX.
|
* @brief Enable the remapping of USART1 alternate function TX and RX.
|
||||||
* @note ENABLE: Remap (TX/PB6, RX/PB7)
|
* @note ENABLE: Remap (TX/PB6, RX/PB7)
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_USART1_ENABLE() SET_BIT(AFIO->MAPR, AFIO_MAPR_USART1_REMAP)
|
#define __HAL_AFIO_REMAP_USART1_ENABLE() AFIO_REMAP_ENABLE(AFIO_MAPR_USART1_REMAP)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Disable the remapping of USART1 alternate function TX and RX.
|
* @brief Disable the remapping of USART1 alternate function TX and RX.
|
||||||
* @note DISABLE: No remap (TX/PA9, RX/PA10)
|
* @note DISABLE: No remap (TX/PA9, RX/PA10)
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_USART1_DISABLE() CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_USART1_REMAP)
|
#define __HAL_AFIO_REMAP_USART1_DISABLE() AFIO_REMAP_DISABLE(AFIO_MAPR_USART1_REMAP)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Enable the remapping of USART2 alternate function CTS, RTS, CK, TX and RX.
|
* @brief Enable the remapping of USART2 alternate function CTS, RTS, CK, TX and RX.
|
||||||
* @note ENABLE: Remap (CTS/PD3, RTS/PD4, TX/PD5, RX/PD6, CK/PD7)
|
* @note ENABLE: Remap (CTS/PD3, RTS/PD4, TX/PD5, RX/PD6, CK/PD7)
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_USART2_ENABLE() SET_BIT(AFIO->MAPR, AFIO_MAPR_USART2_REMAP)
|
#define __HAL_AFIO_REMAP_USART2_ENABLE() AFIO_REMAP_ENABLE(AFIO_MAPR_USART2_REMAP)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Disable the remapping of USART2 alternate function CTS, RTS, CK, TX and RX.
|
* @brief Disable the remapping of USART2 alternate function CTS, RTS, CK, TX and RX.
|
||||||
* @note DISABLE: No remap (CTS/PA0, RTS/PA1, TX/PA2, RX/PA3, CK/PA4)
|
* @note DISABLE: No remap (CTS/PA0, RTS/PA1, TX/PA2, RX/PA3, CK/PA4)
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_USART2_DISABLE() CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_USART2_REMAP)
|
#define __HAL_AFIO_REMAP_USART2_DISABLE() AFIO_REMAP_DISABLE(AFIO_MAPR_USART2_REMAP)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Enable the remapping of USART3 alternate function CTS, RTS, CK, TX and RX.
|
* @brief Enable the remapping of USART3 alternate function CTS, RTS, CK, TX and RX.
|
||||||
* @note ENABLE: Full remap (TX/PD8, RX/PD9, CK/PD10, CTS/PD11, RTS/PD12)
|
* @note ENABLE: Full remap (TX/PD8, RX/PD9, CK/PD10, CTS/PD11, RTS/PD12)
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_USART3_ENABLE() do{ CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_USART3_REMAP); \
|
#define __HAL_AFIO_REMAP_USART3_ENABLE() AFIO_REMAP_PARTIAL(AFIO_MAPR_USART3_REMAP_FULLREMAP, AFIO_MAPR_USART3_REMAP_FULLREMAP)
|
||||||
SET_BIT(AFIO->MAPR, AFIO_MAPR_USART3_REMAP_FULLREMAP); \
|
|
||||||
}while(0U)
|
|
||||||
/**
|
/**
|
||||||
* @brief Enable the remapping of USART3 alternate function CTS, RTS, CK, TX and RX.
|
* @brief Enable the remapping of USART3 alternate function CTS, RTS, CK, TX and RX.
|
||||||
* @note PARTIAL: Partial remap (TX/PC10, RX/PC11, CK/PC12, CTS/PB13, RTS/PB14)
|
* @note PARTIAL: Partial remap (TX/PC10, RX/PC11, CK/PC12, CTS/PB13, RTS/PB14)
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_USART3_PARTIAL() do{ CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_USART3_REMAP); \
|
#define __HAL_AFIO_REMAP_USART3_PARTIAL() AFIO_REMAP_PARTIAL(AFIO_MAPR_USART3_REMAP_PARTIALREMAP, AFIO_MAPR_USART3_REMAP_FULLREMAP)
|
||||||
SET_BIT(AFIO->MAPR, AFIO_MAPR_USART3_REMAP_PARTIALREMAP); \
|
|
||||||
}while(0U)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Disable the remapping of USART3 alternate function CTS, RTS, CK, TX and RX.
|
* @brief Disable the remapping of USART3 alternate function CTS, RTS, CK, TX and RX.
|
||||||
* @note DISABLE: No remap (TX/PB10, RX/PB11, CK/PB12, CTS/PB13, RTS/PB14)
|
* @note DISABLE: No remap (TX/PB10, RX/PB11, CK/PB12, CTS/PB13, RTS/PB14)
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_USART3_DISABLE() do{ CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_USART3_REMAP); \
|
#define __HAL_AFIO_REMAP_USART3_DISABLE() AFIO_REMAP_PARTIAL(AFIO_MAPR_USART3_REMAP_NOREMAP, AFIO_MAPR_USART3_REMAP_FULLREMAP)
|
||||||
SET_BIT(AFIO->MAPR, AFIO_MAPR_USART3_REMAP_NOREMAP); \
|
|
||||||
}while(0U)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Enable the remapping of TIM1 alternate function channels 1 to 4, 1N to 3N, external trigger (ETR) and Break input (BKIN)
|
* @brief Enable the remapping of TIM1 alternate function channels 1 to 4, 1N to 3N, external trigger (ETR) and Break input (BKIN)
|
||||||
* @note ENABLE: Full remap (ETR/PE7, CH1/PE9, CH2/PE11, CH3/PE13, CH4/PE14, BKIN/PE15, CH1N/PE8, CH2N/PE10, CH3N/PE12)
|
* @note ENABLE: Full remap (ETR/PE7, CH1/PE9, CH2/PE11, CH3/PE13, CH4/PE14, BKIN/PE15, CH1N/PE8, CH2N/PE10, CH3N/PE12)
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_TIM1_ENABLE() do{ CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_TIM1_REMAP); \
|
#define __HAL_AFIO_REMAP_TIM1_ENABLE() AFIO_REMAP_PARTIAL(AFIO_MAPR_TIM1_REMAP_FULLREMAP, AFIO_MAPR_TIM1_REMAP_FULLREMAP)
|
||||||
SET_BIT(AFIO->MAPR, AFIO_MAPR_TIM1_REMAP_FULLREMAP); \
|
|
||||||
}while(0U)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Enable the remapping of TIM1 alternate function channels 1 to 4, 1N to 3N, external trigger (ETR) and Break input (BKIN)
|
* @brief Enable the remapping of TIM1 alternate function channels 1 to 4, 1N to 3N, external trigger (ETR) and Break input (BKIN)
|
||||||
* @note PARTIAL: Partial remap (ETR/PA12, CH1/PA8, CH2/PA9, CH3/PA10, CH4/PA11, BKIN/PA6, CH1N/PA7, CH2N/PB0, CH3N/PB1)
|
* @note PARTIAL: Partial remap (ETR/PA12, CH1/PA8, CH2/PA9, CH3/PA10, CH4/PA11, BKIN/PA6, CH1N/PA7, CH2N/PB0, CH3N/PB1)
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_TIM1_PARTIAL() do{ CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_TIM1_REMAP); \
|
#define __HAL_AFIO_REMAP_TIM1_PARTIAL() AFIO_REMAP_PARTIAL(AFIO_MAPR_TIM1_REMAP_PARTIALREMAP, AFIO_MAPR_TIM1_REMAP_FULLREMAP)
|
||||||
SET_BIT(AFIO->MAPR, AFIO_MAPR_TIM1_REMAP_PARTIALREMAP); \
|
|
||||||
}while(0U)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Disable the remapping of TIM1 alternate function channels 1 to 4, 1N to 3N, external trigger (ETR) and Break input (BKIN)
|
* @brief Disable the remapping of TIM1 alternate function channels 1 to 4, 1N to 3N, external trigger (ETR) and Break input (BKIN)
|
||||||
* @note DISABLE: No remap (ETR/PA12, CH1/PA8, CH2/PA9, CH3/PA10, CH4/PA11, BKIN/PB12, CH1N/PB13, CH2N/PB14, CH3N/PB15)
|
* @note DISABLE: No remap (ETR/PA12, CH1/PA8, CH2/PA9, CH3/PA10, CH4/PA11, BKIN/PB12, CH1N/PB13, CH2N/PB14, CH3N/PB15)
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_TIM1_DISABLE() do{ CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_TIM1_REMAP); \
|
#define __HAL_AFIO_REMAP_TIM1_DISABLE() AFIO_REMAP_PARTIAL(AFIO_MAPR_TIM1_REMAP_NOREMAP, AFIO_MAPR_TIM1_REMAP_FULLREMAP)
|
||||||
SET_BIT(AFIO->MAPR, AFIO_MAPR_TIM1_REMAP_NOREMAP); \
|
|
||||||
}while(0U)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Enable the remapping of TIM2 alternate function channels 1 to 4 and external trigger (ETR)
|
* @brief Enable the remapping of TIM2 alternate function channels 1 to 4 and external trigger (ETR)
|
||||||
* @note ENABLE: Full remap (CH1/ETR/PA15, CH2/PB3, CH3/PB10, CH4/PB11)
|
* @note ENABLE: Full remap (CH1/ETR/PA15, CH2/PB3, CH3/PB10, CH4/PB11)
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_TIM2_ENABLE() do{ CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_TIM2_REMAP); \
|
#define __HAL_AFIO_REMAP_TIM2_ENABLE() AFIO_REMAP_PARTIAL(AFIO_MAPR_TIM2_REMAP_FULLREMAP, AFIO_MAPR_TIM2_REMAP_FULLREMAP)
|
||||||
SET_BIT(AFIO->MAPR, AFIO_MAPR_TIM2_REMAP_FULLREMAP); \
|
|
||||||
}while(0U)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Enable the remapping of TIM2 alternate function channels 1 to 4 and external trigger (ETR)
|
* @brief Enable the remapping of TIM2 alternate function channels 1 to 4 and external trigger (ETR)
|
||||||
* @note PARTIAL_2: Partial remap (CH1/ETR/PA0, CH2/PA1, CH3/PB10, CH4/PB11)
|
* @note PARTIAL_2: Partial remap (CH1/ETR/PA0, CH2/PA1, CH3/PB10, CH4/PB11)
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_TIM2_PARTIAL_2() do{ CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_TIM2_REMAP); \
|
#define __HAL_AFIO_REMAP_TIM2_PARTIAL_2() AFIO_REMAP_PARTIAL(AFIO_MAPR_TIM2_REMAP_PARTIALREMAP2, AFIO_MAPR_TIM2_REMAP_FULLREMAP)
|
||||||
SET_BIT(AFIO->MAPR, AFIO_MAPR_TIM2_REMAP_PARTIALREMAP2); \
|
|
||||||
}while(0U)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Enable the remapping of TIM2 alternate function channels 1 to 4 and external trigger (ETR)
|
* @brief Enable the remapping of TIM2 alternate function channels 1 to 4 and external trigger (ETR)
|
||||||
* @note PARTIAL_1: Partial remap (CH1/ETR/PA15, CH2/PB3, CH3/PA2, CH4/PA3)
|
* @note PARTIAL_1: Partial remap (CH1/ETR/PA15, CH2/PB3, CH3/PA2, CH4/PA3)
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_TIM2_PARTIAL_1() do{ CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_TIM2_REMAP); \
|
#define __HAL_AFIO_REMAP_TIM2_PARTIAL_1() AFIO_REMAP_PARTIAL(AFIO_MAPR_TIM2_REMAP_PARTIALREMAP1, AFIO_MAPR_TIM2_REMAP_FULLREMAP)
|
||||||
SET_BIT(AFIO->MAPR, AFIO_MAPR_TIM2_REMAP_PARTIALREMAP1); \
|
|
||||||
}while(0U)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Disable the remapping of TIM2 alternate function channels 1 to 4 and external trigger (ETR)
|
* @brief Disable the remapping of TIM2 alternate function channels 1 to 4 and external trigger (ETR)
|
||||||
* @note DISABLE: No remap (CH1/ETR/PA0, CH2/PA1, CH3/PA2, CH4/PA3)
|
* @note DISABLE: No remap (CH1/ETR/PA0, CH2/PA1, CH3/PA2, CH4/PA3)
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_TIM2_DISABLE() do{ CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_TIM2_REMAP); \
|
#define __HAL_AFIO_REMAP_TIM2_DISABLE() AFIO_REMAP_PARTIAL(AFIO_MAPR_TIM2_REMAP_NOREMAP, AFIO_MAPR_TIM2_REMAP_FULLREMAP)
|
||||||
SET_BIT(AFIO->MAPR, AFIO_MAPR_TIM2_REMAP_NOREMAP); \
|
|
||||||
}while(0U)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Enable the remapping of TIM3 alternate function channels 1 to 4
|
* @brief Enable the remapping of TIM3 alternate function channels 1 to 4
|
||||||
@@ -287,9 +264,7 @@
|
|||||||
* @note TIM3_ETR on PE0 is not re-mapped.
|
* @note TIM3_ETR on PE0 is not re-mapped.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_TIM3_ENABLE() do{ CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_TIM3_REMAP); \
|
#define __HAL_AFIO_REMAP_TIM3_ENABLE() AFIO_REMAP_PARTIAL(AFIO_MAPR_TIM3_REMAP_FULLREMAP, AFIO_MAPR_TIM3_REMAP_FULLREMAP)
|
||||||
SET_BIT(AFIO->MAPR, AFIO_MAPR_TIM3_REMAP_FULLREMAP); \
|
|
||||||
}while(0U)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Enable the remapping of TIM3 alternate function channels 1 to 4
|
* @brief Enable the remapping of TIM3 alternate function channels 1 to 4
|
||||||
@@ -297,9 +272,7 @@
|
|||||||
* @note TIM3_ETR on PE0 is not re-mapped.
|
* @note TIM3_ETR on PE0 is not re-mapped.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_TIM3_PARTIAL() do{ CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_TIM3_REMAP); \
|
#define __HAL_AFIO_REMAP_TIM3_PARTIAL() AFIO_REMAP_PARTIAL(AFIO_MAPR_TIM3_REMAP_PARTIALREMAP, AFIO_MAPR_TIM3_REMAP_FULLREMAP)
|
||||||
SET_BIT(AFIO->MAPR, AFIO_MAPR_TIM3_REMAP_PARTIALREMAP); \
|
|
||||||
}while(0U)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Disable the remapping of TIM3 alternate function channels 1 to 4
|
* @brief Disable the remapping of TIM3 alternate function channels 1 to 4
|
||||||
@@ -307,9 +280,7 @@
|
|||||||
* @note TIM3_ETR on PE0 is not re-mapped.
|
* @note TIM3_ETR on PE0 is not re-mapped.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_TIM3_DISABLE() do{ CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_TIM3_REMAP); \
|
#define __HAL_AFIO_REMAP_TIM3_DISABLE() AFIO_REMAP_PARTIAL(AFIO_MAPR_TIM3_REMAP_NOREMAP, AFIO_MAPR_TIM3_REMAP_FULLREMAP)
|
||||||
SET_BIT(AFIO->MAPR, AFIO_MAPR_TIM3_REMAP_NOREMAP); \
|
|
||||||
}while(0U)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Enable the remapping of TIM4 alternate function channels 1 to 4.
|
* @brief Enable the remapping of TIM4 alternate function channels 1 to 4.
|
||||||
@@ -317,7 +288,7 @@
|
|||||||
* @note TIM4_ETR on PE0 is not re-mapped.
|
* @note TIM4_ETR on PE0 is not re-mapped.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_TIM4_ENABLE() SET_BIT(AFIO->MAPR, AFIO_MAPR_TIM4_REMAP)
|
#define __HAL_AFIO_REMAP_TIM4_ENABLE() AFIO_REMAP_ENABLE(AFIO_MAPR_TIM4_REMAP)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Disable the remapping of TIM4 alternate function channels 1 to 4.
|
* @brief Disable the remapping of TIM4 alternate function channels 1 to 4.
|
||||||
@@ -325,7 +296,7 @@
|
|||||||
* @note TIM4_ETR on PE0 is not re-mapped.
|
* @note TIM4_ETR on PE0 is not re-mapped.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_TIM4_DISABLE() CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_TIM4_REMAP)
|
#define __HAL_AFIO_REMAP_TIM4_DISABLE() AFIO_REMAP_DISABLE(AFIO_MAPR_TIM4_REMAP)
|
||||||
|
|
||||||
#if defined(AFIO_MAPR_CAN_REMAP_REMAP1)
|
#if defined(AFIO_MAPR_CAN_REMAP_REMAP1)
|
||||||
|
|
||||||
@@ -334,27 +305,22 @@
|
|||||||
* @note CASE 1: CAN_RX mapped to PA11, CAN_TX mapped to PA12
|
* @note CASE 1: CAN_RX mapped to PA11, CAN_TX mapped to PA12
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_CAN1_1() do{ CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_CAN_REMAP); \
|
#define __HAL_AFIO_REMAP_CAN1_1() AFIO_REMAP_PARTIAL(AFIO_MAPR_CAN_REMAP_REMAP1, AFIO_MAPR_CAN_REMAP)
|
||||||
SET_BIT(AFIO->MAPR, AFIO_MAPR_CAN_REMAP_REMAP1); \
|
|
||||||
}while(0U)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Enable or disable the remapping of CAN alternate function CAN_RX and CAN_TX in devices with a single CAN interface.
|
* @brief Enable or disable the remapping of CAN alternate function CAN_RX and CAN_TX in devices with a single CAN interface.
|
||||||
* @note CASE 2: CAN_RX mapped to PB8, CAN_TX mapped to PB9 (not available on 36-pin package)
|
* @note CASE 2: CAN_RX mapped to PB8, CAN_TX mapped to PB9 (not available on 36-pin package)
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_CAN1_2() do{ CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_CAN_REMAP); \
|
#define __HAL_AFIO_REMAP_CAN1_2() AFIO_REMAP_PARTIAL(AFIO_MAPR_CAN_REMAP_REMAP2, AFIO_MAPR_CAN_REMAP)
|
||||||
SET_BIT(AFIO->MAPR, AFIO_MAPR_CAN_REMAP_REMAP2); \
|
|
||||||
}while(0U)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Enable or disable the remapping of CAN alternate function CAN_RX and CAN_TX in devices with a single CAN interface.
|
* @brief Enable or disable the remapping of CAN alternate function CAN_RX and CAN_TX in devices with a single CAN interface.
|
||||||
* @note CASE 3: CAN_RX mapped to PD0, CAN_TX mapped to PD1
|
* @note CASE 3: CAN_RX mapped to PD0, CAN_TX mapped to PD1
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_CAN1_3() do{ CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_CAN_REMAP); \
|
#define __HAL_AFIO_REMAP_CAN1_3() AFIO_REMAP_PARTIAL(AFIO_MAPR_CAN_REMAP_REMAP3, AFIO_MAPR_CAN_REMAP)
|
||||||
SET_BIT(AFIO->MAPR, AFIO_MAPR_CAN_REMAP_REMAP3); \
|
|
||||||
}while(0U)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -365,7 +331,7 @@
|
|||||||
* @note ENABLE: PD0 remapped on OSC_IN, PD1 remapped on OSC_OUT.
|
* @note ENABLE: PD0 remapped on OSC_IN, PD1 remapped on OSC_OUT.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_PD01_ENABLE() SET_BIT(AFIO->MAPR, AFIO_MAPR_PD01_REMAP)
|
#define __HAL_AFIO_REMAP_PD01_ENABLE() AFIO_REMAP_ENABLE(AFIO_MAPR_PD01_REMAP)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Disable the remapping of PD0 and PD1. When the HSE oscillator is not used
|
* @brief Disable the remapping of PD0 and PD1. When the HSE oscillator is not used
|
||||||
@@ -375,7 +341,7 @@
|
|||||||
* @note DISABLE: No remapping of PD0 and PD1
|
* @note DISABLE: No remapping of PD0 and PD1
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_PD01_DISABLE() CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_PD01_REMAP)
|
#define __HAL_AFIO_REMAP_PD01_DISABLE() AFIO_REMAP_DISABLE(AFIO_MAPR_PD01_REMAP)
|
||||||
|
|
||||||
#if defined(AFIO_MAPR_TIM5CH4_IREMAP)
|
#if defined(AFIO_MAPR_TIM5CH4_IREMAP)
|
||||||
/**
|
/**
|
||||||
@@ -384,7 +350,7 @@
|
|||||||
* @note This function is available only in high density value line devices.
|
* @note This function is available only in high density value line devices.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_TIM5CH4_ENABLE() SET_BIT(AFIO->MAPR, AFIO_MAPR_TIM5CH4_IREMAP)
|
#define __HAL_AFIO_REMAP_TIM5CH4_ENABLE() AFIO_REMAP_ENABLE(AFIO_MAPR_TIM5CH4_IREMAP)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Disable the remapping of TIM5CH4.
|
* @brief Disable the remapping of TIM5CH4.
|
||||||
@@ -392,7 +358,7 @@
|
|||||||
* @note This function is available only in high density value line devices.
|
* @note This function is available only in high density value line devices.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_TIM5CH4_DISABLE() CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_TIM5CH4_IREMAP)
|
#define __HAL_AFIO_REMAP_TIM5CH4_DISABLE() AFIO_REMAP_DISABLE(AFIO_MAPR_TIM5CH4_IREMAP)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(AFIO_MAPR_ETH_REMAP)
|
#if defined(AFIO_MAPR_ETH_REMAP)
|
||||||
@@ -402,7 +368,7 @@
|
|||||||
* @note This bit is available only in connectivity line devices and is reserved otherwise.
|
* @note This bit is available only in connectivity line devices and is reserved otherwise.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_ETH_ENABLE() SET_BIT(AFIO->MAPR, AFIO_MAPR_ETH_REMAP)
|
#define __HAL_AFIO_REMAP_ETH_ENABLE() AFIO_REMAP_ENABLE(AFIO_MAPR_ETH_REMAP)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Disable the remapping of Ethernet MAC connections with the PHY.
|
* @brief Disable the remapping of Ethernet MAC connections with the PHY.
|
||||||
@@ -410,7 +376,7 @@
|
|||||||
* @note This bit is available only in connectivity line devices and is reserved otherwise.
|
* @note This bit is available only in connectivity line devices and is reserved otherwise.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_ETH_DISABLE() CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_ETH_REMAP)
|
#define __HAL_AFIO_REMAP_ETH_DISABLE() AFIO_REMAP_DISABLE(AFIO_MAPR_ETH_REMAP)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(AFIO_MAPR_CAN2_REMAP)
|
#if defined(AFIO_MAPR_CAN2_REMAP)
|
||||||
@@ -421,7 +387,7 @@
|
|||||||
* @note This bit is available only in connectivity line devices and is reserved otherwise.
|
* @note This bit is available only in connectivity line devices and is reserved otherwise.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_CAN2_ENABLE() SET_BIT(AFIO->MAPR, AFIO_MAPR_CAN2_REMAP)
|
#define __HAL_AFIO_REMAP_CAN2_ENABLE() AFIO_REMAP_ENABLE(AFIO_MAPR_CAN2_REMAP)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Disable the remapping of CAN2 alternate function CAN2_RX and CAN2_TX.
|
* @brief Disable the remapping of CAN2 alternate function CAN2_RX and CAN2_TX.
|
||||||
@@ -429,7 +395,7 @@
|
|||||||
* @note This bit is available only in connectivity line devices and is reserved otherwise.
|
* @note This bit is available only in connectivity line devices and is reserved otherwise.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_CAN2_DISABLE() CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_CAN2_REMAP)
|
#define __HAL_AFIO_REMAP_CAN2_DISABLE() AFIO_REMAP_DISABLE(AFIO_MAPR_CAN2_REMAP)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(AFIO_MAPR_MII_RMII_SEL)
|
#if defined(AFIO_MAPR_MII_RMII_SEL)
|
||||||
@@ -439,7 +405,7 @@
|
|||||||
* @note This bit is available only in connectivity line devices and is reserved otherwise.
|
* @note This bit is available only in connectivity line devices and is reserved otherwise.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_ETH_RMII() SET_BIT(AFIO->MAPR, AFIO_MAPR_MII_RMII_SEL)
|
#define __HAL_AFIO_ETH_RMII() AFIO_REMAP_ENABLE(AFIO_MAPR_MII_RMII_SEL)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Configures the Ethernet MAC internally for use with an external MII or RMII PHY.
|
* @brief Configures the Ethernet MAC internally for use with an external MII or RMII PHY.
|
||||||
@@ -447,7 +413,7 @@
|
|||||||
* @note This bit is available only in connectivity line devices and is reserved otherwise.
|
* @note This bit is available only in connectivity line devices and is reserved otherwise.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_ETH_MII() CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_MII_RMII_SEL)
|
#define __HAL_AFIO_ETH_MII() AFIO_REMAP_DISABLE(AFIO_MAPR_MII_RMII_SEL)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -455,28 +421,28 @@
|
|||||||
* @note ENABLE: ADC1 External Event injected conversion is connected to TIM8 Channel4.
|
* @note ENABLE: ADC1 External Event injected conversion is connected to TIM8 Channel4.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_ADC1_ETRGINJ_ENABLE() SET_BIT(AFIO->MAPR, AFIO_MAPR_ADC1_ETRGINJ_REMAP)
|
#define __HAL_AFIO_REMAP_ADC1_ETRGINJ_ENABLE() AFIO_REMAP_ENABLE(AFIO_MAPR_ADC1_ETRGINJ_REMAP)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Disable the remapping of ADC1_ETRGINJ (ADC 1 External trigger injected conversion).
|
* @brief Disable the remapping of ADC1_ETRGINJ (ADC 1 External trigger injected conversion).
|
||||||
* @note DISABLE: ADC1 External trigger injected conversion is connected to EXTI15
|
* @note DISABLE: ADC1 External trigger injected conversion is connected to EXTI15
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_ADC1_ETRGINJ_DISABLE() CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_ADC1_ETRGINJ_REMAP)
|
#define __HAL_AFIO_REMAP_ADC1_ETRGINJ_DISABLE() AFIO_REMAP_DISABLE(AFIO_MAPR_ADC1_ETRGINJ_REMAP)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Enable the remapping of ADC1_ETRGREG (ADC 1 External trigger regular conversion).
|
* @brief Enable the remapping of ADC1_ETRGREG (ADC 1 External trigger regular conversion).
|
||||||
* @note ENABLE: ADC1 External Event regular conversion is connected to TIM8 TRG0.
|
* @note ENABLE: ADC1 External Event regular conversion is connected to TIM8 TRG0.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_ADC1_ETRGREG_ENABLE() SET_BIT(AFIO->MAPR, AFIO_MAPR_ADC1_ETRGREG_REMAP)
|
#define __HAL_AFIO_REMAP_ADC1_ETRGREG_ENABLE() AFIO_REMAP_ENABLE(AFIO_MAPR_ADC1_ETRGREG_REMAP)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Disable the remapping of ADC1_ETRGREG (ADC 1 External trigger regular conversion).
|
* @brief Disable the remapping of ADC1_ETRGREG (ADC 1 External trigger regular conversion).
|
||||||
* @note DISABLE: ADC1 External trigger regular conversion is connected to EXTI11
|
* @note DISABLE: ADC1 External trigger regular conversion is connected to EXTI11
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_ADC1_ETRGREG_DISABLE() CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_ADC1_ETRGREG_REMAP)
|
#define __HAL_AFIO_REMAP_ADC1_ETRGREG_DISABLE() AFIO_REMAP_DISABLE(AFIO_MAPR_ADC1_ETRGREG_REMAP)
|
||||||
|
|
||||||
#if defined(AFIO_MAPR_ADC2_ETRGINJ_REMAP)
|
#if defined(AFIO_MAPR_ADC2_ETRGINJ_REMAP)
|
||||||
|
|
||||||
@@ -485,14 +451,14 @@
|
|||||||
* @note ENABLE: ADC2 External Event injected conversion is connected to TIM8 Channel4.
|
* @note ENABLE: ADC2 External Event injected conversion is connected to TIM8 Channel4.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_ADC2_ETRGINJ_ENABLE() SET_BIT(AFIO->MAPR, AFIO_MAPR_ADC2_ETRGINJ_REMAP)
|
#define __HAL_AFIO_REMAP_ADC2_ETRGINJ_ENABLE() AFIO_REMAP_ENABLE(AFIO_MAPR_ADC2_ETRGINJ_REMAP)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Disable the remapping of ADC2_ETRGREG (ADC 2 External trigger injected conversion).
|
* @brief Disable the remapping of ADC2_ETRGREG (ADC 2 External trigger injected conversion).
|
||||||
* @note DISABLE: ADC2 External trigger injected conversion is connected to EXTI15
|
* @note DISABLE: ADC2 External trigger injected conversion is connected to EXTI15
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_ADC2_ETRGINJ_DISABLE() CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_ADC2_ETRGINJ_REMAP)
|
#define __HAL_AFIO_REMAP_ADC2_ETRGINJ_DISABLE() AFIO_REMAP_DISABLE(AFIO_MAPR_ADC2_ETRGINJ_REMAP)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined (AFIO_MAPR_ADC2_ETRGREG_REMAP)
|
#if defined (AFIO_MAPR_ADC2_ETRGREG_REMAP)
|
||||||
@@ -502,14 +468,14 @@
|
|||||||
* @note ENABLE: ADC2 External Event regular conversion is connected to TIM8 TRG0.
|
* @note ENABLE: ADC2 External Event regular conversion is connected to TIM8 TRG0.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_ADC2_ETRGREG_ENABLE() SET_BIT(AFIO->MAPR, AFIO_MAPR_ADC2_ETRGREG_REMAP)
|
#define __HAL_AFIO_REMAP_ADC2_ETRGREG_ENABLE() AFIO_REMAP_ENABLE(AFIO_MAPR_ADC2_ETRGREG_REMAP)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Disable the remapping of ADC2_ETRGREG (ADC 2 External trigger regular conversion).
|
* @brief Disable the remapping of ADC2_ETRGREG (ADC 2 External trigger regular conversion).
|
||||||
* @note DISABLE: ADC2 External trigger regular conversion is connected to EXTI11
|
* @note DISABLE: ADC2 External trigger regular conversion is connected to EXTI11
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_ADC2_ETRGREG_DISABLE() CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_ADC2_ETRGREG_REMAP)
|
#define __HAL_AFIO_REMAP_ADC2_ETRGREG_DISABLE() AFIO_REMAP_DISABLE(AFIO_MAPR_ADC2_ETRGREG_REMAP)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -517,36 +483,29 @@
|
|||||||
* @note ENABLE: Full SWJ (JTAG-DP + SW-DP): Reset State
|
* @note ENABLE: Full SWJ (JTAG-DP + SW-DP): Reset State
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_SWJ_ENABLE() do{ CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_SWJ_CFG); \
|
#define __HAL_AFIO_REMAP_SWJ_ENABLE() AFIO_DBGAFR_CONFIG(AFIO_MAPR_SWJ_CFG_RESET)
|
||||||
SET_BIT(AFIO->MAPR, AFIO_MAPR_SWJ_CFG_RESET); \
|
|
||||||
}while(0U)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Enable the Serial wire JTAG configuration
|
* @brief Enable the Serial wire JTAG configuration
|
||||||
* @note NONJTRST: Full SWJ (JTAG-DP + SW-DP) but without NJTRST
|
* @note NONJTRST: Full SWJ (JTAG-DP + SW-DP) but without NJTRST
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_SWJ_NONJTRST() do{ CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_SWJ_CFG); \
|
#define __HAL_AFIO_REMAP_SWJ_NONJTRST() AFIO_DBGAFR_CONFIG(AFIO_MAPR_SWJ_CFG_NOJNTRST)
|
||||||
SET_BIT(AFIO->MAPR, AFIO_MAPR_SWJ_CFG_NOJNTRST); \
|
|
||||||
}while(0U)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Enable the Serial wire JTAG configuration
|
* @brief Enable the Serial wire JTAG configuration
|
||||||
* @note NOJTAG: JTAG-DP Disabled and SW-DP Enabled
|
* @note NOJTAG: JTAG-DP Disabled and SW-DP Enabled
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_SWJ_NOJTAG() do{ CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_SWJ_CFG); \
|
|
||||||
SET_BIT(AFIO->MAPR, AFIO_MAPR_SWJ_CFG_JTAGDISABLE); \
|
#define __HAL_AFIO_REMAP_SWJ_NOJTAG() AFIO_DBGAFR_CONFIG(AFIO_MAPR_SWJ_CFG_JTAGDISABLE)
|
||||||
}while(0U)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Disable the Serial wire JTAG configuration
|
* @brief Disable the Serial wire JTAG configuration
|
||||||
* @note DISABLE: JTAG-DP Disabled and SW-DP Disabled
|
* @note DISABLE: JTAG-DP Disabled and SW-DP Disabled
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_SWJ_DISABLE() do{ CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_SWJ_CFG); \
|
#define __HAL_AFIO_REMAP_SWJ_DISABLE() AFIO_DBGAFR_CONFIG(AFIO_MAPR_SWJ_CFG_DISABLE)
|
||||||
SET_BIT(AFIO->MAPR, AFIO_MAPR_SWJ_CFG_DISABLE); \
|
|
||||||
}while(0U)
|
|
||||||
|
|
||||||
#if defined(AFIO_MAPR_SPI3_REMAP)
|
#if defined(AFIO_MAPR_SPI3_REMAP)
|
||||||
|
|
||||||
@@ -556,7 +515,7 @@
|
|||||||
* @note This bit is available only in connectivity line devices and is reserved otherwise.
|
* @note This bit is available only in connectivity line devices and is reserved otherwise.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_SPI3_ENABLE() SET_BIT(AFIO->MAPR, AFIO_MAPR_SPI3_REMAP)
|
#define __HAL_AFIO_REMAP_SPI3_ENABLE() AFIO_REMAP_ENABLE(AFIO_MAPR_SPI3_REMAP)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Disable the remapping of SPI3 alternate functions SPI3_NSS/I2S3_WS, SPI3_SCK/I2S3_CK, SPI3_MISO, SPI3_MOSI/I2S3_SD.
|
* @brief Disable the remapping of SPI3 alternate functions SPI3_NSS/I2S3_WS, SPI3_SCK/I2S3_CK, SPI3_MISO, SPI3_MOSI/I2S3_SD.
|
||||||
@@ -564,7 +523,7 @@
|
|||||||
* @note This bit is available only in connectivity line devices and is reserved otherwise.
|
* @note This bit is available only in connectivity line devices and is reserved otherwise.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_REMAP_SPI3_DISABLE() CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_SPI3_REMAP)
|
#define __HAL_AFIO_REMAP_SPI3_DISABLE() AFIO_REMAP_DISABLE(AFIO_MAPR_SPI3_REMAP)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(AFIO_MAPR_TIM2ITR1_IREMAP)
|
#if defined(AFIO_MAPR_TIM2ITR1_IREMAP)
|
||||||
@@ -575,7 +534,7 @@
|
|||||||
* @note This bit is available only in connectivity line devices and is reserved otherwise.
|
* @note This bit is available only in connectivity line devices and is reserved otherwise.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_TIM2ITR1_TO_USB() SET_BIT(AFIO->MAPR, AFIO_MAPR_TIM2ITR1_IREMAP)
|
#define __HAL_AFIO_TIM2ITR1_TO_USB() AFIO_REMAP_ENABLE(AFIO_MAPR_TIM2ITR1_IREMAP)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Control of TIM2_ITR1 internal mapping.
|
* @brief Control of TIM2_ITR1 internal mapping.
|
||||||
@@ -583,7 +542,7 @@
|
|||||||
* @note This bit is available only in connectivity line devices and is reserved otherwise.
|
* @note This bit is available only in connectivity line devices and is reserved otherwise.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_TIM2ITR1_TO_ETH() CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_TIM2ITR1_IREMAP)
|
#define __HAL_AFIO_TIM2ITR1_TO_ETH() AFIO_REMAP_DISABLE(AFIO_MAPR_TIM2ITR1_IREMAP)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(AFIO_MAPR_PTP_PPS_REMAP)
|
#if defined(AFIO_MAPR_PTP_PPS_REMAP)
|
||||||
@@ -594,7 +553,7 @@
|
|||||||
* @note This bit is available only in connectivity line devices and is reserved otherwise.
|
* @note This bit is available only in connectivity line devices and is reserved otherwise.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_ETH_PTP_PPS_ENABLE() SET_BIT(AFIO->MAPR, AFIO_MAPR_PTP_PPS_REMAP)
|
#define __HAL_AFIO_ETH_PTP_PPS_ENABLE() AFIO_REMAP_ENABLE(AFIO_MAPR_PTP_PPS_REMAP)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Disable the remapping of ADC2_ETRGREG (ADC 2 External trigger regular conversion).
|
* @brief Disable the remapping of ADC2_ETRGREG (ADC 2 External trigger regular conversion).
|
||||||
@@ -602,7 +561,7 @@
|
|||||||
* @note This bit is available only in connectivity line devices and is reserved otherwise.
|
* @note This bit is available only in connectivity line devices and is reserved otherwise.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
#define __HAL_AFIO_ETH_PTP_PPS_DISABLE() CLEAR_BIT(AFIO->MAPR, AFIO_MAPR_PTP_PPS_REMAP)
|
#define __HAL_AFIO_ETH_PTP_PPS_DISABLE() AFIO_REMAP_DISABLE(AFIO_MAPR_PTP_PPS_REMAP)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(AFIO_MAPR2_TIM9_REMAP)
|
#if defined(AFIO_MAPR2_TIM9_REMAP)
|
||||||
@@ -883,6 +842,31 @@
|
|||||||
((__GPIOx__) == (GPIOF))? 5U :6U)
|
((__GPIOx__) == (GPIOF))? 5U :6U)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define AFIO_REMAP_ENABLE(REMAP_PIN) do{ uint32_t tmpreg = AFIO->MAPR; \
|
||||||
|
tmpreg |= AFIO_MAPR_SWJ_CFG; \
|
||||||
|
tmpreg |= REMAP_PIN; \
|
||||||
|
AFIO->MAPR = tmpreg; \
|
||||||
|
}while(0U)
|
||||||
|
|
||||||
|
#define AFIO_REMAP_DISABLE(REMAP_PIN) do{ uint32_t tmpreg = AFIO->MAPR; \
|
||||||
|
tmpreg |= AFIO_MAPR_SWJ_CFG; \
|
||||||
|
tmpreg &= ~REMAP_PIN; \
|
||||||
|
AFIO->MAPR = tmpreg; \
|
||||||
|
}while(0U)
|
||||||
|
|
||||||
|
#define AFIO_REMAP_PARTIAL(REMAP_PIN, REMAP_PIN_MASK) do{ uint32_t tmpreg = AFIO->MAPR; \
|
||||||
|
tmpreg &= ~REMAP_PIN_MASK; \
|
||||||
|
tmpreg |= AFIO_MAPR_SWJ_CFG; \
|
||||||
|
tmpreg |= REMAP_PIN; \
|
||||||
|
AFIO->MAPR = tmpreg; \
|
||||||
|
}while(0U)
|
||||||
|
|
||||||
|
#define AFIO_DBGAFR_CONFIG(DBGAFR_SWJCFG) do{ uint32_t tmpreg = AFIO->MAPR; \
|
||||||
|
tmpreg &= ~AFIO_MAPR_SWJ_CFG_Msk; \
|
||||||
|
tmpreg |= DBGAFR_SWJCFG; \
|
||||||
|
AFIO->MAPR = tmpreg; \
|
||||||
|
}while(0U)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_hcd.h
|
* @file stm32f1xx_hal_hcd.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of HCD HAL module.
|
* @brief Header file of HCD HAL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_i2c.h
|
* @file stm32f1xx_hal_i2c.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of I2C HAL module.
|
* @brief Header file of I2C HAL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
@@ -564,6 +562,8 @@ uint32_t HAL_I2C_GetError(I2C_HandleTypeDef *hi2c);
|
|||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
#define I2C_FLAG_MASK 0x0000FFFFU
|
#define I2C_FLAG_MASK 0x0000FFFFU
|
||||||
|
#define I2C_MIN_PCLK_FREQ_STANDARD 2000000U /*!< 2 MHz */
|
||||||
|
#define I2C_MIN_PCLK_FREQ_FAST 4000000U /*!< 4 MHz */
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
@@ -573,10 +573,12 @@ uint32_t HAL_I2C_GetError(I2C_HandleTypeDef *hi2c);
|
|||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define I2C_MIN_PCLK_FREQ(__PCLK__, __SPEED__) (((__SPEED__) <= 100000U) ? ((__PCLK__) < I2C_MIN_PCLK_FREQ_STANDARD) : ((__PCLK__) < I2C_MIN_PCLK_FREQ_FAST))
|
||||||
|
#define I2C_CCR_CALCULATION(__PCLK__, __SPEED__, __COEFF__) (((((__PCLK__) - 1U)/((__SPEED__) * (__COEFF__))) + 1U) & I2C_CCR_CCR)
|
||||||
#define I2C_FREQRANGE(__PCLK__) ((__PCLK__)/1000000U)
|
#define I2C_FREQRANGE(__PCLK__) ((__PCLK__)/1000000U)
|
||||||
#define I2C_RISE_TIME(__FREQRANGE__, __SPEED__) (((__SPEED__) <= 100000U) ? ((__FREQRANGE__) + 1U) : ((((__FREQRANGE__) * 300U) / 1000U) + 1U))
|
#define I2C_RISE_TIME(__FREQRANGE__, __SPEED__) (((__SPEED__) <= 100000U) ? ((__FREQRANGE__) + 1U) : ((((__FREQRANGE__) * 300U) / 1000U) + 1U))
|
||||||
#define I2C_SPEED_STANDARD(__PCLK__, __SPEED__) (((((__PCLK__)/((__SPEED__) << 1U)) & I2C_CCR_CCR) < 4U)? 4U:((__PCLK__) / ((__SPEED__) << 1U)))
|
#define I2C_SPEED_STANDARD(__PCLK__, __SPEED__) ((I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 2U) < 4U)? 4U:I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 2U))
|
||||||
#define I2C_SPEED_FAST(__PCLK__, __SPEED__, __DUTYCYCLE__) (((__DUTYCYCLE__) == I2C_DUTYCYCLE_2)? ((__PCLK__) / ((__SPEED__) * 3U)) : (((__PCLK__) / ((__SPEED__) * 25U)) | I2C_DUTYCYCLE_16_9))
|
#define I2C_SPEED_FAST(__PCLK__, __SPEED__, __DUTYCYCLE__) (((__DUTYCYCLE__) == I2C_DUTYCYCLE_2)? I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 3U) : (I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 25U) | I2C_DUTYCYCLE_16_9))
|
||||||
#define I2C_SPEED(__PCLK__, __SPEED__, __DUTYCYCLE__) (((__SPEED__) <= 100000U)? (I2C_SPEED_STANDARD((__PCLK__), (__SPEED__))) : \
|
#define I2C_SPEED(__PCLK__, __SPEED__, __DUTYCYCLE__) (((__SPEED__) <= 100000U)? (I2C_SPEED_STANDARD((__PCLK__), (__SPEED__))) : \
|
||||||
((I2C_SPEED_FAST((__PCLK__), (__SPEED__), (__DUTYCYCLE__)) & I2C_CCR_CCR) == 0U)? 1U : \
|
((I2C_SPEED_FAST((__PCLK__), (__SPEED__), (__DUTYCYCLE__)) & I2C_CCR_CCR) == 0U)? 1U : \
|
||||||
((I2C_SPEED_FAST((__PCLK__), (__SPEED__), (__DUTYCYCLE__))) | I2C_CCR_FS))
|
((I2C_SPEED_FAST((__PCLK__), (__SPEED__), (__DUTYCYCLE__))) | I2C_CCR_FS))
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_i2s.h
|
* @file stm32f1xx_hal_i2s.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of I2S HAL module.
|
* @brief Header file of I2S HAL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_irda.h
|
* @file stm32f1xx_hal_irda.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of IRDA HAL module.
|
* @brief Header file of IRDA HAL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_iwdg.h
|
* @file stm32f1xx_hal_iwdg.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of IWDG HAL module.
|
* @brief Header file of IWDG HAL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
@@ -40,7 +38,7 @@
|
|||||||
#define __STM32F1xx_HAL_IWDG_H
|
#define __STM32F1xx_HAL_IWDG_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
@@ -81,7 +79,7 @@ typedef struct
|
|||||||
|
|
||||||
IWDG_InitTypeDef Init; /*!< IWDG required parameters */
|
IWDG_InitTypeDef Init; /*!< IWDG required parameters */
|
||||||
|
|
||||||
}IWDG_HandleTypeDef;
|
} IWDG_HandleTypeDef;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_mmc.h
|
* @file stm32f1xx_hal_mmc.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of MMC HAL module.
|
* @brief Header file of MMC HAL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_nand.h
|
* @file stm32f1xx_hal_nand.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of NAND HAL module.
|
* @brief Header file of NAND HAL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_nor.h
|
* @file stm32f1xx_hal_nor.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of NOR HAL module.
|
* @brief Header file of NOR HAL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_pccard.h
|
* @file stm32f1xx_hal_pccard.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of PCCARD HAL module.
|
* @brief Header file of PCCARD HAL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_pcd.h
|
* @file stm32f1xx_hal_pcd.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of PCD HAL module.
|
* @brief Header file of PCD HAL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_pcd_ex.h
|
* @file stm32f1xx_hal_pcd_ex.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of Extended PCD HAL module.
|
* @brief Header file of Extended PCD HAL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_pwr.h
|
* @file stm32f1xx_hal_pwr.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of PWR HAL module.
|
* @brief Header file of PWR HAL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_rcc.h
|
* @file stm32f1xx_hal_rcc.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of RCC HAL module.
|
* @brief Header file of RCC HAL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
@@ -1170,7 +1168,7 @@ typedef struct
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Initialization and de-initialization functions ******************************/
|
/* Initialization and de-initialization functions ******************************/
|
||||||
void HAL_RCC_DeInit(void);
|
HAL_StatusTypeDef HAL_RCC_DeInit(void);
|
||||||
HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct);
|
HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct);
|
||||||
HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t FLatency);
|
HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t FLatency);
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_rcc_ex.h
|
* @file stm32f1xx_hal_rcc_ex.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of RCC HAL Extension module.
|
* @brief Header file of RCC HAL Extension module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_rtc.h
|
* @file stm32f1xx_hal_rtc.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of RTC HAL module.
|
* @brief Header file of RTC HAL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_rtc_ex.h
|
* @file stm32f1xx_hal_rtc_ex.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of RTC HAL Extension module.
|
* @brief Header file of RTC HAL Extension module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_sd.h
|
* @file stm32f1xx_hal_sd.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of SD HAL module.
|
* @brief Header file of SD HAL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_smartcard.h
|
* @file stm32f1xx_hal_smartcard.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of SMARTCARD HAL module.
|
* @brief Header file of SMARTCARD HAL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
@@ -40,7 +38,7 @@
|
|||||||
#define __STM32F1xx_HAL_SMARTCARD_H
|
#define __STM32F1xx_HAL_SMARTCARD_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
@@ -104,7 +102,7 @@ typedef struct
|
|||||||
|
|
||||||
uint32_t NACKState; /*!< Specifies the SmartCard NACK Transmission state
|
uint32_t NACKState; /*!< Specifies the SmartCard NACK Transmission state
|
||||||
This parameter can be a value of @ref SMARTCARD_NACK_State */
|
This parameter can be a value of @ref SMARTCARD_NACK_State */
|
||||||
}SMARTCARD_InitTypeDef;
|
} SMARTCARD_InitTypeDef;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief HAL SMARTCARD State structures definition
|
* @brief HAL SMARTCARD State structures definition
|
||||||
@@ -164,7 +162,7 @@ typedef enum
|
|||||||
Value is allowed for gState only */
|
Value is allowed for gState only */
|
||||||
HAL_SMARTCARD_STATE_ERROR = 0xE0U /*!< Error
|
HAL_SMARTCARD_STATE_ERROR = 0xE0U /*!< Error
|
||||||
Value is allowed for gState only */
|
Value is allowed for gState only */
|
||||||
}HAL_SMARTCARD_StateTypeDef;
|
} HAL_SMARTCARD_StateTypeDef;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief SMARTCARD handle Structure definition
|
* @brief SMARTCARD handle Structure definition
|
||||||
@@ -201,7 +199,7 @@ typedef struct
|
|||||||
This parameter can be a value of @ref HAL_SMARTCARD_StateTypeDef */
|
This parameter can be a value of @ref HAL_SMARTCARD_StateTypeDef */
|
||||||
|
|
||||||
__IO uint32_t ErrorCode; /*!< SmartCard Error code */
|
__IO uint32_t ErrorCode; /*!< SmartCard Error code */
|
||||||
}SMARTCARD_HandleTypeDef;
|
} SMARTCARD_HandleTypeDef;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_spi.h
|
* @file stm32f1xx_hal_spi.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of SPI HAL module.
|
* @brief Header file of SPI HAL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_sram.h
|
* @file stm32f1xx_hal_sram.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of SRAM HAL module.
|
* @brief Header file of SRAM HAL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_tim.h
|
* @file stm32f1xx_hal_tim.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of TIM HAL module.
|
* @brief Header file of TIM HAL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
@@ -460,8 +458,9 @@ typedef struct
|
|||||||
/** @defgroup TIM_Input_Capture_Polarity TIM Input Capture Polarity
|
/** @defgroup TIM_Input_Capture_Polarity TIM Input Capture Polarity
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
#define TIM_ICPOLARITY_RISING TIM_INPUTCHANNELPOLARITY_RISING
|
#define TIM_ICPOLARITY_RISING TIM_INPUTCHANNELPOLARITY_RISING /*!< Capture triggered by rising edge on timer input */
|
||||||
#define TIM_ICPOLARITY_FALLING TIM_INPUTCHANNELPOLARITY_FALLING
|
#define TIM_ICPOLARITY_FALLING TIM_INPUTCHANNELPOLARITY_FALLING /*!< Capture triggered by falling edge on timer input */
|
||||||
|
#define TIM_ICPOLARITY_BOTHEDGE TIM_INPUTCHANNELPOLARITY_BOTHEDGE /*!< Capture triggered by both rising and falling edges on timer input */
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
@@ -939,8 +938,9 @@ typedef struct
|
|||||||
((CHANNEL) == TIM_CHANNEL_2) || \
|
((CHANNEL) == TIM_CHANNEL_2) || \
|
||||||
((CHANNEL) == TIM_CHANNEL_3))
|
((CHANNEL) == TIM_CHANNEL_3))
|
||||||
|
|
||||||
#define IS_TIM_IC_POLARITY(POLARITY) (((POLARITY) == TIM_ICPOLARITY_RISING) || \
|
#define IS_TIM_IC_POLARITY(__POLARITY__) (((__POLARITY__) == TIM_ICPOLARITY_RISING) || \
|
||||||
((POLARITY) == TIM_ICPOLARITY_FALLING))
|
((__POLARITY__) == TIM_ICPOLARITY_FALLING) || \
|
||||||
|
((__POLARITY__) == TIM_ICPOLARITY_BOTHEDGE))
|
||||||
|
|
||||||
#define IS_TIM_IC_SELECTION(SELECTION) (((SELECTION) == TIM_ICSELECTION_DIRECTTI) || \
|
#define IS_TIM_IC_SELECTION(SELECTION) (((SELECTION) == TIM_ICSELECTION_DIRECTTI) || \
|
||||||
((SELECTION) == TIM_ICSELECTION_INDIRECTTI) || \
|
((SELECTION) == TIM_ICSELECTION_INDIRECTTI) || \
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_tim_ex.h
|
* @file stm32f1xx_hal_tim_ex.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of TIM HAL Extension module.
|
* @brief Header file of TIM HAL Extension module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_uart.h
|
* @file stm32f1xx_hal_uart.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of UART HAL module.
|
* @brief Header file of UART HAL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_usart.h
|
* @file stm32f1xx_hal_usart.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of USART HAL module.
|
* @brief Header file of USART HAL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_wwdg.h
|
* @file stm32f1xx_hal_wwdg.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of WWDG HAL module.
|
* @brief Header file of WWDG HAL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
@@ -40,7 +38,7 @@
|
|||||||
#define __STM32F1xx_HAL_WWDG_H
|
#define __STM32F1xx_HAL_WWDG_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
@@ -76,7 +74,7 @@ typedef struct
|
|||||||
uint32_t EWIMode ; /*!< Specifies if WWDG Early Wakeup Interupt is enable or not.
|
uint32_t EWIMode ; /*!< Specifies if WWDG Early Wakeup Interupt is enable or not.
|
||||||
This parameter can be a value of @ref WWDG_EWI_Mode */
|
This parameter can be a value of @ref WWDG_EWI_Mode */
|
||||||
|
|
||||||
}WWDG_InitTypeDef;
|
} WWDG_InitTypeDef;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief WWDG handle Structure definition
|
* @brief WWDG handle Structure definition
|
||||||
@@ -87,7 +85,7 @@ typedef struct
|
|||||||
|
|
||||||
WWDG_InitTypeDef Init; /*!< WWDG required parameters */
|
WWDG_InitTypeDef Init; /*!< WWDG required parameters */
|
||||||
|
|
||||||
}WWDG_HandleTypeDef;
|
} WWDG_HandleTypeDef;
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
@@ -257,7 +255,7 @@ void HAL_WWDG_MspInit(WWDG_HandleTypeDef *hwwdg);
|
|||||||
/* I/O operation functions ******************************************************/
|
/* I/O operation functions ******************************************************/
|
||||||
HAL_StatusTypeDef HAL_WWDG_Refresh(WWDG_HandleTypeDef *hwwdg);
|
HAL_StatusTypeDef HAL_WWDG_Refresh(WWDG_HandleTypeDef *hwwdg);
|
||||||
void HAL_WWDG_IRQHandler(WWDG_HandleTypeDef *hwwdg);
|
void HAL_WWDG_IRQHandler(WWDG_HandleTypeDef *hwwdg);
|
||||||
void HAL_WWDG_EarlyWakeupCallback(WWDG_HandleTypeDef* hwwdg);
|
void HAL_WWDG_EarlyWakeupCallback(WWDG_HandleTypeDef *hwwdg);
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_ll_adc.h
|
* @file stm32f1xx_ll_adc.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of ADC LL module.
|
* @brief Header file of ADC LL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_ll_bus.h
|
* @file stm32f1xx_ll_bus.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of BUS LL module.
|
* @brief Header file of BUS LL module.
|
||||||
|
|
||||||
@verbatim
|
@verbatim
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_ll_cortex.h
|
* @file stm32f1xx_ll_cortex.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of CORTEX LL module.
|
* @brief Header file of CORTEX LL module.
|
||||||
@verbatim
|
@verbatim
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_ll_crc.h
|
* @file stm32f1xx_ll_crc.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of CRC LL module.
|
* @brief Header file of CRC LL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_ll_dac.h
|
* @file stm32f1xx_ll_dac.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of DAC LL module.
|
* @brief Header file of DAC LL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_ll_dma.h
|
* @file stm32f1xx_ll_dma.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of DMA LL module.
|
* @brief Header file of DMA LL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_ll_exti.h
|
* @file stm32f1xx_ll_exti.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of EXTI LL module.
|
* @brief Header file of EXTI LL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_ll_fsmc.h
|
* @file stm32f1xx_ll_fsmc.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of FSMC HAL module.
|
* @brief Header file of FSMC HAL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_ll_gpio.h
|
* @file stm32f1xx_ll_gpio.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of GPIO LL module.
|
* @brief Header file of GPIO LL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
@@ -58,16 +56,18 @@ extern "C" {
|
|||||||
|
|
||||||
/* Private types -------------------------------------------------------------*/
|
/* Private types -------------------------------------------------------------*/
|
||||||
/* Private variables ---------------------------------------------------------*/
|
/* Private variables ---------------------------------------------------------*/
|
||||||
|
|
||||||
/* Private constants ---------------------------------------------------------*/
|
/* Private constants ---------------------------------------------------------*/
|
||||||
|
|
||||||
/** @defgroup GPIO_LL_Private_Constants GPIO Private Constants
|
/** @defgroup GPIO_LL_Private_Constants GPIO Private Constants
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
/* Defines used for Pin Mask Initialization */
|
||||||
|
#define GPIO_PIN_MASK_POS 8U
|
||||||
|
#define GPIO_PIN_NB 16U
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* Private macros ------------------------------------------------------------*/
|
/* Private macros ------------------------------------------------------------*/
|
||||||
#if defined(USE_FULL_LL_DRIVER)
|
#if defined(USE_FULL_LL_DRIVER)
|
||||||
/** @defgroup GPIO_LL_Private_Macros GPIO Private Macros
|
/** @defgroup GPIO_LL_Private_Macros GPIO Private Macros
|
||||||
@@ -112,7 +112,7 @@ typedef struct
|
|||||||
This parameter can be a value of @ref GPIO_LL_EC_PULL.
|
This parameter can be a value of @ref GPIO_LL_EC_PULL.
|
||||||
|
|
||||||
GPIO HW configuration can be modified afterwards using unitary function @ref LL_GPIO_SetPinPull().*/
|
GPIO HW configuration can be modified afterwards using unitary function @ref LL_GPIO_SetPinPull().*/
|
||||||
}LL_GPIO_InitTypeDef;
|
} LL_GPIO_InitTypeDef;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
@@ -127,22 +127,22 @@ typedef struct
|
|||||||
/** @defgroup GPIO_LL_EC_PIN PIN
|
/** @defgroup GPIO_LL_EC_PIN PIN
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
#define LL_GPIO_PIN_0 (GPIO_BSRR_BS0 << 8) | 0x00000001U /*!< Select pin 0 */
|
#define LL_GPIO_PIN_0 ((GPIO_BSRR_BS0 << GPIO_PIN_MASK_POS) | 0x00000001U) /*!< Select pin 0 */
|
||||||
#define LL_GPIO_PIN_1 (GPIO_BSRR_BS1 << 8) | 0x00000002U /*!< Select pin 1 */
|
#define LL_GPIO_PIN_1 ((GPIO_BSRR_BS1 << GPIO_PIN_MASK_POS) | 0x00000002U) /*!< Select pin 1 */
|
||||||
#define LL_GPIO_PIN_2 (GPIO_BSRR_BS2 << 8) | 0x00000004U /*!< Select pin 2 */
|
#define LL_GPIO_PIN_2 ((GPIO_BSRR_BS2 << GPIO_PIN_MASK_POS) | 0x00000004U) /*!< Select pin 2 */
|
||||||
#define LL_GPIO_PIN_3 (GPIO_BSRR_BS3 << 8) | 0x00000008U /*!< Select pin 3 */
|
#define LL_GPIO_PIN_3 ((GPIO_BSRR_BS3 << GPIO_PIN_MASK_POS) | 0x00000008U) /*!< Select pin 3 */
|
||||||
#define LL_GPIO_PIN_4 (GPIO_BSRR_BS4 << 8) | 0x00000010U /*!< Select pin 4 */
|
#define LL_GPIO_PIN_4 ((GPIO_BSRR_BS4 << GPIO_PIN_MASK_POS) | 0x00000010U) /*!< Select pin 4 */
|
||||||
#define LL_GPIO_PIN_5 (GPIO_BSRR_BS5 << 8) | 0x00000020U /*!< Select pin 5 */
|
#define LL_GPIO_PIN_5 ((GPIO_BSRR_BS5 << GPIO_PIN_MASK_POS) | 0x00000020U) /*!< Select pin 5 */
|
||||||
#define LL_GPIO_PIN_6 (GPIO_BSRR_BS6 << 8) | 0x00000040U /*!< Select pin 6 */
|
#define LL_GPIO_PIN_6 ((GPIO_BSRR_BS6 << GPIO_PIN_MASK_POS) | 0x00000040U) /*!< Select pin 6 */
|
||||||
#define LL_GPIO_PIN_7 (GPIO_BSRR_BS7 << 8) | 0x00000080U /*!< Select pin 7 */
|
#define LL_GPIO_PIN_7 ((GPIO_BSRR_BS7 << GPIO_PIN_MASK_POS) | 0x00000080U) /*!< Select pin 7 */
|
||||||
#define LL_GPIO_PIN_8 (GPIO_BSRR_BS8 << 8) | 0x04000001U /*!< Select pin 8 */
|
#define LL_GPIO_PIN_8 ((GPIO_BSRR_BS8 << GPIO_PIN_MASK_POS) | 0x04000001U) /*!< Select pin 8 */
|
||||||
#define LL_GPIO_PIN_9 (GPIO_BSRR_BS9 << 8) | 0x04000002U /*!< Select pin 9 */
|
#define LL_GPIO_PIN_9 ((GPIO_BSRR_BS9 << GPIO_PIN_MASK_POS) | 0x04000002U) /*!< Select pin 9 */
|
||||||
#define LL_GPIO_PIN_10 (GPIO_BSRR_BS10 << 8) | 0x04000004U /*!< Select pin 10 */
|
#define LL_GPIO_PIN_10 ((GPIO_BSRR_BS10 << GPIO_PIN_MASK_POS) | 0x04000004U) /*!< Select pin 10 */
|
||||||
#define LL_GPIO_PIN_11 (GPIO_BSRR_BS11 << 8) | 0x04000008U /*!< Select pin 11 */
|
#define LL_GPIO_PIN_11 ((GPIO_BSRR_BS11 << GPIO_PIN_MASK_POS) | 0x04000008U) /*!< Select pin 11 */
|
||||||
#define LL_GPIO_PIN_12 (GPIO_BSRR_BS12 << 8) | 0x04000010U /*!< Select pin 12 */
|
#define LL_GPIO_PIN_12 ((GPIO_BSRR_BS12 << GPIO_PIN_MASK_POS) | 0x04000010U) /*!< Select pin 12 */
|
||||||
#define LL_GPIO_PIN_13 (GPIO_BSRR_BS13 << 8) | 0x04000020U /*!< Select pin 13 */
|
#define LL_GPIO_PIN_13 ((GPIO_BSRR_BS13 << GPIO_PIN_MASK_POS) | 0x04000020U) /*!< Select pin 13 */
|
||||||
#define LL_GPIO_PIN_14 (GPIO_BSRR_BS14 << 8) | 0x04000040U /*!< Select pin 14 */
|
#define LL_GPIO_PIN_14 ((GPIO_BSRR_BS14 << GPIO_PIN_MASK_POS) | 0x04000040U) /*!< Select pin 14 */
|
||||||
#define LL_GPIO_PIN_15 (GPIO_BSRR_BS15 << 8) | 0x04000080U /*!< Select pin 15 */
|
#define LL_GPIO_PIN_15 ((GPIO_BSRR_BS15 << GPIO_PIN_MASK_POS) | 0x04000080U) /*!< Select pin 15 */
|
||||||
#define LL_GPIO_PIN_ALL (LL_GPIO_PIN_0 | LL_GPIO_PIN_1 | LL_GPIO_PIN_2 | \
|
#define LL_GPIO_PIN_ALL (LL_GPIO_PIN_0 | LL_GPIO_PIN_1 | LL_GPIO_PIN_2 | \
|
||||||
LL_GPIO_PIN_3 | LL_GPIO_PIN_4 | LL_GPIO_PIN_5 | \
|
LL_GPIO_PIN_3 | LL_GPIO_PIN_4 | LL_GPIO_PIN_5 | \
|
||||||
LL_GPIO_PIN_6 | LL_GPIO_PIN_7 | LL_GPIO_PIN_8 | \
|
LL_GPIO_PIN_6 | LL_GPIO_PIN_7 | LL_GPIO_PIN_8 | \
|
||||||
@@ -240,13 +240,13 @@ typedef struct
|
|||||||
/** @defgroup GPIO_LL_EC_EXTI_PORT GPIO EXTI PORT
|
/** @defgroup GPIO_LL_EC_EXTI_PORT GPIO EXTI PORT
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
#define LL_GPIO_AF_EXTI_PORTA (uint32_t)0 /*!< EXTI PORT A */
|
#define LL_GPIO_AF_EXTI_PORTA 0U /*!< EXTI PORT A */
|
||||||
#define LL_GPIO_AF_EXTI_PORTB (uint32_t)1 /*!< EXTI PORT B */
|
#define LL_GPIO_AF_EXTI_PORTB 1U /*!< EXTI PORT B */
|
||||||
#define LL_GPIO_AF_EXTI_PORTC (uint32_t)2 /*!< EXTI PORT C */
|
#define LL_GPIO_AF_EXTI_PORTC 2U /*!< EXTI PORT C */
|
||||||
#define LL_GPIO_AF_EXTI_PORTD (uint32_t)3 /*!< EXTI PORT D */
|
#define LL_GPIO_AF_EXTI_PORTD 3U /*!< EXTI PORT D */
|
||||||
#define LL_GPIO_AF_EXTI_PORTE (uint32_t)4 /*!< EXTI PORT E */
|
#define LL_GPIO_AF_EXTI_PORTE 4U /*!< EXTI PORT E */
|
||||||
#define LL_GPIO_AF_EXTI_PORTF (uint32_t)5 /*!< EXTI PORT F */
|
#define LL_GPIO_AF_EXTI_PORTF 5U /*!< EXTI PORT F */
|
||||||
#define LL_GPIO_AF_EXTI_PORTG (uint32_t)6 /*!< EXTI PORT G */
|
#define LL_GPIO_AF_EXTI_PORTG 6U /*!< EXTI PORT G */
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
@@ -254,22 +254,22 @@ typedef struct
|
|||||||
/** @defgroup GPIO_LL_EC_EXTI_LINE GPIO EXTI LINE
|
/** @defgroup GPIO_LL_EC_EXTI_LINE GPIO EXTI LINE
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
#define LL_GPIO_AF_EXTI_LINE0 (uint32_t)(0x000FU << 16 | 0) /*!< EXTI_POSITION_0 | EXTICR[0] */
|
#define LL_GPIO_AF_EXTI_LINE0 (0x000FU << 16U | 0U) /*!< EXTI_POSITION_0 | EXTICR[0] */
|
||||||
#define LL_GPIO_AF_EXTI_LINE1 (uint32_t)(0x00F0U << 16 | 0) /*!< EXTI_POSITION_4 | EXTICR[0] */
|
#define LL_GPIO_AF_EXTI_LINE1 (0x00F0U << 16U | 0U) /*!< EXTI_POSITION_4 | EXTICR[0] */
|
||||||
#define LL_GPIO_AF_EXTI_LINE2 (uint32_t)(0x0F00U << 16 | 0) /*!< EXTI_POSITION_8 | EXTICR[0] */
|
#define LL_GPIO_AF_EXTI_LINE2 (0x0F00U << 16U | 0U) /*!< EXTI_POSITION_8 | EXTICR[0] */
|
||||||
#define LL_GPIO_AF_EXTI_LINE3 (uint32_t)(0xF000U << 16 | 0) /*!< EXTI_POSITION_12 | EXTICR[0] */
|
#define LL_GPIO_AF_EXTI_LINE3 (0xF000U << 16U | 0U) /*!< EXTI_POSITION_12 | EXTICR[0] */
|
||||||
#define LL_GPIO_AF_EXTI_LINE4 (uint32_t)(0x000FU << 16 | 1) /*!< EXTI_POSITION_0 | EXTICR[1] */
|
#define LL_GPIO_AF_EXTI_LINE4 (0x000FU << 16U | 1U) /*!< EXTI_POSITION_0 | EXTICR[1] */
|
||||||
#define LL_GPIO_AF_EXTI_LINE5 (uint32_t)(0x00F0U << 16 | 1) /*!< EXTI_POSITION_4 | EXTICR[1] */
|
#define LL_GPIO_AF_EXTI_LINE5 (0x00F0U << 16U | 1U) /*!< EXTI_POSITION_4 | EXTICR[1] */
|
||||||
#define LL_GPIO_AF_EXTI_LINE6 (uint32_t)(0x0F00U << 16 | 1) /*!< EXTI_POSITION_8 | EXTICR[1] */
|
#define LL_GPIO_AF_EXTI_LINE6 (0x0F00U << 16U | 1U) /*!< EXTI_POSITION_8 | EXTICR[1] */
|
||||||
#define LL_GPIO_AF_EXTI_LINE7 (uint32_t)(0xF000U << 16 | 1) /*!< EXTI_POSITION_12 | EXTICR[1] */
|
#define LL_GPIO_AF_EXTI_LINE7 (0xF000U << 16U | 1U) /*!< EXTI_POSITION_12 | EXTICR[1] */
|
||||||
#define LL_GPIO_AF_EXTI_LINE8 (uint32_t)(0x000FU << 16 | 2) /*!< EXTI_POSITION_0 | EXTICR[2] */
|
#define LL_GPIO_AF_EXTI_LINE8 (0x000FU << 16U | 2U) /*!< EXTI_POSITION_0 | EXTICR[2] */
|
||||||
#define LL_GPIO_AF_EXTI_LINE9 (uint32_t)(0x00F0U << 16 | 2) /*!< EXTI_POSITION_4 | EXTICR[2] */
|
#define LL_GPIO_AF_EXTI_LINE9 (0x00F0U << 16U | 2U) /*!< EXTI_POSITION_4 | EXTICR[2] */
|
||||||
#define LL_GPIO_AF_EXTI_LINE10 (uint32_t)(0x0F00U << 16 | 2) /*!< EXTI_POSITION_8 | EXTICR[2] */
|
#define LL_GPIO_AF_EXTI_LINE10 (0x0F00U << 16U | 2U) /*!< EXTI_POSITION_8 | EXTICR[2] */
|
||||||
#define LL_GPIO_AF_EXTI_LINE11 (uint32_t)(0xF000U << 16 | 2) /*!< EXTI_POSITION_12 | EXTICR[2] */
|
#define LL_GPIO_AF_EXTI_LINE11 (0xF000U << 16U | 2U) /*!< EXTI_POSITION_12 | EXTICR[2] */
|
||||||
#define LL_GPIO_AF_EXTI_LINE12 (uint32_t)(0x000FU << 16 | 3) /*!< EXTI_POSITION_0 | EXTICR[3] */
|
#define LL_GPIO_AF_EXTI_LINE12 (0x000FU << 16U | 3U) /*!< EXTI_POSITION_0 | EXTICR[3] */
|
||||||
#define LL_GPIO_AF_EXTI_LINE13 (uint32_t)(0x00F0U << 16 | 3) /*!< EXTI_POSITION_4 | EXTICR[3] */
|
#define LL_GPIO_AF_EXTI_LINE13 (0x00F0U << 16U | 3U) /*!< EXTI_POSITION_4 | EXTICR[3] */
|
||||||
#define LL_GPIO_AF_EXTI_LINE14 (uint32_t)(0x0F00U << 16 | 3) /*!< EXTI_POSITION_8 | EXTICR[3] */
|
#define LL_GPIO_AF_EXTI_LINE14 (0x0F00U << 16U | 3U) /*!< EXTI_POSITION_8 | EXTICR[3] */
|
||||||
#define LL_GPIO_AF_EXTI_LINE15 (uint32_t)(0xF000U << 16 | 3) /*!< EXTI_POSITION_12 | EXTICR[3] */
|
#define LL_GPIO_AF_EXTI_LINE15 (0xF000U << 16U | 3U) /*!< EXTI_POSITION_12 | EXTICR[3] */
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
@@ -357,8 +357,8 @@ typedef struct
|
|||||||
*/
|
*/
|
||||||
__STATIC_INLINE void LL_GPIO_SetPinMode(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Mode)
|
__STATIC_INLINE void LL_GPIO_SetPinMode(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Mode)
|
||||||
{
|
{
|
||||||
register uint32_t *pReg = (uint32_t *)((uint32_t)((uint32_t)(&GPIOx->CRL) + (Pin>>24)));
|
register uint32_t *pReg = (uint32_t *)((uint32_t)(&GPIOx->CRL) + (Pin >> 24));
|
||||||
MODIFY_REG(*pReg, ((GPIO_CRL_CNF0|GPIO_CRL_MODE0) << (POSITION_VAL(Pin) * 4U)), (Mode << (POSITION_VAL(Pin) * 4U)));
|
MODIFY_REG(*pReg, ((GPIO_CRL_CNF0 | GPIO_CRL_MODE0) << (POSITION_VAL(Pin) * 4U)), (Mode << (POSITION_VAL(Pin) * 4U)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -397,9 +397,8 @@ __STATIC_INLINE void LL_GPIO_SetPinMode(GPIO_TypeDef *GPIOx, uint32_t Pin, uint3
|
|||||||
*/
|
*/
|
||||||
__STATIC_INLINE uint32_t LL_GPIO_GetPinMode(GPIO_TypeDef *GPIOx, uint32_t Pin)
|
__STATIC_INLINE uint32_t LL_GPIO_GetPinMode(GPIO_TypeDef *GPIOx, uint32_t Pin)
|
||||||
{
|
{
|
||||||
register uint32_t *pReg = (uint32_t *)((uint32_t)((uint32_t)(&GPIOx->CRL) + (Pin>>24)));
|
register uint32_t *pReg = (uint32_t *)((uint32_t)(&GPIOx->CRL) + (Pin >> 24));
|
||||||
return (uint32_t)(READ_BIT(*pReg,
|
return (READ_BIT(*pReg, ((GPIO_CRL_CNF0 | GPIO_CRL_MODE0) << (POSITION_VAL(Pin) * 4U))) >> (POSITION_VAL(Pin) * 4U));
|
||||||
((GPIO_CRL_CNF0|GPIO_CRL_MODE0) << (POSITION_VAL(Pin) * 4U))) >> (POSITION_VAL(Pin) * 4U));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -436,7 +435,7 @@ __STATIC_INLINE uint32_t LL_GPIO_GetPinMode(GPIO_TypeDef *GPIOx, uint32_t Pin)
|
|||||||
*/
|
*/
|
||||||
__STATIC_INLINE void LL_GPIO_SetPinSpeed(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Speed)
|
__STATIC_INLINE void LL_GPIO_SetPinSpeed(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Speed)
|
||||||
{
|
{
|
||||||
register uint32_t *pReg = (uint32_t *)((uint32_t)((uint32_t)(&GPIOx->CRL) + (Pin>>24)));
|
register uint32_t *pReg = (uint32_t *)((uint32_t)(&GPIOx->CRL) + (Pin >> 24));
|
||||||
MODIFY_REG(*pReg, (GPIO_CRL_MODE0 << (POSITION_VAL(Pin) * 4U)),
|
MODIFY_REG(*pReg, (GPIO_CRL_MODE0 << (POSITION_VAL(Pin) * 4U)),
|
||||||
(Speed << (POSITION_VAL(Pin) * 4U)));
|
(Speed << (POSITION_VAL(Pin) * 4U)));
|
||||||
}
|
}
|
||||||
@@ -474,9 +473,8 @@ __STATIC_INLINE void LL_GPIO_SetPinSpeed(GPIO_TypeDef *GPIOx, uint32_t Pin, uint
|
|||||||
*/
|
*/
|
||||||
__STATIC_INLINE uint32_t LL_GPIO_GetPinSpeed(GPIO_TypeDef *GPIOx, uint32_t Pin)
|
__STATIC_INLINE uint32_t LL_GPIO_GetPinSpeed(GPIO_TypeDef *GPIOx, uint32_t Pin)
|
||||||
{
|
{
|
||||||
register uint32_t *pReg = (uint32_t *)((uint32_t)((uint32_t)(&GPIOx->CRL) + (Pin>>24)));
|
register uint32_t *pReg = (uint32_t *)((uint32_t)(&GPIOx->CRL) + (Pin >> 24));
|
||||||
return (uint32_t)(READ_BIT(*pReg,
|
return (READ_BIT(*pReg, (GPIO_CRL_MODE0 << (POSITION_VAL(Pin) * 4U))) >> (POSITION_VAL(Pin) * 4U));
|
||||||
(GPIO_CRL_MODE0 << (POSITION_VAL(Pin) * 4U))) >> (POSITION_VAL(Pin) * 4U));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -511,7 +509,7 @@ __STATIC_INLINE uint32_t LL_GPIO_GetPinSpeed(GPIO_TypeDef *GPIOx, uint32_t Pin)
|
|||||||
*/
|
*/
|
||||||
__STATIC_INLINE void LL_GPIO_SetPinOutputType(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t OutputType)
|
__STATIC_INLINE void LL_GPIO_SetPinOutputType(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t OutputType)
|
||||||
{
|
{
|
||||||
register uint32_t *pReg = (uint32_t *)((uint32_t)((uint32_t)(&GPIOx->CRL) + (Pin>>24)));
|
register uint32_t *pReg = (uint32_t *)((uint32_t)(&GPIOx->CRL) + (Pin >> 24));
|
||||||
MODIFY_REG(*pReg, (GPIO_CRL_CNF0_0 << (POSITION_VAL(Pin) * 4U)),
|
MODIFY_REG(*pReg, (GPIO_CRL_CNF0_0 << (POSITION_VAL(Pin) * 4U)),
|
||||||
(OutputType << (POSITION_VAL(Pin) * 4U)));
|
(OutputType << (POSITION_VAL(Pin) * 4U)));
|
||||||
}
|
}
|
||||||
@@ -548,9 +546,8 @@ __STATIC_INLINE void LL_GPIO_SetPinOutputType(GPIO_TypeDef *GPIOx, uint32_t Pin,
|
|||||||
*/
|
*/
|
||||||
__STATIC_INLINE uint32_t LL_GPIO_GetPinOutputType(GPIO_TypeDef *GPIOx, uint32_t Pin)
|
__STATIC_INLINE uint32_t LL_GPIO_GetPinOutputType(GPIO_TypeDef *GPIOx, uint32_t Pin)
|
||||||
{
|
{
|
||||||
register uint32_t *pReg = (uint32_t *)((uint32_t)((uint32_t)(&GPIOx->CRL) + (Pin>>24)));
|
register uint32_t *pReg = (uint32_t *)((uint32_t)(&GPIOx->CRL) + (Pin >> 24));
|
||||||
return (uint32_t)(READ_BIT(*pReg,
|
return (READ_BIT(*pReg, (GPIO_CRL_CNF0_0 << (POSITION_VAL(Pin) * 4U))) >> (POSITION_VAL(Pin) * 4U));
|
||||||
(GPIO_CRL_CNF0_0 << (POSITION_VAL(Pin) * 4U))) >> (POSITION_VAL(Pin) * 4U));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -583,7 +580,7 @@ __STATIC_INLINE uint32_t LL_GPIO_GetPinOutputType(GPIO_TypeDef *GPIOx, uint32_t
|
|||||||
*/
|
*/
|
||||||
__STATIC_INLINE void LL_GPIO_SetPinPull(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Pull)
|
__STATIC_INLINE void LL_GPIO_SetPinPull(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Pull)
|
||||||
{
|
{
|
||||||
MODIFY_REG(GPIOx->ODR, (Pin>>8) , Pull << (POSITION_VAL(Pin>>8)));
|
MODIFY_REG(GPIOx->ODR, (Pin >> GPIO_PIN_MASK_POS), Pull << (POSITION_VAL(Pin >> GPIO_PIN_MASK_POS)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -614,8 +611,7 @@ __STATIC_INLINE void LL_GPIO_SetPinPull(GPIO_TypeDef *GPIOx, uint32_t Pin, uint3
|
|||||||
*/
|
*/
|
||||||
__STATIC_INLINE uint32_t LL_GPIO_GetPinPull(GPIO_TypeDef *GPIOx, uint32_t Pin)
|
__STATIC_INLINE uint32_t LL_GPIO_GetPinPull(GPIO_TypeDef *GPIOx, uint32_t Pin)
|
||||||
{
|
{
|
||||||
return (uint32_t)(READ_BIT(GPIOx->ODR,
|
return (READ_BIT(GPIOx->ODR, (GPIO_ODR_ODR0 << (POSITION_VAL(Pin >> GPIO_PIN_MASK_POS)))) >> (POSITION_VAL(Pin >> GPIO_PIN_MASK_POS)));
|
||||||
(GPIO_ODR_ODR0 << (POSITION_VAL(Pin>>8)))) >> (POSITION_VAL(Pin>>8)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -650,9 +646,9 @@ __STATIC_INLINE uint32_t LL_GPIO_GetPinPull(GPIO_TypeDef *GPIOx, uint32_t Pin)
|
|||||||
__STATIC_INLINE void LL_GPIO_LockPin(GPIO_TypeDef *GPIOx, uint32_t PinMask)
|
__STATIC_INLINE void LL_GPIO_LockPin(GPIO_TypeDef *GPIOx, uint32_t PinMask)
|
||||||
{
|
{
|
||||||
__IO uint32_t temp;
|
__IO uint32_t temp;
|
||||||
WRITE_REG(GPIOx->LCKR, GPIO_LCKR_LCKK | ((PinMask >> 8) & 0x0000FFFFU));
|
WRITE_REG(GPIOx->LCKR, GPIO_LCKR_LCKK | ((PinMask >> GPIO_PIN_MASK_POS) & 0x0000FFFFU));
|
||||||
WRITE_REG(GPIOx->LCKR, ((PinMask >>8 ) & 0x0000FFFFU));
|
WRITE_REG(GPIOx->LCKR, ((PinMask >> GPIO_PIN_MASK_POS) & 0x0000FFFFU));
|
||||||
WRITE_REG(GPIOx->LCKR, GPIO_LCKR_LCKK | ((PinMask>>8) & 0x0000FFFFU));
|
WRITE_REG(GPIOx->LCKR, GPIO_LCKR_LCKK | ((PinMask >> GPIO_PIN_MASK_POS) & 0x0000FFFFU));
|
||||||
temp = READ_REG(GPIOx->LCKR);
|
temp = READ_REG(GPIOx->LCKR);
|
||||||
(void) temp;
|
(void) temp;
|
||||||
}
|
}
|
||||||
@@ -683,7 +679,7 @@ __STATIC_INLINE void LL_GPIO_LockPin(GPIO_TypeDef *GPIOx, uint32_t PinMask)
|
|||||||
*/
|
*/
|
||||||
__STATIC_INLINE uint32_t LL_GPIO_IsPinLocked(GPIO_TypeDef *GPIOx, uint32_t PinMask)
|
__STATIC_INLINE uint32_t LL_GPIO_IsPinLocked(GPIO_TypeDef *GPIOx, uint32_t PinMask)
|
||||||
{
|
{
|
||||||
return (READ_BIT(GPIOx->LCKR, ((PinMask >> 8 ) & 0x0000FFFFU)) == ((PinMask >>8 ) & 0x0000FFFFU));
|
return (READ_BIT(GPIOx->LCKR, ((PinMask >> GPIO_PIN_MASK_POS) & 0x0000FFFFU)) == ((PinMask >> GPIO_PIN_MASK_POS) & 0x0000FFFFU));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -713,7 +709,7 @@ __STATIC_INLINE uint32_t LL_GPIO_IsAnyPinLocked(GPIO_TypeDef *GPIOx)
|
|||||||
*/
|
*/
|
||||||
__STATIC_INLINE uint32_t LL_GPIO_ReadInputPort(GPIO_TypeDef *GPIOx)
|
__STATIC_INLINE uint32_t LL_GPIO_ReadInputPort(GPIO_TypeDef *GPIOx)
|
||||||
{
|
{
|
||||||
return (uint32_t)(READ_REG(GPIOx->IDR));
|
return (READ_REG(GPIOx->IDR));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -742,7 +738,7 @@ __STATIC_INLINE uint32_t LL_GPIO_ReadInputPort(GPIO_TypeDef *GPIOx)
|
|||||||
*/
|
*/
|
||||||
__STATIC_INLINE uint32_t LL_GPIO_IsInputPinSet(GPIO_TypeDef *GPIOx, uint32_t PinMask)
|
__STATIC_INLINE uint32_t LL_GPIO_IsInputPinSet(GPIO_TypeDef *GPIOx, uint32_t PinMask)
|
||||||
{
|
{
|
||||||
return (READ_BIT(GPIOx->IDR, (PinMask >> 8 ) & 0x0000FFFFU) == ((PinMask >> 8 ) & 0x0000FFFFU));
|
return (READ_BIT(GPIOx->IDR, (PinMask >> GPIO_PIN_MASK_POS) & 0x0000FFFFU) == ((PinMask >> GPIO_PIN_MASK_POS) & 0x0000FFFFU));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -794,7 +790,7 @@ __STATIC_INLINE uint32_t LL_GPIO_ReadOutputPort(GPIO_TypeDef *GPIOx)
|
|||||||
*/
|
*/
|
||||||
__STATIC_INLINE uint32_t LL_GPIO_IsOutputPinSet(GPIO_TypeDef *GPIOx, uint32_t PinMask)
|
__STATIC_INLINE uint32_t LL_GPIO_IsOutputPinSet(GPIO_TypeDef *GPIOx, uint32_t PinMask)
|
||||||
{
|
{
|
||||||
return (READ_BIT(GPIOx->ODR, (PinMask >> 8 ) & 0x0000FFFFU) == ((PinMask >> 8 ) & 0x0000FFFFU));
|
return (READ_BIT(GPIOx->ODR, (PinMask >> GPIO_PIN_MASK_POS) & 0x0000FFFFU) == ((PinMask >> GPIO_PIN_MASK_POS) & 0x0000FFFFU));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -823,7 +819,7 @@ __STATIC_INLINE uint32_t LL_GPIO_IsOutputPinSet(GPIO_TypeDef *GPIOx, uint32_t Pi
|
|||||||
*/
|
*/
|
||||||
__STATIC_INLINE void LL_GPIO_SetOutputPin(GPIO_TypeDef *GPIOx, uint32_t PinMask)
|
__STATIC_INLINE void LL_GPIO_SetOutputPin(GPIO_TypeDef *GPIOx, uint32_t PinMask)
|
||||||
{
|
{
|
||||||
WRITE_REG(GPIOx->BSRR, (PinMask >> 8) & 0x0000FFFFU);
|
WRITE_REG(GPIOx->BSRR, (PinMask >> GPIO_PIN_MASK_POS) & 0x0000FFFFU);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -852,7 +848,7 @@ __STATIC_INLINE void LL_GPIO_SetOutputPin(GPIO_TypeDef *GPIOx, uint32_t PinMask)
|
|||||||
*/
|
*/
|
||||||
__STATIC_INLINE void LL_GPIO_ResetOutputPin(GPIO_TypeDef *GPIOx, uint32_t PinMask)
|
__STATIC_INLINE void LL_GPIO_ResetOutputPin(GPIO_TypeDef *GPIOx, uint32_t PinMask)
|
||||||
{
|
{
|
||||||
WRITE_REG(GPIOx->BRR, (PinMask >> 8 ) & 0x0000FFFFU);
|
WRITE_REG(GPIOx->BRR, (PinMask >> GPIO_PIN_MASK_POS) & 0x0000FFFFU);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -881,7 +877,7 @@ __STATIC_INLINE void LL_GPIO_ResetOutputPin(GPIO_TypeDef *GPIOx, uint32_t PinMas
|
|||||||
*/
|
*/
|
||||||
__STATIC_INLINE void LL_GPIO_TogglePin(GPIO_TypeDef *GPIOx, uint32_t PinMask)
|
__STATIC_INLINE void LL_GPIO_TogglePin(GPIO_TypeDef *GPIOx, uint32_t PinMask)
|
||||||
{
|
{
|
||||||
WRITE_REG(GPIOx->ODR, READ_REG(GPIOx->ODR) ^ ((PinMask >> 8 ) & 0x0000FFFFU));
|
WRITE_REG(GPIOx->ODR, READ_REG(GPIOx->ODR) ^ ((PinMask >> GPIO_PIN_MASK_POS) & 0x0000FFFFU));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_ll_i2c.h
|
* @file stm32f1xx_ll_i2c.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of I2C LL module.
|
* @brief Header file of I2C LL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_ll_iwdg.h
|
* @file stm32f1xx_ll_iwdg.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of IWDG LL module.
|
* @brief Header file of IWDG LL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_ll_pwr.h
|
* @file stm32f1xx_ll_pwr.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of PWR LL module.
|
* @brief Header file of PWR LL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_ll_rcc.h
|
* @file stm32f1xx_ll_rcc.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of RCC LL module.
|
* @brief Header file of RCC LL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
@@ -424,8 +422,8 @@ typedef struct
|
|||||||
#define LL_RCC_PLLSOURCE_PLL2 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1SRC << 4U) /*!< PLL2/PREDIV1 clock selected as PLL entry clock source */
|
#define LL_RCC_PLLSOURCE_PLL2 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1SRC << 4U) /*!< PLL2/PREDIV1 clock selected as PLL entry clock source */
|
||||||
#endif /*RCC_CFGR2_PREDIV1SRC*/
|
#endif /*RCC_CFGR2_PREDIV1SRC*/
|
||||||
|
|
||||||
#define LL_RCC_PLLSOURCE_HSE_DIV_1 RCC_CFGR_PLLSRC /*!< HSE clock selected as PLL entry clock source */
|
|
||||||
#if defined(RCC_CFGR2_PREDIV1)
|
#if defined(RCC_CFGR2_PREDIV1)
|
||||||
|
#define LL_RCC_PLLSOURCE_HSE_DIV_1 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV1) /*!< HSE/1 clock selected as PLL entry clock source */
|
||||||
#define LL_RCC_PLLSOURCE_HSE_DIV_2 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV2) /*!< HSE/2 clock selected as PLL entry clock source */
|
#define LL_RCC_PLLSOURCE_HSE_DIV_2 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV2) /*!< HSE/2 clock selected as PLL entry clock source */
|
||||||
#define LL_RCC_PLLSOURCE_HSE_DIV_3 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV3) /*!< HSE/3 clock selected as PLL entry clock source */
|
#define LL_RCC_PLLSOURCE_HSE_DIV_3 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV3) /*!< HSE/3 clock selected as PLL entry clock source */
|
||||||
#define LL_RCC_PLLSOURCE_HSE_DIV_4 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV4) /*!< HSE/4 clock selected as PLL entry clock source */
|
#define LL_RCC_PLLSOURCE_HSE_DIV_4 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV4) /*!< HSE/4 clock selected as PLL entry clock source */
|
||||||
@@ -442,6 +440,7 @@ typedef struct
|
|||||||
#define LL_RCC_PLLSOURCE_HSE_DIV_15 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV15) /*!< HSE/15 clock selected as PLL entry clock source */
|
#define LL_RCC_PLLSOURCE_HSE_DIV_15 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV15) /*!< HSE/15 clock selected as PLL entry clock source */
|
||||||
#define LL_RCC_PLLSOURCE_HSE_DIV_16 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV16) /*!< HSE/16 clock selected as PLL entry clock source */
|
#define LL_RCC_PLLSOURCE_HSE_DIV_16 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV16) /*!< HSE/16 clock selected as PLL entry clock source */
|
||||||
#if defined(RCC_CFGR2_PREDIV1SRC)
|
#if defined(RCC_CFGR2_PREDIV1SRC)
|
||||||
|
#define LL_RCC_PLLSOURCE_PLL2_DIV_1 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV1 | RCC_CFGR2_PREDIV1SRC << 4U) /*!< PLL2/1 clock selected as PLL entry clock source */
|
||||||
#define LL_RCC_PLLSOURCE_PLL2_DIV_2 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV2 | RCC_CFGR2_PREDIV1SRC << 4U) /*!< PLL2/2 clock selected as PLL entry clock source */
|
#define LL_RCC_PLLSOURCE_PLL2_DIV_2 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV2 | RCC_CFGR2_PREDIV1SRC << 4U) /*!< PLL2/2 clock selected as PLL entry clock source */
|
||||||
#define LL_RCC_PLLSOURCE_PLL2_DIV_3 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV3 | RCC_CFGR2_PREDIV1SRC << 4U) /*!< PLL2/3 clock selected as PLL entry clock source */
|
#define LL_RCC_PLLSOURCE_PLL2_DIV_3 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV3 | RCC_CFGR2_PREDIV1SRC << 4U) /*!< PLL2/3 clock selected as PLL entry clock source */
|
||||||
#define LL_RCC_PLLSOURCE_PLL2_DIV_4 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV4 | RCC_CFGR2_PREDIV1SRC << 4U) /*!< PLL2/4 clock selected as PLL entry clock source */
|
#define LL_RCC_PLLSOURCE_PLL2_DIV_4 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV4 | RCC_CFGR2_PREDIV1SRC << 4U) /*!< PLL2/4 clock selected as PLL entry clock source */
|
||||||
@@ -459,6 +458,7 @@ typedef struct
|
|||||||
#define LL_RCC_PLLSOURCE_PLL2_DIV_16 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV16 | RCC_CFGR2_PREDIV1SRC << 4U) /*!< PLL2/16 clock selected as PLL entry clock source */
|
#define LL_RCC_PLLSOURCE_PLL2_DIV_16 (RCC_CFGR_PLLSRC | RCC_CFGR2_PREDIV1_DIV16 | RCC_CFGR2_PREDIV1SRC << 4U) /*!< PLL2/16 clock selected as PLL entry clock source */
|
||||||
#endif /*RCC_CFGR2_PREDIV1SRC*/
|
#endif /*RCC_CFGR2_PREDIV1SRC*/
|
||||||
#else
|
#else
|
||||||
|
#define LL_RCC_PLLSOURCE_HSE_DIV_1 (RCC_CFGR_PLLSRC | 0x00000000U) /*!< HSE/1 clock selected as PLL entry clock source */
|
||||||
#define LL_RCC_PLLSOURCE_HSE_DIV_2 (RCC_CFGR_PLLSRC | RCC_CFGR_PLLXTPRE) /*!< HSE/2 clock selected as PLL entry clock source */
|
#define LL_RCC_PLLSOURCE_HSE_DIV_2 (RCC_CFGR_PLLSRC | RCC_CFGR_PLLXTPRE) /*!< HSE/2 clock selected as PLL entry clock source */
|
||||||
#endif /*RCC_CFGR2_PREDIV1*/
|
#endif /*RCC_CFGR2_PREDIV1*/
|
||||||
/**
|
/**
|
||||||
@@ -1451,6 +1451,7 @@ __STATIC_INLINE uint32_t LL_RCC_PLL_IsReady(void)
|
|||||||
* @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_14 (*)
|
* @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_14 (*)
|
||||||
* @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_15 (*)
|
* @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_15 (*)
|
||||||
* @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_16 (*)
|
* @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_16 (*)
|
||||||
|
* @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_1 (*)
|
||||||
* @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_2 (*)
|
* @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_2 (*)
|
||||||
* @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_3 (*)
|
* @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_3 (*)
|
||||||
* @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_4 (*)
|
* @arg @ref LL_RCC_PLLSOURCE_PLL2_DIV_4 (*)
|
||||||
@@ -1503,6 +1504,24 @@ __STATIC_INLINE void LL_RCC_PLL_ConfigDomain_SYS(uint32_t Source, uint32_t PLLMu
|
|||||||
#endif /*RCC_CFGR2_PREDIV1*/
|
#endif /*RCC_CFGR2_PREDIV1*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Configure PLL clock source
|
||||||
|
* @rmtoll CFGR PLLSRC LL_RCC_PLL_SetMainSource\n
|
||||||
|
* CFGR2 PREDIV1SRC LL_RCC_PLL_SetMainSource
|
||||||
|
* @param PLLSource This parameter can be one of the following values:
|
||||||
|
* @arg @ref LL_RCC_PLLSOURCE_HSI_DIV_2
|
||||||
|
* @arg @ref LL_RCC_PLLSOURCE_HSE
|
||||||
|
* @arg @ref LL_RCC_PLLSOURCE_PLL2 (*)
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_RCC_PLL_SetMainSource(uint32_t PLLSource)
|
||||||
|
{
|
||||||
|
#if defined(RCC_CFGR2_PREDIV1SRC)
|
||||||
|
MODIFY_REG(RCC->CFGR2, RCC_CFGR2_PREDIV1SRC, ((PLLSource & (RCC_CFGR2_PREDIV1SRC << 4U)) >> 4U));
|
||||||
|
#endif /* RCC_CFGR2_PREDIV1SRC */
|
||||||
|
MODIFY_REG(RCC->CFGR, RCC_CFGR_PLLSRC, PLLSource);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the oscillator used as PLL clock source.
|
* @brief Get the oscillator used as PLL clock source.
|
||||||
* @rmtoll CFGR PLLSRC LL_RCC_PLL_GetMainSource\n
|
* @rmtoll CFGR PLLSRC LL_RCC_PLL_GetMainSource\n
|
||||||
@@ -1583,7 +1602,7 @@ __STATIC_INLINE uint32_t LL_RCC_PLL_GetPrediv(void)
|
|||||||
#if defined(RCC_CFGR2_PREDIV1)
|
#if defined(RCC_CFGR2_PREDIV1)
|
||||||
return (uint32_t)(READ_BIT(RCC->CFGR2, RCC_CFGR2_PREDIV1));
|
return (uint32_t)(READ_BIT(RCC->CFGR2, RCC_CFGR2_PREDIV1));
|
||||||
#else
|
#else
|
||||||
return (uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_PLLXTPRE));
|
return (uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_PLLXTPRE) >> RCC_CFGR_PLLXTPRE_Pos);
|
||||||
#endif /*RCC_CFGR2_PREDIV1*/
|
#endif /*RCC_CFGR2_PREDIV1*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_ll_rtc.h
|
* @file stm32f1xx_ll_rtc.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of RTC LL module.
|
* @brief Header file of RTC LL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_ll_sdmmc.h
|
* @file stm32f1xx_ll_sdmmc.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of low layer SDMMC HAL module.
|
* @brief Header file of low layer SDMMC HAL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_ll_spi.h
|
* @file stm32f1xx_ll_spi.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of SPI LL module.
|
* @brief Header file of SPI LL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_ll_system.h
|
* @file stm32f1xx_ll_system.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of SYSTEM LL module.
|
* @brief Header file of SYSTEM LL module.
|
||||||
@verbatim
|
@verbatim
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_ll_tim.h
|
* @file stm32f1xx_ll_tim.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of TIM LL module.
|
* @brief Header file of TIM LL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
@@ -1059,7 +1057,7 @@ __STATIC_INLINE uint32_t LL_TIM_IsEnabledCounter(TIM_TypeDef *TIMx)
|
|||||||
*/
|
*/
|
||||||
__STATIC_INLINE void LL_TIM_EnableUpdateEvent(TIM_TypeDef *TIMx)
|
__STATIC_INLINE void LL_TIM_EnableUpdateEvent(TIM_TypeDef *TIMx)
|
||||||
{
|
{
|
||||||
SET_BIT(TIMx->CR1, TIM_CR1_UDIS);
|
CLEAR_BIT(TIMx->CR1, TIM_CR1_UDIS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1070,7 +1068,7 @@ __STATIC_INLINE void LL_TIM_EnableUpdateEvent(TIM_TypeDef *TIMx)
|
|||||||
*/
|
*/
|
||||||
__STATIC_INLINE void LL_TIM_DisableUpdateEvent(TIM_TypeDef *TIMx)
|
__STATIC_INLINE void LL_TIM_DisableUpdateEvent(TIM_TypeDef *TIMx)
|
||||||
{
|
{
|
||||||
CLEAR_BIT(TIMx->CR1, TIM_CR1_UDIS);
|
SET_BIT(TIMx->CR1, TIM_CR1_UDIS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1150,6 +1148,9 @@ __STATIC_INLINE uint32_t LL_TIM_GetOnePulseMode(TIM_TypeDef *TIMx)
|
|||||||
* @note Macro @ref IS_TIM_COUNTER_MODE_SELECT_INSTANCE(TIMx) can be used to
|
* @note Macro @ref IS_TIM_COUNTER_MODE_SELECT_INSTANCE(TIMx) can be used to
|
||||||
* check whether or not the counter mode selection feature is supported
|
* check whether or not the counter mode selection feature is supported
|
||||||
* by a timer instance.
|
* by a timer instance.
|
||||||
|
* @note Switching from Center Aligned counter mode to Edge counter mode (or reverse)
|
||||||
|
* requires a timer reset to avoid unexpected direction
|
||||||
|
* due to DIR bit readonly in center aligned mode.
|
||||||
* @rmtoll CR1 DIR LL_TIM_SetCounterMode\n
|
* @rmtoll CR1 DIR LL_TIM_SetCounterMode\n
|
||||||
* CR1 CMS LL_TIM_SetCounterMode
|
* CR1 CMS LL_TIM_SetCounterMode
|
||||||
* @param TIMx Timer instance
|
* @param TIMx Timer instance
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_ll_usart.h
|
* @file stm32f1xx_ll_usart.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of USART LL module.
|
* @brief Header file of USART LL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_ll_usb.h
|
* @file stm32f1xx_ll_usb.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of USB Low Layer HAL module.
|
* @brief Header file of USB Low Layer HAL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_ll_utils.h
|
* @file stm32f1xx_ll_utils.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of UTILS LL module.
|
* @brief Header file of UTILS LL module.
|
||||||
@verbatim
|
@verbatim
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_ll_wwdg.h
|
* @file stm32f1xx_ll_wwdg.h
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Header file of WWDG LL module.
|
* @brief Header file of WWDG LL module.
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @attention
|
* @attention
|
||||||
|
|||||||
1700
workspace/TS100/HAL_Driver/Src/Legacy/stm32f1xx_hal_can.c
Normal file
1700
workspace/TS100/HAL_Driver/Src/Legacy/stm32f1xx_hal_can.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal.c
|
* @file stm32f1xx_hal.c
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief HAL module driver.
|
* @brief HAL module driver.
|
||||||
* This is the common part of the HAL initialization
|
* This is the common part of the HAL initialization
|
||||||
*
|
*
|
||||||
@@ -71,11 +69,11 @@
|
|||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @brief STM32F1xx HAL Driver version number V1.1.1
|
* @brief STM32F1xx HAL Driver version number V1.1.3
|
||||||
*/
|
*/
|
||||||
#define __STM32F1xx_HAL_VERSION_MAIN (0x01U) /*!< [31:24] main version */
|
#define __STM32F1xx_HAL_VERSION_MAIN (0x01U) /*!< [31:24] main version */
|
||||||
#define __STM32F1xx_HAL_VERSION_SUB1 (0x01U) /*!< [23:16] sub1 version */
|
#define __STM32F1xx_HAL_VERSION_SUB1 (0x01U) /*!< [23:16] sub1 version */
|
||||||
#define __STM32F1xx_HAL_VERSION_SUB2 (0x01U) /*!< [15:8] sub2 version */
|
#define __STM32F1xx_HAL_VERSION_SUB2 (0x03U) /*!< [15:8] sub2 version */
|
||||||
#define __STM32F1xx_HAL_VERSION_RC (0x00U) /*!< [7:0] release candidate */
|
#define __STM32F1xx_HAL_VERSION_RC (0x00U) /*!< [7:0] release candidate */
|
||||||
#define __STM32F1xx_HAL_VERSION ((__STM32F1xx_HAL_VERSION_MAIN << 24)\
|
#define __STM32F1xx_HAL_VERSION ((__STM32F1xx_HAL_VERSION_MAIN << 24)\
|
||||||
|(__STM32F1xx_HAL_VERSION_SUB1 << 16)\
|
|(__STM32F1xx_HAL_VERSION_SUB1 << 16)\
|
||||||
@@ -95,6 +93,8 @@
|
|||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
__IO uint32_t uwTick;
|
__IO uint32_t uwTick;
|
||||||
|
uint32_t uwTickPrio = (1UL << __NVIC_PRIO_BITS); /* Invalid PRIO */
|
||||||
|
HAL_TickFreqTypeDef uwTickFreq = HAL_TICK_FREQ_DEFAULT; /* 1KHz */
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
@@ -114,12 +114,12 @@ __IO uint32_t uwTick;
|
|||||||
===============================================================================
|
===============================================================================
|
||||||
[..] This section provides functions allowing to:
|
[..] This section provides functions allowing to:
|
||||||
(+) Initializes the Flash interface, the NVIC allocation and initial clock
|
(+) Initializes the Flash interface, the NVIC allocation and initial clock
|
||||||
configuration. It initializes the source of time base also when timeout
|
configuration. It initializes the systick also when timeout is needed
|
||||||
is needed and the backup domain when enabled.
|
and the backup domain when enabled.
|
||||||
(+) de-Initializes common part of the HAL.
|
(+) de-Initializes common part of the HAL.
|
||||||
(+) Configure The time base source to have 1ms time base with a dedicated
|
(+) Configure The time base source to have 1ms time base with a dedicated
|
||||||
Tick interrupt priority.
|
Tick interrupt priority.
|
||||||
(++) Systick timer is used by default as source of time base, but user
|
(++) SysTick timer is used by default as source of time base, but user
|
||||||
can eventually implement his proper time base source (a general purpose
|
can eventually implement his proper time base source (a general purpose
|
||||||
timer for example or other time source), keeping in mind that Time base
|
timer for example or other time source), keeping in mind that Time base
|
||||||
duration should be kept 1ms since PPP_TIMEOUT_VALUEs are defined and
|
duration should be kept 1ms since PPP_TIMEOUT_VALUEs are defined and
|
||||||
@@ -172,7 +172,7 @@ HAL_StatusTypeDef HAL_Init(void)
|
|||||||
/* Set Interrupt Group Priority */
|
/* Set Interrupt Group Priority */
|
||||||
HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_4);
|
HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_4);
|
||||||
|
|
||||||
/* Use systick as time base source and configure 1ms tick (default clock after Reset is MSI) */
|
/* Use systick as time base source and configure 1ms tick (default clock after Reset is HSI) */
|
||||||
HAL_InitTick(TICK_INT_PRIORITY);
|
HAL_InitTick(TICK_INT_PRIORITY);
|
||||||
|
|
||||||
/* Init the low level hardware */
|
/* Init the low level hardware */
|
||||||
@@ -183,7 +183,7 @@ HAL_StatusTypeDef HAL_Init(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This function de-Initializes common part of the HAL and stops the source
|
* @brief This function de-Initializes common part of the HAL and stops the systick.
|
||||||
* of time base.
|
* of time base.
|
||||||
* @note This function is optional.
|
* @note This function is optional.
|
||||||
* @retval HAL status
|
* @retval HAL status
|
||||||
@@ -210,12 +210,12 @@ HAL_StatusTypeDef HAL_DeInit(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initializes the MSP.
|
* @brief Initialize the MSP.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
__weak void HAL_MspInit(void)
|
__weak void HAL_MspInit(void)
|
||||||
{
|
{
|
||||||
/* NOTE : This function Should not be modified, when the callback is needed,
|
/* NOTE : This function should not be modified, when the callback is needed,
|
||||||
the HAL_MspInit could be implemented in the user file
|
the HAL_MspInit could be implemented in the user file
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
@@ -226,7 +226,7 @@ __weak void HAL_MspInit(void)
|
|||||||
*/
|
*/
|
||||||
__weak void HAL_MspDeInit(void)
|
__weak void HAL_MspDeInit(void)
|
||||||
{
|
{
|
||||||
/* NOTE : This function Should not be modified, when the callback is needed,
|
/* NOTE : This function should not be modified, when the callback is needed,
|
||||||
the HAL_MspDeInit could be implemented in the user file
|
the HAL_MspDeInit could be implemented in the user file
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
@@ -240,20 +240,31 @@ __weak void HAL_MspDeInit(void)
|
|||||||
* @note In the default implementation, SysTick timer is the source of time base.
|
* @note In the default implementation, SysTick timer is the source of time base.
|
||||||
* It is used to generate interrupts at regular time intervals.
|
* It is used to generate interrupts at regular time intervals.
|
||||||
* Care must be taken if HAL_Delay() is called from a peripheral ISR process,
|
* Care must be taken if HAL_Delay() is called from a peripheral ISR process,
|
||||||
* The the SysTick interrupt must have higher priority (numerically lower)
|
* The SysTick interrupt must have higher priority (numerically lower)
|
||||||
* than the peripheral interrupt. Otherwise the caller ISR process will be blocked.
|
* than the peripheral interrupt. Otherwise the caller ISR process will be blocked.
|
||||||
* The function is declared as __weak to be overwritten in case of other
|
* The function is declared as __weak to be overwritten in case of other
|
||||||
* implementation in user file.
|
* implementation in user file.
|
||||||
* @param TickPriority: Tick interrupt priority.
|
* @param TickPriority Tick interrupt priority.
|
||||||
* @retval HAL status
|
* @retval HAL status
|
||||||
*/
|
*/
|
||||||
__weak HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
|
__weak HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
|
||||||
{
|
{
|
||||||
/*Configure the SysTick to have interrupt in 1ms time basis*/
|
/* Configure the SysTick to have interrupt in 1ms time basis*/
|
||||||
HAL_SYSTICK_Config(SystemCoreClock/1000U);
|
if (HAL_SYSTICK_Config(SystemCoreClock / (1000U / uwTickFreq)) > 0U)
|
||||||
|
{
|
||||||
|
return HAL_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
/*Configure the SysTick IRQ priority */
|
/* Configure the SysTick IRQ priority */
|
||||||
HAL_NVIC_SetPriority(SysTick_IRQn, TickPriority ,0U);
|
if (TickPriority < (1UL << __NVIC_PRIO_BITS))
|
||||||
|
{
|
||||||
|
HAL_NVIC_SetPriority(SysTick_IRQn, TickPriority, 0U);
|
||||||
|
uwTickPrio = TickPriority;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return HAL_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
/* Return function status */
|
/* Return function status */
|
||||||
return HAL_OK;
|
return HAL_OK;
|
||||||
@@ -290,14 +301,14 @@ __weak HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
|
|||||||
* @brief This function is called to increment a global variable "uwTick"
|
* @brief This function is called to increment a global variable "uwTick"
|
||||||
* used as application time base.
|
* used as application time base.
|
||||||
* @note In the default implementation, this variable is incremented each 1ms
|
* @note In the default implementation, this variable is incremented each 1ms
|
||||||
* in Systick ISR.
|
* in SysTick ISR.
|
||||||
* @note This function is declared as __weak to be overwritten in case of other
|
* @note This function is declared as __weak to be overwritten in case of other
|
||||||
* implementations in user file.
|
* implementations in user file.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
__weak void HAL_IncTick(void)
|
__weak void HAL_IncTick(void)
|
||||||
{
|
{
|
||||||
uwTick++;
|
uwTick += uwTickFreq;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -311,6 +322,44 @@ __weak uint32_t HAL_GetTick(void)
|
|||||||
return uwTick;
|
return uwTick;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function returns a tick priority.
|
||||||
|
* @retval tick priority
|
||||||
|
*/
|
||||||
|
uint32_t HAL_GetTickPrio(void)
|
||||||
|
{
|
||||||
|
return uwTickPrio;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Set new tick Freq.
|
||||||
|
* @retval Status
|
||||||
|
*/
|
||||||
|
HAL_StatusTypeDef HAL_SetTickFreq(HAL_TickFreqTypeDef Freq)
|
||||||
|
{
|
||||||
|
HAL_StatusTypeDef status = HAL_OK;
|
||||||
|
assert_param(IS_TICKFREQ(Freq));
|
||||||
|
|
||||||
|
if (uwTickFreq != Freq)
|
||||||
|
{
|
||||||
|
uwTickFreq = Freq;
|
||||||
|
|
||||||
|
/* Apply the new tick Freq */
|
||||||
|
status = HAL_InitTick(uwTickPrio);
|
||||||
|
}
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Return tick frequency.
|
||||||
|
* @retval tick period in Hz
|
||||||
|
*/
|
||||||
|
HAL_TickFreqTypeDef HAL_GetTickFreq(void)
|
||||||
|
{
|
||||||
|
return uwTickFreq;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This function provides minimum delay (in milliseconds) based
|
* @brief This function provides minimum delay (in milliseconds) based
|
||||||
* on variable incremented.
|
* on variable incremented.
|
||||||
@@ -319,21 +368,21 @@ __weak uint32_t HAL_GetTick(void)
|
|||||||
* is incremented.
|
* is incremented.
|
||||||
* @note This function is declared as __weak to be overwritten in case of other
|
* @note This function is declared as __weak to be overwritten in case of other
|
||||||
* implementations in user file.
|
* implementations in user file.
|
||||||
* @param Delay: specifies the delay time length, in milliseconds.
|
* @param Delay specifies the delay time length, in milliseconds.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
__weak void HAL_Delay(__IO uint32_t Delay)
|
__weak void HAL_Delay(uint32_t Delay)
|
||||||
{
|
{
|
||||||
uint32_t tickstart = HAL_GetTick();
|
uint32_t tickstart = HAL_GetTick();
|
||||||
uint32_t wait = Delay;
|
uint32_t wait = Delay;
|
||||||
|
|
||||||
/* Add a period to guarantee minimum wait */
|
/* Add a freq to guarantee minimum wait */
|
||||||
if (wait < HAL_MAX_DELAY)
|
if (wait < HAL_MAX_DELAY)
|
||||||
{
|
{
|
||||||
wait++;
|
wait += (uint32_t)(uwTickFreq);
|
||||||
}
|
}
|
||||||
|
|
||||||
while((HAL_GetTick() - tickstart) < wait)
|
while ((HAL_GetTick() - tickstart) < wait)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -351,7 +400,7 @@ __weak void HAL_Delay(__IO uint32_t Delay)
|
|||||||
__weak void HAL_SuspendTick(void)
|
__weak void HAL_SuspendTick(void)
|
||||||
{
|
{
|
||||||
/* Disable SysTick Interrupt */
|
/* Disable SysTick Interrupt */
|
||||||
CLEAR_BIT(SysTick->CTRL,SysTick_CTRL_TICKINT_Msk);
|
CLEAR_BIT(SysTick->CTRL, SysTick_CTRL_TICKINT_Msk);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -367,12 +416,12 @@ __weak void HAL_SuspendTick(void)
|
|||||||
__weak void HAL_ResumeTick(void)
|
__weak void HAL_ResumeTick(void)
|
||||||
{
|
{
|
||||||
/* Enable SysTick Interrupt */
|
/* Enable SysTick Interrupt */
|
||||||
SET_BIT(SysTick->CTRL,SysTick_CTRL_TICKINT_Msk);
|
SET_BIT(SysTick->CTRL, SysTick_CTRL_TICKINT_Msk);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns the HAL revision
|
* @brief Returns the HAL revision
|
||||||
* @retval version : 0xXYZR (8bits for each decimal, R for RC)
|
* @retval version 0xXYZR (8bits for each decimal, R for RC)
|
||||||
*/
|
*/
|
||||||
uint32_t HAL_GetHalVersion(void)
|
uint32_t HAL_GetHalVersion(void)
|
||||||
{
|
{
|
||||||
@@ -392,7 +441,7 @@ uint32_t HAL_GetHalVersion(void)
|
|||||||
*/
|
*/
|
||||||
uint32_t HAL_GetREVID(void)
|
uint32_t HAL_GetREVID(void)
|
||||||
{
|
{
|
||||||
return((DBGMCU->IDCODE) >> DBGMCU_IDCODE_REV_ID_Pos);
|
return ((DBGMCU->IDCODE) >> DBGMCU_IDCODE_REV_ID_Pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -408,7 +457,7 @@ uint32_t HAL_GetREVID(void)
|
|||||||
*/
|
*/
|
||||||
uint32_t HAL_GetDEVID(void)
|
uint32_t HAL_GetDEVID(void)
|
||||||
{
|
{
|
||||||
return((DBGMCU->IDCODE) & IDCODE_DEVID_MASK);
|
return ((DBGMCU->IDCODE) & IDCODE_DEVID_MASK);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -516,7 +565,7 @@ void HAL_DBGMCU_DisableDBGStandbyMode(void)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Return the unique device identifier (UID based on 96 bits)
|
* @brief Return the unique device identifier (UID based on 96 bits)
|
||||||
* @param UID: pointer to 3 words array.
|
* @param UID pointer to 3 words array.
|
||||||
* @retval Device identifier
|
* @retval Device identifier
|
||||||
*/
|
*/
|
||||||
void HAL_GetUID(uint32_t *UID)
|
void HAL_GetUID(uint32_t *UID)
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_adc.c
|
* @file stm32f1xx_hal_adc.c
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief This file provides firmware functions to manage the following
|
* @brief This file provides firmware functions to manage the following
|
||||||
* functionalities of the Analog to Digital Convertor (ADC)
|
* functionalities of the Analog to Digital Convertor (ADC)
|
||||||
* peripheral:
|
* peripheral:
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_adc_ex.c
|
* @file stm32f1xx_hal_adc_ex.c
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief This file provides firmware functions to manage the following
|
* @brief This file provides firmware functions to manage the following
|
||||||
* functionalities of the Analog to Digital Convertor (ADC)
|
* functionalities of the Analog to Digital Convertor (ADC)
|
||||||
* peripheral:
|
* peripheral:
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_cec.c
|
* @file stm32f1xx_hal_cec.c
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief CEC HAL module driver.
|
* @brief CEC HAL module driver.
|
||||||
* This file provides firmware functions to manage the following
|
* This file provides firmware functions to manage the following
|
||||||
* functionalities of the High Definition Multimedia Interface
|
* functionalities of the High Definition Multimedia Interface
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_cortex.c
|
* @file stm32f1xx_hal_cortex.c
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief CORTEX HAL module driver.
|
* @brief CORTEX HAL module driver.
|
||||||
* This file provides firmware functions to manage the following
|
* This file provides firmware functions to manage the following
|
||||||
* functionalities of the CORTEX:
|
* functionalities of the CORTEX:
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_crc.c
|
* @file stm32f1xx_hal_crc.c
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief CRC HAL module driver.
|
* @brief CRC HAL module driver.
|
||||||
* This file provides firmware functions to manage the following
|
* This file provides firmware functions to manage the following
|
||||||
* functionalities of the Cyclic Redundancy Check (CRC) peripheral:
|
* functionalities of the Cyclic Redundancy Check (CRC) peripheral:
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_dac.c
|
* @file stm32f1xx_hal_dac.c
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief DAC HAL module driver.
|
* @brief DAC HAL module driver.
|
||||||
* This file provides firmware functions to manage the following
|
* This file provides firmware functions to manage the following
|
||||||
* functionalities of the Digital to Analog Converter (DAC) peripheral:
|
* functionalities of the Digital to Analog Converter (DAC) peripheral:
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_dac_ex.c
|
* @file stm32f1xx_hal_dac_ex.c
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief DAC HAL module driver.
|
* @brief DAC HAL module driver.
|
||||||
* This file provides firmware functions to manage the following
|
* This file provides firmware functions to manage the following
|
||||||
* functionalities of DAC extension peripheral:
|
* functionalities of DAC extension peripheral:
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_dma.c
|
* @file stm32f1xx_hal_dma.c
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief DMA HAL module driver.
|
* @brief DMA HAL module driver.
|
||||||
* This file provides firmware functions to manage the following
|
* This file provides firmware functions to manage the following
|
||||||
* functionalities of the Direct Memory Access (DMA) peripheral:
|
* functionalities of the Direct Memory Access (DMA) peripheral:
|
||||||
@@ -218,13 +216,6 @@ HAL_StatusTypeDef HAL_DMA_Init(DMA_HandleTypeDef *hdma)
|
|||||||
/* Write to DMA Channel CR register */
|
/* Write to DMA Channel CR register */
|
||||||
hdma->Instance->CCR = tmp;
|
hdma->Instance->CCR = tmp;
|
||||||
|
|
||||||
|
|
||||||
/* Clean callbacks */
|
|
||||||
hdma->XferCpltCallback = NULL;
|
|
||||||
hdma->XferHalfCpltCallback = NULL;
|
|
||||||
hdma->XferErrorCallback = NULL;
|
|
||||||
hdma->XferAbortCallback = NULL;
|
|
||||||
|
|
||||||
/* Initialise the error code */
|
/* Initialise the error code */
|
||||||
hdma->ErrorCode = HAL_DMA_ERROR_NONE;
|
hdma->ErrorCode = HAL_DMA_ERROR_NONE;
|
||||||
|
|
||||||
@@ -291,10 +282,16 @@ HAL_StatusTypeDef HAL_DMA_DeInit(DMA_HandleTypeDef *hdma)
|
|||||||
/* Clear all flags */
|
/* Clear all flags */
|
||||||
hdma->DmaBaseAddress->IFCR = (DMA_ISR_GIF1 << (hdma->ChannelIndex));
|
hdma->DmaBaseAddress->IFCR = (DMA_ISR_GIF1 << (hdma->ChannelIndex));
|
||||||
|
|
||||||
/* Initialize the error code */
|
/* Clean all callbacks */
|
||||||
|
hdma->XferCpltCallback = NULL;
|
||||||
|
hdma->XferHalfCpltCallback = NULL;
|
||||||
|
hdma->XferErrorCallback = NULL;
|
||||||
|
hdma->XferAbortCallback = NULL;
|
||||||
|
|
||||||
|
/* Reset the error code */
|
||||||
hdma->ErrorCode = HAL_DMA_ERROR_NONE;
|
hdma->ErrorCode = HAL_DMA_ERROR_NONE;
|
||||||
|
|
||||||
/* Initialize the DMA state */
|
/* Reset the DMA state */
|
||||||
hdma->State = HAL_DMA_STATE_RESET;
|
hdma->State = HAL_DMA_STATE_RESET;
|
||||||
|
|
||||||
/* Release Lock */
|
/* Release Lock */
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_eth.c
|
* @file stm32f1xx_hal_eth.c
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief ETH HAL module driver.
|
* @brief ETH HAL module driver.
|
||||||
* This file provides firmware functions to manage the following
|
* This file provides firmware functions to manage the following
|
||||||
* functionalities of the Ethernet (ETH) peripheral:
|
* functionalities of the Ethernet (ETH) peripheral:
|
||||||
@@ -183,7 +181,7 @@ HAL_StatusTypeDef HAL_ETH_Init(ETH_HandleTypeDef *heth)
|
|||||||
uint32_t err = ETH_SUCCESS;
|
uint32_t err = ETH_SUCCESS;
|
||||||
|
|
||||||
/* Check the ETH peripheral state */
|
/* Check the ETH peripheral state */
|
||||||
if(heth == NULL)
|
if (heth == NULL)
|
||||||
{
|
{
|
||||||
return HAL_ERROR;
|
return HAL_ERROR;
|
||||||
}
|
}
|
||||||
@@ -194,7 +192,7 @@ HAL_StatusTypeDef HAL_ETH_Init(ETH_HandleTypeDef *heth)
|
|||||||
assert_param(IS_ETH_CHECKSUM_MODE(heth->Init.ChecksumMode));
|
assert_param(IS_ETH_CHECKSUM_MODE(heth->Init.ChecksumMode));
|
||||||
assert_param(IS_ETH_MEDIA_INTERFACE(heth->Init.MediaInterface));
|
assert_param(IS_ETH_MEDIA_INTERFACE(heth->Init.MediaInterface));
|
||||||
|
|
||||||
if(heth->State == HAL_ETH_STATE_RESET)
|
if (heth->State == HAL_ETH_STATE_RESET)
|
||||||
{
|
{
|
||||||
/* Allocate lock resource and initialize it */
|
/* Allocate lock resource and initialize it */
|
||||||
heth->Lock = HAL_UNLOCKED;
|
heth->Lock = HAL_UNLOCKED;
|
||||||
@@ -218,9 +216,9 @@ HAL_StatusTypeDef HAL_ETH_Init(ETH_HandleTypeDef *heth)
|
|||||||
while (((heth->Instance)->DMABMR & ETH_DMABMR_SR) != (uint32_t)RESET)
|
while (((heth->Instance)->DMABMR & ETH_DMABMR_SR) != (uint32_t)RESET)
|
||||||
{
|
{
|
||||||
/* Check for the Timeout */
|
/* Check for the Timeout */
|
||||||
if((HAL_GetTick() - tickstart ) > ETH_TIMEOUT_SWRESET)
|
if ((HAL_GetTick() - tickstart) > ETH_TIMEOUT_SWRESET)
|
||||||
{
|
{
|
||||||
heth->State= HAL_ETH_STATE_TIMEOUT;
|
heth->State = HAL_ETH_STATE_TIMEOUT;
|
||||||
|
|
||||||
/* Process Unlocked */
|
/* Process Unlocked */
|
||||||
__HAL_UNLOCK(heth);
|
__HAL_UNLOCK(heth);
|
||||||
@@ -241,12 +239,12 @@ HAL_StatusTypeDef HAL_ETH_Init(ETH_HandleTypeDef *heth)
|
|||||||
hclk = HAL_RCC_GetHCLKFreq();
|
hclk = HAL_RCC_GetHCLKFreq();
|
||||||
|
|
||||||
/* Set CR bits depending on hclk value */
|
/* Set CR bits depending on hclk value */
|
||||||
if((hclk >= 20000000U)&&(hclk < 35000000U))
|
if ((hclk >= 20000000U) && (hclk < 35000000U))
|
||||||
{
|
{
|
||||||
/* CSR Clock Range between 20-35 MHz */
|
/* CSR Clock Range between 20-35 MHz */
|
||||||
tmpreg1 |= (uint32_t)ETH_MACMIIAR_CR_DIV16;
|
tmpreg1 |= (uint32_t)ETH_MACMIIAR_CR_DIV16;
|
||||||
}
|
}
|
||||||
else if((hclk >= 35000000U)&&(hclk < 60000000U))
|
else if ((hclk >= 35000000U) && (hclk < 60000000U))
|
||||||
{
|
{
|
||||||
/* CSR Clock Range between 35-60 MHz */
|
/* CSR Clock Range between 35-60 MHz */
|
||||||
tmpreg1 |= (uint32_t)ETH_MACMIIAR_CR_DIV26;
|
tmpreg1 |= (uint32_t)ETH_MACMIIAR_CR_DIV26;
|
||||||
@@ -262,7 +260,7 @@ HAL_StatusTypeDef HAL_ETH_Init(ETH_HandleTypeDef *heth)
|
|||||||
|
|
||||||
/*-------------------- PHY initialization and configuration ----------------*/
|
/*-------------------- PHY initialization and configuration ----------------*/
|
||||||
/* Put the PHY in reset mode */
|
/* Put the PHY in reset mode */
|
||||||
if((HAL_ETH_WritePHYRegister(heth, PHY_BCR, PHY_RESET)) != HAL_OK)
|
if ((HAL_ETH_WritePHYRegister(heth, PHY_BCR, PHY_RESET)) != HAL_OK)
|
||||||
{
|
{
|
||||||
/* In case of write timeout */
|
/* In case of write timeout */
|
||||||
err = ETH_ERROR;
|
err = ETH_ERROR;
|
||||||
@@ -280,7 +278,7 @@ HAL_StatusTypeDef HAL_ETH_Init(ETH_HandleTypeDef *heth)
|
|||||||
/* Delay to assure PHY reset */
|
/* Delay to assure PHY reset */
|
||||||
HAL_Delay(PHY_RESET_DELAY);
|
HAL_Delay(PHY_RESET_DELAY);
|
||||||
|
|
||||||
if((heth->Init).AutoNegotiation != ETH_AUTONEGOTIATION_DISABLE)
|
if ((heth->Init).AutoNegotiation != ETH_AUTONEGOTIATION_DISABLE)
|
||||||
{
|
{
|
||||||
/* Get tick */
|
/* Get tick */
|
||||||
tickstart = HAL_GetTick();
|
tickstart = HAL_GetTick();
|
||||||
@@ -291,7 +289,7 @@ HAL_StatusTypeDef HAL_ETH_Init(ETH_HandleTypeDef *heth)
|
|||||||
HAL_ETH_ReadPHYRegister(heth, PHY_BSR, &phyreg);
|
HAL_ETH_ReadPHYRegister(heth, PHY_BSR, &phyreg);
|
||||||
|
|
||||||
/* Check for the Timeout */
|
/* Check for the Timeout */
|
||||||
if((HAL_GetTick() - tickstart ) > ETH_TIMEOUT_LINKED_STATE)
|
if ((HAL_GetTick() - tickstart) > ETH_TIMEOUT_LINKED_STATE)
|
||||||
{
|
{
|
||||||
/* In case of write timeout */
|
/* In case of write timeout */
|
||||||
err = ETH_ERROR;
|
err = ETH_ERROR;
|
||||||
@@ -299,18 +297,19 @@ HAL_StatusTypeDef HAL_ETH_Init(ETH_HandleTypeDef *heth)
|
|||||||
/* Config MAC and DMA */
|
/* Config MAC and DMA */
|
||||||
ETH_MACDMAConfig(heth, err);
|
ETH_MACDMAConfig(heth, err);
|
||||||
|
|
||||||
heth->State= HAL_ETH_STATE_READY;
|
heth->State = HAL_ETH_STATE_READY;
|
||||||
|
|
||||||
/* Process Unlocked */
|
/* Process Unlocked */
|
||||||
__HAL_UNLOCK(heth);
|
__HAL_UNLOCK(heth);
|
||||||
|
|
||||||
return HAL_TIMEOUT;
|
return HAL_TIMEOUT;
|
||||||
}
|
}
|
||||||
} while (((phyreg & PHY_LINKED_STATUS) != PHY_LINKED_STATUS));
|
}
|
||||||
|
while (((phyreg & PHY_LINKED_STATUS) != PHY_LINKED_STATUS));
|
||||||
|
|
||||||
|
|
||||||
/* Enable Auto-Negotiation */
|
/* Enable Auto-Negotiation */
|
||||||
if((HAL_ETH_WritePHYRegister(heth, PHY_BCR, PHY_AUTONEGOTIATION)) != HAL_OK)
|
if ((HAL_ETH_WritePHYRegister(heth, PHY_BCR, PHY_AUTONEGOTIATION)) != HAL_OK)
|
||||||
{
|
{
|
||||||
/* In case of write timeout */
|
/* In case of write timeout */
|
||||||
err = ETH_ERROR;
|
err = ETH_ERROR;
|
||||||
@@ -334,7 +333,7 @@ HAL_StatusTypeDef HAL_ETH_Init(ETH_HandleTypeDef *heth)
|
|||||||
HAL_ETH_ReadPHYRegister(heth, PHY_BSR, &phyreg);
|
HAL_ETH_ReadPHYRegister(heth, PHY_BSR, &phyreg);
|
||||||
|
|
||||||
/* Check for the Timeout */
|
/* Check for the Timeout */
|
||||||
if((HAL_GetTick() - tickstart ) > ETH_TIMEOUT_AUTONEGO_COMPLETED)
|
if ((HAL_GetTick() - tickstart) > ETH_TIMEOUT_AUTONEGO_COMPLETED)
|
||||||
{
|
{
|
||||||
/* In case of write timeout */
|
/* In case of write timeout */
|
||||||
err = ETH_ERROR;
|
err = ETH_ERROR;
|
||||||
@@ -342,7 +341,7 @@ HAL_StatusTypeDef HAL_ETH_Init(ETH_HandleTypeDef *heth)
|
|||||||
/* Config MAC and DMA */
|
/* Config MAC and DMA */
|
||||||
ETH_MACDMAConfig(heth, err);
|
ETH_MACDMAConfig(heth, err);
|
||||||
|
|
||||||
heth->State= HAL_ETH_STATE_READY;
|
heth->State = HAL_ETH_STATE_READY;
|
||||||
|
|
||||||
/* Process Unlocked */
|
/* Process Unlocked */
|
||||||
__HAL_UNLOCK(heth);
|
__HAL_UNLOCK(heth);
|
||||||
@@ -350,10 +349,11 @@ HAL_StatusTypeDef HAL_ETH_Init(ETH_HandleTypeDef *heth)
|
|||||||
return HAL_TIMEOUT;
|
return HAL_TIMEOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
} while (((phyreg & PHY_AUTONEGO_COMPLETE) != PHY_AUTONEGO_COMPLETE));
|
}
|
||||||
|
while (((phyreg & PHY_AUTONEGO_COMPLETE) != PHY_AUTONEGO_COMPLETE));
|
||||||
|
|
||||||
/* Read the result of the auto-negotiation */
|
/* Read the result of the auto-negotiation */
|
||||||
if((HAL_ETH_ReadPHYRegister(heth, PHY_SR, &phyreg)) != HAL_OK)
|
if ((HAL_ETH_ReadPHYRegister(heth, PHY_SR, &phyreg)) != HAL_OK)
|
||||||
{
|
{
|
||||||
/* In case of write timeout */
|
/* In case of write timeout */
|
||||||
err = ETH_ERROR;
|
err = ETH_ERROR;
|
||||||
@@ -369,7 +369,7 @@ HAL_StatusTypeDef HAL_ETH_Init(ETH_HandleTypeDef *heth)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Configure the MAC with the Duplex Mode fixed by the auto-negotiation process */
|
/* Configure the MAC with the Duplex Mode fixed by the auto-negotiation process */
|
||||||
if((phyreg & PHY_DUPLEX_STATUS) != (uint32_t)RESET)
|
if ((phyreg & PHY_DUPLEX_STATUS) != (uint32_t)RESET)
|
||||||
{
|
{
|
||||||
/* Set Ethernet duplex mode to Full-duplex following the auto-negotiation */
|
/* Set Ethernet duplex mode to Full-duplex following the auto-negotiation */
|
||||||
(heth->Init).DuplexMode = ETH_MODE_FULLDUPLEX;
|
(heth->Init).DuplexMode = ETH_MODE_FULLDUPLEX;
|
||||||
@@ -380,7 +380,7 @@ HAL_StatusTypeDef HAL_ETH_Init(ETH_HandleTypeDef *heth)
|
|||||||
(heth->Init).DuplexMode = ETH_MODE_HALFDUPLEX;
|
(heth->Init).DuplexMode = ETH_MODE_HALFDUPLEX;
|
||||||
}
|
}
|
||||||
/* Configure the MAC with the speed fixed by the auto-negotiation process */
|
/* Configure the MAC with the speed fixed by the auto-negotiation process */
|
||||||
if((phyreg & PHY_SPEED_STATUS) == PHY_SPEED_STATUS)
|
if ((phyreg & PHY_SPEED_STATUS) == PHY_SPEED_STATUS)
|
||||||
{
|
{
|
||||||
/* Set Ethernet speed to 10M following the auto-negotiation */
|
/* Set Ethernet speed to 10M following the auto-negotiation */
|
||||||
(heth->Init).Speed = ETH_SPEED_10M;
|
(heth->Init).Speed = ETH_SPEED_10M;
|
||||||
@@ -398,7 +398,7 @@ HAL_StatusTypeDef HAL_ETH_Init(ETH_HandleTypeDef *heth)
|
|||||||
assert_param(IS_ETH_DUPLEX_MODE(heth->Init.DuplexMode));
|
assert_param(IS_ETH_DUPLEX_MODE(heth->Init.DuplexMode));
|
||||||
|
|
||||||
/* Set MAC Speed and Duplex Mode */
|
/* Set MAC Speed and Duplex Mode */
|
||||||
if(HAL_ETH_WritePHYRegister(heth, PHY_BCR, ((uint16_t)((heth->Init).DuplexMode >> 3U) |
|
if (HAL_ETH_WritePHYRegister(heth, PHY_BCR, ((uint16_t)((heth->Init).DuplexMode >> 3U) |
|
||||||
(uint16_t)((heth->Init).Speed >> 1U))) != HAL_OK)
|
(uint16_t)((heth->Init).Speed >> 1U))) != HAL_OK)
|
||||||
{
|
{
|
||||||
/* In case of write timeout */
|
/* In case of write timeout */
|
||||||
@@ -422,7 +422,7 @@ HAL_StatusTypeDef HAL_ETH_Init(ETH_HandleTypeDef *heth)
|
|||||||
ETH_MACDMAConfig(heth, err);
|
ETH_MACDMAConfig(heth, err);
|
||||||
|
|
||||||
/* Set ETH HAL State to Ready */
|
/* Set ETH HAL State to Ready */
|
||||||
heth->State= HAL_ETH_STATE_READY;
|
heth->State = HAL_ETH_STATE_READY;
|
||||||
|
|
||||||
/* Return function status */
|
/* Return function status */
|
||||||
return HAL_OK;
|
return HAL_OK;
|
||||||
@@ -443,7 +443,7 @@ HAL_StatusTypeDef HAL_ETH_DeInit(ETH_HandleTypeDef *heth)
|
|||||||
HAL_ETH_MspDeInit(heth);
|
HAL_ETH_MspDeInit(heth);
|
||||||
|
|
||||||
/* Set ETH HAL state to Disabled */
|
/* Set ETH HAL state to Disabled */
|
||||||
heth->State= HAL_ETH_STATE_RESET;
|
heth->State = HAL_ETH_STATE_RESET;
|
||||||
|
|
||||||
/* Release Lock */
|
/* Release Lock */
|
||||||
__HAL_UNLOCK(heth);
|
__HAL_UNLOCK(heth);
|
||||||
@@ -476,7 +476,7 @@ HAL_StatusTypeDef HAL_ETH_DMATxDescListInit(ETH_HandleTypeDef *heth, ETH_DMADesc
|
|||||||
heth->TxDesc = DMATxDescTab;
|
heth->TxDesc = DMATxDescTab;
|
||||||
|
|
||||||
/* Fill each DMATxDesc descriptor with the right values */
|
/* Fill each DMATxDesc descriptor with the right values */
|
||||||
for(i=0U; i < TxBuffCount; i++)
|
for (i = 0U; i < TxBuffCount; i++)
|
||||||
{
|
{
|
||||||
/* Get the pointer on the ith member of the Tx Desc list */
|
/* Get the pointer on the ith member of the Tx Desc list */
|
||||||
dmatxdesc = DMATxDescTab + i;
|
dmatxdesc = DMATxDescTab + i;
|
||||||
@@ -485,7 +485,7 @@ HAL_StatusTypeDef HAL_ETH_DMATxDescListInit(ETH_HandleTypeDef *heth, ETH_DMADesc
|
|||||||
dmatxdesc->Status = ETH_DMATXDESC_TCH;
|
dmatxdesc->Status = ETH_DMATXDESC_TCH;
|
||||||
|
|
||||||
/* Set Buffer1 address pointer */
|
/* Set Buffer1 address pointer */
|
||||||
dmatxdesc->Buffer1Addr = (uint32_t)(&TxBuff[i*ETH_TX_BUF_SIZE]);
|
dmatxdesc->Buffer1Addr = (uint32_t)(&TxBuff[i * ETH_TX_BUF_SIZE]);
|
||||||
|
|
||||||
if ((heth->Init).ChecksumMode == ETH_CHECKSUM_BY_HARDWARE)
|
if ((heth->Init).ChecksumMode == ETH_CHECKSUM_BY_HARDWARE)
|
||||||
{
|
{
|
||||||
@@ -494,10 +494,10 @@ HAL_StatusTypeDef HAL_ETH_DMATxDescListInit(ETH_HandleTypeDef *heth, ETH_DMADesc
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize the next descriptor with the Next Descriptor Polling Enable */
|
/* Initialize the next descriptor with the Next Descriptor Polling Enable */
|
||||||
if(i < (TxBuffCount-1U))
|
if (i < (TxBuffCount - 1U))
|
||||||
{
|
{
|
||||||
/* Set next descriptor address register with next descriptor base address */
|
/* Set next descriptor address register with next descriptor base address */
|
||||||
dmatxdesc->Buffer2NextDescAddr = (uint32_t)(DMATxDescTab+i+1U);
|
dmatxdesc->Buffer2NextDescAddr = (uint32_t)(DMATxDescTab + i + 1U);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -510,7 +510,7 @@ HAL_StatusTypeDef HAL_ETH_DMATxDescListInit(ETH_HandleTypeDef *heth, ETH_DMADesc
|
|||||||
(heth->Instance)->DMATDLAR = (uint32_t) DMATxDescTab;
|
(heth->Instance)->DMATDLAR = (uint32_t) DMATxDescTab;
|
||||||
|
|
||||||
/* Set ETH HAL State to Ready */
|
/* Set ETH HAL State to Ready */
|
||||||
heth->State= HAL_ETH_STATE_READY;
|
heth->State = HAL_ETH_STATE_READY;
|
||||||
|
|
||||||
/* Process Unlocked */
|
/* Process Unlocked */
|
||||||
__HAL_UNLOCK(heth);
|
__HAL_UNLOCK(heth);
|
||||||
@@ -543,10 +543,10 @@ HAL_StatusTypeDef HAL_ETH_DMARxDescListInit(ETH_HandleTypeDef *heth, ETH_DMADesc
|
|||||||
heth->RxDesc = DMARxDescTab;
|
heth->RxDesc = DMARxDescTab;
|
||||||
|
|
||||||
/* Fill each DMARxDesc descriptor with the right values */
|
/* Fill each DMARxDesc descriptor with the right values */
|
||||||
for(i=0U; i < RxBuffCount; i++)
|
for (i = 0U; i < RxBuffCount; i++)
|
||||||
{
|
{
|
||||||
/* Get the pointer on the ith member of the Rx Desc list */
|
/* Get the pointer on the ith member of the Rx Desc list */
|
||||||
DMARxDesc = DMARxDescTab+i;
|
DMARxDesc = DMARxDescTab + i;
|
||||||
|
|
||||||
/* Set Own bit of the Rx descriptor Status */
|
/* Set Own bit of the Rx descriptor Status */
|
||||||
DMARxDesc->Status = ETH_DMARXDESC_OWN;
|
DMARxDesc->Status = ETH_DMARXDESC_OWN;
|
||||||
@@ -555,19 +555,19 @@ HAL_StatusTypeDef HAL_ETH_DMARxDescListInit(ETH_HandleTypeDef *heth, ETH_DMADesc
|
|||||||
DMARxDesc->ControlBufferSize = ETH_DMARXDESC_RCH | ETH_RX_BUF_SIZE;
|
DMARxDesc->ControlBufferSize = ETH_DMARXDESC_RCH | ETH_RX_BUF_SIZE;
|
||||||
|
|
||||||
/* Set Buffer1 address pointer */
|
/* Set Buffer1 address pointer */
|
||||||
DMARxDesc->Buffer1Addr = (uint32_t)(&RxBuff[i*ETH_RX_BUF_SIZE]);
|
DMARxDesc->Buffer1Addr = (uint32_t)(&RxBuff[i * ETH_RX_BUF_SIZE]);
|
||||||
|
|
||||||
if((heth->Init).RxMode == ETH_RXINTERRUPT_MODE)
|
if ((heth->Init).RxMode == ETH_RXINTERRUPT_MODE)
|
||||||
{
|
{
|
||||||
/* Enable Ethernet DMA Rx Descriptor interrupt */
|
/* Enable Ethernet DMA Rx Descriptor interrupt */
|
||||||
DMARxDesc->ControlBufferSize &= ~ETH_DMARXDESC_DIC;
|
DMARxDesc->ControlBufferSize &= ~ETH_DMARXDESC_DIC;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize the next descriptor with the Next Descriptor Polling Enable */
|
/* Initialize the next descriptor with the Next Descriptor Polling Enable */
|
||||||
if(i < (RxBuffCount-1U))
|
if (i < (RxBuffCount - 1U))
|
||||||
{
|
{
|
||||||
/* Set next descriptor address register with next descriptor base address */
|
/* Set next descriptor address register with next descriptor base address */
|
||||||
DMARxDesc->Buffer2NextDescAddr = (uint32_t)(DMARxDescTab+i+1U);
|
DMARxDesc->Buffer2NextDescAddr = (uint32_t)(DMARxDescTab + i + 1U);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -580,7 +580,7 @@ HAL_StatusTypeDef HAL_ETH_DMARxDescListInit(ETH_HandleTypeDef *heth, ETH_DMADesc
|
|||||||
(heth->Instance)->DMARDLAR = (uint32_t) DMARxDescTab;
|
(heth->Instance)->DMARDLAR = (uint32_t) DMARxDescTab;
|
||||||
|
|
||||||
/* Set ETH HAL State to Ready */
|
/* Set ETH HAL State to Ready */
|
||||||
heth->State= HAL_ETH_STATE_READY;
|
heth->State = HAL_ETH_STATE_READY;
|
||||||
|
|
||||||
/* Process Unlocked */
|
/* Process Unlocked */
|
||||||
__HAL_UNLOCK(heth);
|
__HAL_UNLOCK(heth);
|
||||||
@@ -675,7 +675,7 @@ HAL_StatusTypeDef HAL_ETH_TransmitFrame(ETH_HandleTypeDef *heth, uint32_t FrameL
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Check if the descriptor is owned by the ETHERNET DMA (when set) or CPU (when reset) */
|
/* Check if the descriptor is owned by the ETHERNET DMA (when set) or CPU (when reset) */
|
||||||
if(((heth->TxDesc)->Status & ETH_DMATXDESC_OWN) != (uint32_t)RESET)
|
if (((heth->TxDesc)->Status & ETH_DMATXDESC_OWN) != (uint32_t)RESET)
|
||||||
{
|
{
|
||||||
/* OWN bit set */
|
/* OWN bit set */
|
||||||
heth->State = HAL_ETH_STATE_BUSY_TX;
|
heth->State = HAL_ETH_STATE_BUSY_TX;
|
||||||
@@ -689,7 +689,7 @@ HAL_StatusTypeDef HAL_ETH_TransmitFrame(ETH_HandleTypeDef *heth, uint32_t FrameL
|
|||||||
/* Get the number of needed Tx buffers for the current frame */
|
/* Get the number of needed Tx buffers for the current frame */
|
||||||
if (FrameLength > ETH_TX_BUF_SIZE)
|
if (FrameLength > ETH_TX_BUF_SIZE)
|
||||||
{
|
{
|
||||||
bufcount = FrameLength/ETH_TX_BUF_SIZE;
|
bufcount = FrameLength / ETH_TX_BUF_SIZE;
|
||||||
if (FrameLength % ETH_TX_BUF_SIZE)
|
if (FrameLength % ETH_TX_BUF_SIZE)
|
||||||
{
|
{
|
||||||
bufcount++;
|
bufcount++;
|
||||||
@@ -702,17 +702,17 @@ HAL_StatusTypeDef HAL_ETH_TransmitFrame(ETH_HandleTypeDef *heth, uint32_t FrameL
|
|||||||
if (bufcount == 1U)
|
if (bufcount == 1U)
|
||||||
{
|
{
|
||||||
/* Set LAST and FIRST segment */
|
/* Set LAST and FIRST segment */
|
||||||
heth->TxDesc->Status |=ETH_DMATXDESC_FS|ETH_DMATXDESC_LS;
|
heth->TxDesc->Status |= ETH_DMATXDESC_FS | ETH_DMATXDESC_LS;
|
||||||
/* Set frame size */
|
/* Set frame size */
|
||||||
heth->TxDesc->ControlBufferSize = (FrameLength & ETH_DMATXDESC_TBS1);
|
heth->TxDesc->ControlBufferSize = (FrameLength & ETH_DMATXDESC_TBS1);
|
||||||
/* Set Own bit of the Tx descriptor Status: gives the buffer back to ETHERNET DMA */
|
/* Set Own bit of the Tx descriptor Status: gives the buffer back to ETHERNET DMA */
|
||||||
heth->TxDesc->Status |= ETH_DMATXDESC_OWN;
|
heth->TxDesc->Status |= ETH_DMATXDESC_OWN;
|
||||||
/* Point to next descriptor */
|
/* Point to next descriptor */
|
||||||
heth->TxDesc= (ETH_DMADescTypeDef *)(heth->TxDesc->Buffer2NextDescAddr);
|
heth->TxDesc = (ETH_DMADescTypeDef *)(heth->TxDesc->Buffer2NextDescAddr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (i=0U; i< bufcount; i++)
|
for (i = 0U; i < bufcount; i++)
|
||||||
{
|
{
|
||||||
/* Clear FIRST and LAST segment bits */
|
/* Clear FIRST and LAST segment bits */
|
||||||
heth->TxDesc->Status &= ~(ETH_DMATXDESC_FS | ETH_DMATXDESC_LS);
|
heth->TxDesc->Status &= ~(ETH_DMATXDESC_FS | ETH_DMATXDESC_LS);
|
||||||
@@ -726,11 +726,11 @@ HAL_StatusTypeDef HAL_ETH_TransmitFrame(ETH_HandleTypeDef *heth, uint32_t FrameL
|
|||||||
/* Program size */
|
/* Program size */
|
||||||
heth->TxDesc->ControlBufferSize = (ETH_TX_BUF_SIZE & ETH_DMATXDESC_TBS1);
|
heth->TxDesc->ControlBufferSize = (ETH_TX_BUF_SIZE & ETH_DMATXDESC_TBS1);
|
||||||
|
|
||||||
if (i == (bufcount-1U))
|
if (i == (bufcount - 1U))
|
||||||
{
|
{
|
||||||
/* Setting the last segment bit */
|
/* Setting the last segment bit */
|
||||||
heth->TxDesc->Status |= ETH_DMATXDESC_LS;
|
heth->TxDesc->Status |= ETH_DMATXDESC_LS;
|
||||||
size = FrameLength - (bufcount-1U)*ETH_TX_BUF_SIZE;
|
size = FrameLength - (bufcount - 1U) * ETH_TX_BUF_SIZE;
|
||||||
heth->TxDesc->ControlBufferSize = (size & ETH_DMATXDESC_TBS1);
|
heth->TxDesc->ControlBufferSize = (size & ETH_DMATXDESC_TBS1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -778,10 +778,10 @@ HAL_StatusTypeDef HAL_ETH_GetReceivedFrame(ETH_HandleTypeDef *heth)
|
|||||||
|
|
||||||
/* Check if segment is not owned by DMA */
|
/* Check if segment is not owned by DMA */
|
||||||
/* (((heth->RxDesc->Status & ETH_DMARXDESC_OWN) == (uint32_t)RESET) && ((heth->RxDesc->Status & ETH_DMARXDESC_LS) != (uint32_t)RESET)) */
|
/* (((heth->RxDesc->Status & ETH_DMARXDESC_OWN) == (uint32_t)RESET) && ((heth->RxDesc->Status & ETH_DMARXDESC_LS) != (uint32_t)RESET)) */
|
||||||
if(((heth->RxDesc->Status & ETH_DMARXDESC_OWN) == (uint32_t)RESET))
|
if (((heth->RxDesc->Status & ETH_DMARXDESC_OWN) == (uint32_t)RESET))
|
||||||
{
|
{
|
||||||
/* Check if last segment */
|
/* Check if last segment */
|
||||||
if(((heth->RxDesc->Status & ETH_DMARXDESC_LS) != (uint32_t)RESET))
|
if (((heth->RxDesc->Status & ETH_DMARXDESC_LS) != (uint32_t)RESET))
|
||||||
{
|
{
|
||||||
/* increment segment count */
|
/* increment segment count */
|
||||||
(heth->RxFrameInfos).SegCount++;
|
(heth->RxFrameInfos).SegCount++;
|
||||||
@@ -789,7 +789,7 @@ HAL_StatusTypeDef HAL_ETH_GetReceivedFrame(ETH_HandleTypeDef *heth)
|
|||||||
/* Check if last segment is first segment: one segment contains the frame */
|
/* Check if last segment is first segment: one segment contains the frame */
|
||||||
if ((heth->RxFrameInfos).SegCount == 1U)
|
if ((heth->RxFrameInfos).SegCount == 1U)
|
||||||
{
|
{
|
||||||
(heth->RxFrameInfos).FSRxDesc =heth->RxDesc;
|
(heth->RxFrameInfos).FSRxDesc = heth->RxDesc;
|
||||||
}
|
}
|
||||||
|
|
||||||
heth->RxFrameInfos.LSRxDesc = heth->RxDesc;
|
heth->RxFrameInfos.LSRxDesc = heth->RxDesc;
|
||||||
@@ -801,7 +801,7 @@ HAL_StatusTypeDef HAL_ETH_GetReceivedFrame(ETH_HandleTypeDef *heth)
|
|||||||
/* Get the address of the buffer start address */
|
/* Get the address of the buffer start address */
|
||||||
heth->RxFrameInfos.buffer = ((heth->RxFrameInfos).FSRxDesc)->Buffer1Addr;
|
heth->RxFrameInfos.buffer = ((heth->RxFrameInfos).FSRxDesc)->Buffer1Addr;
|
||||||
/* point to next descriptor */
|
/* point to next descriptor */
|
||||||
heth->RxDesc = (ETH_DMADescTypeDef*) ((heth->RxDesc)->Buffer2NextDescAddr);
|
heth->RxDesc = (ETH_DMADescTypeDef *)((heth->RxDesc)->Buffer2NextDescAddr);
|
||||||
|
|
||||||
/* Set HAL State to Ready */
|
/* Set HAL State to Ready */
|
||||||
heth->State = HAL_ETH_STATE_READY;
|
heth->State = HAL_ETH_STATE_READY;
|
||||||
@@ -813,20 +813,20 @@ HAL_StatusTypeDef HAL_ETH_GetReceivedFrame(ETH_HandleTypeDef *heth)
|
|||||||
return HAL_OK;
|
return HAL_OK;
|
||||||
}
|
}
|
||||||
/* Check if first segment */
|
/* Check if first segment */
|
||||||
else if((heth->RxDesc->Status & ETH_DMARXDESC_FS) != (uint32_t)RESET)
|
else if ((heth->RxDesc->Status & ETH_DMARXDESC_FS) != (uint32_t)RESET)
|
||||||
{
|
{
|
||||||
(heth->RxFrameInfos).FSRxDesc = heth->RxDesc;
|
(heth->RxFrameInfos).FSRxDesc = heth->RxDesc;
|
||||||
(heth->RxFrameInfos).LSRxDesc = NULL;
|
(heth->RxFrameInfos).LSRxDesc = NULL;
|
||||||
(heth->RxFrameInfos).SegCount = 1U;
|
(heth->RxFrameInfos).SegCount = 1U;
|
||||||
/* Point to next descriptor */
|
/* Point to next descriptor */
|
||||||
heth->RxDesc = (ETH_DMADescTypeDef*) (heth->RxDesc->Buffer2NextDescAddr);
|
heth->RxDesc = (ETH_DMADescTypeDef *)(heth->RxDesc->Buffer2NextDescAddr);
|
||||||
}
|
}
|
||||||
/* Check if intermediate segment */
|
/* Check if intermediate segment */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
(heth->RxFrameInfos).SegCount++;
|
(heth->RxFrameInfos).SegCount++;
|
||||||
/* Point to next descriptor */
|
/* Point to next descriptor */
|
||||||
heth->RxDesc = (ETH_DMADescTypeDef*) (heth->RxDesc->Buffer2NextDescAddr);
|
heth->RxDesc = (ETH_DMADescTypeDef *)(heth->RxDesc->Buffer2NextDescAddr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -864,12 +864,12 @@ HAL_StatusTypeDef HAL_ETH_GetReceivedFrame_IT(ETH_HandleTypeDef *heth)
|
|||||||
|
|
||||||
/* Check if first segment in frame */
|
/* Check if first segment in frame */
|
||||||
/* ((heth->RxDesc->Status & ETH_DMARXDESC_FS) != (uint32_t)RESET) && ((heth->RxDesc->Status & ETH_DMARXDESC_LS) == (uint32_t)RESET)) */
|
/* ((heth->RxDesc->Status & ETH_DMARXDESC_FS) != (uint32_t)RESET) && ((heth->RxDesc->Status & ETH_DMARXDESC_LS) == (uint32_t)RESET)) */
|
||||||
if((heth->RxDesc->Status & (ETH_DMARXDESC_FS | ETH_DMARXDESC_LS)) == (uint32_t)ETH_DMARXDESC_FS)
|
if ((heth->RxDesc->Status & (ETH_DMARXDESC_FS | ETH_DMARXDESC_LS)) == (uint32_t)ETH_DMARXDESC_FS)
|
||||||
{
|
{
|
||||||
heth->RxFrameInfos.FSRxDesc = heth->RxDesc;
|
heth->RxFrameInfos.FSRxDesc = heth->RxDesc;
|
||||||
heth->RxFrameInfos.SegCount = 1U;
|
heth->RxFrameInfos.SegCount = 1U;
|
||||||
/* Point to next descriptor */
|
/* Point to next descriptor */
|
||||||
heth->RxDesc = (ETH_DMADescTypeDef*) (heth->RxDesc->Buffer2NextDescAddr);
|
heth->RxDesc = (ETH_DMADescTypeDef *)(heth->RxDesc->Buffer2NextDescAddr);
|
||||||
}
|
}
|
||||||
/* Check if intermediate segment */
|
/* Check if intermediate segment */
|
||||||
/* ((heth->RxDesc->Status & ETH_DMARXDESC_LS) == (uint32_t)RESET)&& ((heth->RxDesc->Status & ETH_DMARXDESC_FS) == (uint32_t)RESET)) */
|
/* ((heth->RxDesc->Status & ETH_DMARXDESC_LS) == (uint32_t)RESET)&& ((heth->RxDesc->Status & ETH_DMARXDESC_FS) == (uint32_t)RESET)) */
|
||||||
@@ -878,7 +878,7 @@ HAL_StatusTypeDef HAL_ETH_GetReceivedFrame_IT(ETH_HandleTypeDef *heth)
|
|||||||
/* Increment segment count */
|
/* Increment segment count */
|
||||||
(heth->RxFrameInfos.SegCount)++;
|
(heth->RxFrameInfos.SegCount)++;
|
||||||
/* Point to next descriptor */
|
/* Point to next descriptor */
|
||||||
heth->RxDesc = (ETH_DMADescTypeDef*)(heth->RxDesc->Buffer2NextDescAddr);
|
heth->RxDesc = (ETH_DMADescTypeDef *)(heth->RxDesc->Buffer2NextDescAddr);
|
||||||
}
|
}
|
||||||
/* Should be last segment */
|
/* Should be last segment */
|
||||||
else
|
else
|
||||||
@@ -899,10 +899,10 @@ HAL_StatusTypeDef HAL_ETH_GetReceivedFrame_IT(ETH_HandleTypeDef *heth)
|
|||||||
heth->RxFrameInfos.length = (((heth->RxDesc)->Status & ETH_DMARXDESC_FL) >> ETH_DMARXDESC_FRAMELENGTHSHIFT) - 4U;
|
heth->RxFrameInfos.length = (((heth->RxDesc)->Status & ETH_DMARXDESC_FL) >> ETH_DMARXDESC_FRAMELENGTHSHIFT) - 4U;
|
||||||
|
|
||||||
/* Get the address of the buffer start address */
|
/* Get the address of the buffer start address */
|
||||||
heth->RxFrameInfos.buffer =((heth->RxFrameInfos).FSRxDesc)->Buffer1Addr;
|
heth->RxFrameInfos.buffer = ((heth->RxFrameInfos).FSRxDesc)->Buffer1Addr;
|
||||||
|
|
||||||
/* Point to next descriptor */
|
/* Point to next descriptor */
|
||||||
heth->RxDesc = (ETH_DMADescTypeDef*) (heth->RxDesc->Buffer2NextDescAddr);
|
heth->RxDesc = (ETH_DMADescTypeDef *)(heth->RxDesc->Buffer2NextDescAddr);
|
||||||
|
|
||||||
/* Set HAL State to Ready */
|
/* Set HAL State to Ready */
|
||||||
heth->State = HAL_ETH_STATE_READY;
|
heth->State = HAL_ETH_STATE_READY;
|
||||||
@@ -969,7 +969,7 @@ void HAL_ETH_IRQHandler(ETH_HandleTypeDef *heth)
|
|||||||
__HAL_ETH_DMA_CLEAR_IT(heth, ETH_DMA_IT_NIS);
|
__HAL_ETH_DMA_CLEAR_IT(heth, ETH_DMA_IT_NIS);
|
||||||
|
|
||||||
/* ETH DMA Error */
|
/* ETH DMA Error */
|
||||||
if(__HAL_ETH_DMA_GET_FLAG(heth, ETH_DMA_FLAG_AIS))
|
if (__HAL_ETH_DMA_GET_FLAG(heth, ETH_DMA_FLAG_AIS))
|
||||||
{
|
{
|
||||||
/* Ethernet Error callback */
|
/* Ethernet Error callback */
|
||||||
HAL_ETH_ErrorCallback(heth);
|
HAL_ETH_ErrorCallback(heth);
|
||||||
@@ -1051,7 +1051,7 @@ HAL_StatusTypeDef HAL_ETH_ReadPHYRegister(ETH_HandleTypeDef *heth, uint16_t PHYR
|
|||||||
assert_param(IS_ETH_PHY_ADDRESS(heth->Init.PhyAddress));
|
assert_param(IS_ETH_PHY_ADDRESS(heth->Init.PhyAddress));
|
||||||
|
|
||||||
/* Check the ETH peripheral state */
|
/* Check the ETH peripheral state */
|
||||||
if(heth->State == HAL_ETH_STATE_BUSY_RD)
|
if (heth->State == HAL_ETH_STATE_BUSY_RD)
|
||||||
{
|
{
|
||||||
return HAL_BUSY;
|
return HAL_BUSY;
|
||||||
}
|
}
|
||||||
@@ -1065,8 +1065,8 @@ HAL_StatusTypeDef HAL_ETH_ReadPHYRegister(ETH_HandleTypeDef *heth, uint16_t PHYR
|
|||||||
tmpreg1 &= ~ETH_MACMIIAR_CR_MASK;
|
tmpreg1 &= ~ETH_MACMIIAR_CR_MASK;
|
||||||
|
|
||||||
/* Prepare the MII address register value */
|
/* Prepare the MII address register value */
|
||||||
tmpreg1 |=(((uint32_t)heth->Init.PhyAddress << 11U) & ETH_MACMIIAR_PA); /* Set the PHY device address */
|
tmpreg1 |= (((uint32_t)heth->Init.PhyAddress << 11U) & ETH_MACMIIAR_PA); /* Set the PHY device address */
|
||||||
tmpreg1 |=(((uint32_t)PHYReg<<6U) & ETH_MACMIIAR_MR); /* Set the PHY register address */
|
tmpreg1 |= (((uint32_t)PHYReg << 6U) & ETH_MACMIIAR_MR); /* Set the PHY register address */
|
||||||
tmpreg1 &= ~ETH_MACMIIAR_MW; /* Set the read mode */
|
tmpreg1 &= ~ETH_MACMIIAR_MW; /* Set the read mode */
|
||||||
tmpreg1 |= ETH_MACMIIAR_MB; /* Set the MII Busy bit */
|
tmpreg1 |= ETH_MACMIIAR_MB; /* Set the MII Busy bit */
|
||||||
|
|
||||||
@@ -1077,12 +1077,12 @@ HAL_StatusTypeDef HAL_ETH_ReadPHYRegister(ETH_HandleTypeDef *heth, uint16_t PHYR
|
|||||||
tickstart = HAL_GetTick();
|
tickstart = HAL_GetTick();
|
||||||
|
|
||||||
/* Check for the Busy flag */
|
/* Check for the Busy flag */
|
||||||
while((tmpreg1 & ETH_MACMIIAR_MB) == ETH_MACMIIAR_MB)
|
while ((tmpreg1 & ETH_MACMIIAR_MB) == ETH_MACMIIAR_MB)
|
||||||
{
|
{
|
||||||
/* Check for the Timeout */
|
/* Check for the Timeout */
|
||||||
if((HAL_GetTick() - tickstart ) > PHY_READ_TO)
|
if ((HAL_GetTick() - tickstart) > PHY_READ_TO)
|
||||||
{
|
{
|
||||||
heth->State= HAL_ETH_STATE_READY;
|
heth->State = HAL_ETH_STATE_READY;
|
||||||
|
|
||||||
/* Process Unlocked */
|
/* Process Unlocked */
|
||||||
__HAL_UNLOCK(heth);
|
__HAL_UNLOCK(heth);
|
||||||
@@ -1123,7 +1123,7 @@ HAL_StatusTypeDef HAL_ETH_WritePHYRegister(ETH_HandleTypeDef *heth, uint16_t PHY
|
|||||||
assert_param(IS_ETH_PHY_ADDRESS(heth->Init.PhyAddress));
|
assert_param(IS_ETH_PHY_ADDRESS(heth->Init.PhyAddress));
|
||||||
|
|
||||||
/* Check the ETH peripheral state */
|
/* Check the ETH peripheral state */
|
||||||
if(heth->State == HAL_ETH_STATE_BUSY_WR)
|
if (heth->State == HAL_ETH_STATE_BUSY_WR)
|
||||||
{
|
{
|
||||||
return HAL_BUSY;
|
return HAL_BUSY;
|
||||||
}
|
}
|
||||||
@@ -1137,8 +1137,8 @@ HAL_StatusTypeDef HAL_ETH_WritePHYRegister(ETH_HandleTypeDef *heth, uint16_t PHY
|
|||||||
tmpreg1 &= ~ETH_MACMIIAR_CR_MASK;
|
tmpreg1 &= ~ETH_MACMIIAR_CR_MASK;
|
||||||
|
|
||||||
/* Prepare the MII register address value */
|
/* Prepare the MII register address value */
|
||||||
tmpreg1 |=(((uint32_t)heth->Init.PhyAddress<<11U) & ETH_MACMIIAR_PA); /* Set the PHY device address */
|
tmpreg1 |= (((uint32_t)heth->Init.PhyAddress << 11U) & ETH_MACMIIAR_PA); /* Set the PHY device address */
|
||||||
tmpreg1 |=(((uint32_t)PHYReg<<6U) & ETH_MACMIIAR_MR); /* Set the PHY register address */
|
tmpreg1 |= (((uint32_t)PHYReg << 6U) & ETH_MACMIIAR_MR); /* Set the PHY register address */
|
||||||
tmpreg1 |= ETH_MACMIIAR_MW; /* Set the write mode */
|
tmpreg1 |= ETH_MACMIIAR_MW; /* Set the write mode */
|
||||||
tmpreg1 |= ETH_MACMIIAR_MB; /* Set the MII Busy bit */
|
tmpreg1 |= ETH_MACMIIAR_MB; /* Set the MII Busy bit */
|
||||||
|
|
||||||
@@ -1152,12 +1152,12 @@ HAL_StatusTypeDef HAL_ETH_WritePHYRegister(ETH_HandleTypeDef *heth, uint16_t PHY
|
|||||||
tickstart = HAL_GetTick();
|
tickstart = HAL_GetTick();
|
||||||
|
|
||||||
/* Check for the Busy flag */
|
/* Check for the Busy flag */
|
||||||
while((tmpreg1 & ETH_MACMIIAR_MB) == ETH_MACMIIAR_MB)
|
while ((tmpreg1 & ETH_MACMIIAR_MB) == ETH_MACMIIAR_MB)
|
||||||
{
|
{
|
||||||
/* Check for the Timeout */
|
/* Check for the Timeout */
|
||||||
if((HAL_GetTick() - tickstart ) > PHY_WRITE_TO)
|
if ((HAL_GetTick() - tickstart) > PHY_WRITE_TO)
|
||||||
{
|
{
|
||||||
heth->State= HAL_ETH_STATE_READY;
|
heth->State = HAL_ETH_STATE_READY;
|
||||||
|
|
||||||
/* Process Unlocked */
|
/* Process Unlocked */
|
||||||
__HAL_UNLOCK(heth);
|
__HAL_UNLOCK(heth);
|
||||||
@@ -1200,7 +1200,7 @@ HAL_StatusTypeDef HAL_ETH_WritePHYRegister(ETH_HandleTypeDef *heth, uint16_t PHY
|
|||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Enables Ethernet MAC and DMA reception/transmission
|
* @brief Enables Ethernet MAC and DMA reception/transmission
|
||||||
* @param heth: pointer to a ETH_HandleTypeDef structure that contains
|
* @param heth: pointer to a ETH_HandleTypeDef structure that contains
|
||||||
* the configuration information for ETHERNET module
|
* the configuration information for ETHERNET module
|
||||||
@@ -1230,7 +1230,7 @@ HAL_StatusTypeDef HAL_ETH_Start(ETH_HandleTypeDef *heth)
|
|||||||
ETH_DMAReceptionEnable(heth);
|
ETH_DMAReceptionEnable(heth);
|
||||||
|
|
||||||
/* Set the ETH state to READY*/
|
/* Set the ETH state to READY*/
|
||||||
heth->State= HAL_ETH_STATE_READY;
|
heth->State = HAL_ETH_STATE_READY;
|
||||||
|
|
||||||
/* Process Unlocked */
|
/* Process Unlocked */
|
||||||
__HAL_UNLOCK(heth);
|
__HAL_UNLOCK(heth);
|
||||||
@@ -1293,7 +1293,7 @@ HAL_StatusTypeDef HAL_ETH_ConfigMAC(ETH_HandleTypeDef *heth, ETH_MACInitTypeDef
|
|||||||
__HAL_LOCK(heth);
|
__HAL_LOCK(heth);
|
||||||
|
|
||||||
/* Set the ETH peripheral state to BUSY */
|
/* Set the ETH peripheral state to BUSY */
|
||||||
heth->State= HAL_ETH_STATE_BUSY;
|
heth->State = HAL_ETH_STATE_BUSY;
|
||||||
|
|
||||||
assert_param(IS_ETH_SPEED(heth->Init.Speed));
|
assert_param(IS_ETH_SPEED(heth->Init.Speed));
|
||||||
assert_param(IS_ETH_DUPLEX_MODE(heth->Init.DuplexMode));
|
assert_param(IS_ETH_DUPLEX_MODE(heth->Init.DuplexMode));
|
||||||
@@ -1436,7 +1436,7 @@ HAL_StatusTypeDef HAL_ETH_ConfigMAC(ETH_HandleTypeDef *heth, ETH_MACInitTypeDef
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Set the ETH state to Ready */
|
/* Set the ETH state to Ready */
|
||||||
heth->State= HAL_ETH_STATE_READY;
|
heth->State = HAL_ETH_STATE_READY;
|
||||||
|
|
||||||
/* Process Unlocked */
|
/* Process Unlocked */
|
||||||
__HAL_UNLOCK(heth);
|
__HAL_UNLOCK(heth);
|
||||||
@@ -1460,7 +1460,7 @@ HAL_StatusTypeDef HAL_ETH_ConfigDMA(ETH_HandleTypeDef *heth, ETH_DMAInitTypeDef
|
|||||||
__HAL_LOCK(heth);
|
__HAL_LOCK(heth);
|
||||||
|
|
||||||
/* Set the ETH peripheral state to BUSY */
|
/* Set the ETH peripheral state to BUSY */
|
||||||
heth->State= HAL_ETH_STATE_BUSY;
|
heth->State = HAL_ETH_STATE_BUSY;
|
||||||
|
|
||||||
/* Check parameters */
|
/* Check parameters */
|
||||||
assert_param(IS_ETH_DROP_TCPIP_CHECKSUM_FRAME(dmaconf->DropTCPIPChecksumErrorFrame));
|
assert_param(IS_ETH_DROP_TCPIP_CHECKSUM_FRAME(dmaconf->DropTCPIPChecksumErrorFrame));
|
||||||
@@ -1520,7 +1520,7 @@ HAL_StatusTypeDef HAL_ETH_ConfigDMA(ETH_HandleTypeDef *heth, ETH_DMAInitTypeDef
|
|||||||
(heth->Instance)->DMABMR = tmpreg1;
|
(heth->Instance)->DMABMR = tmpreg1;
|
||||||
|
|
||||||
/* Set the ETH state to Ready */
|
/* Set the ETH state to Ready */
|
||||||
heth->State= HAL_ETH_STATE_READY;
|
heth->State = HAL_ETH_STATE_READY;
|
||||||
|
|
||||||
/* Process Unlocked */
|
/* Process Unlocked */
|
||||||
__HAL_UNLOCK(heth);
|
__HAL_UNLOCK(heth);
|
||||||
@@ -1604,7 +1604,7 @@ static void ETH_MACDMAConfig(ETH_HandleTypeDef *heth, uint32_t err)
|
|||||||
macinit.CarrierSense = ETH_CARRIERSENCE_ENABLE;
|
macinit.CarrierSense = ETH_CARRIERSENCE_ENABLE;
|
||||||
macinit.ReceiveOwn = ETH_RECEIVEOWN_ENABLE;
|
macinit.ReceiveOwn = ETH_RECEIVEOWN_ENABLE;
|
||||||
macinit.LoopbackMode = ETH_LOOPBACKMODE_DISABLE;
|
macinit.LoopbackMode = ETH_LOOPBACKMODE_DISABLE;
|
||||||
if(heth->Init.ChecksumMode == ETH_CHECKSUM_BY_HARDWARE)
|
if (heth->Init.ChecksumMode == ETH_CHECKSUM_BY_HARDWARE)
|
||||||
{
|
{
|
||||||
macinit.ChecksumOffload = ETH_CHECKSUMOFFLAOD_ENABLE;
|
macinit.ChecksumOffload = ETH_CHECKSUMOFFLAOD_ENABLE;
|
||||||
}
|
}
|
||||||
@@ -1819,7 +1819,7 @@ static void ETH_MACDMAConfig(ETH_HandleTypeDef *heth, uint32_t err)
|
|||||||
HAL_Delay(ETH_REG_WRITE_DELAY);
|
HAL_Delay(ETH_REG_WRITE_DELAY);
|
||||||
(heth->Instance)->DMABMR = tmpreg1;
|
(heth->Instance)->DMABMR = tmpreg1;
|
||||||
|
|
||||||
if((heth->Init).RxMode == ETH_RXINTERRUPT_MODE)
|
if ((heth->Init).RxMode == ETH_RXINTERRUPT_MODE)
|
||||||
{
|
{
|
||||||
/* Enable the Ethernet Rx Interrupt */
|
/* Enable the Ethernet Rx Interrupt */
|
||||||
__HAL_ETH_DMA_ENABLE_IT((heth), ETH_DMA_IT_NIS | ETH_DMA_IT_R);
|
__HAL_ETH_DMA_ENABLE_IT((heth), ETH_DMA_IT_NIS | ETH_DMA_IT_R);
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_flash.c
|
* @file stm32f1xx_hal_flash.c
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief FLASH HAL module driver.
|
* @brief FLASH HAL module driver.
|
||||||
* This file provides firmware functions to manage the following
|
* This file provides firmware functions to manage the following
|
||||||
* functionalities of the internal FLASH memory:
|
* functionalities of the internal FLASH memory:
|
||||||
@@ -674,31 +672,36 @@ __weak void HAL_FLASH_OperationErrorCallback(uint32_t ReturnValue)
|
|||||||
*/
|
*/
|
||||||
HAL_StatusTypeDef HAL_FLASH_Unlock(void)
|
HAL_StatusTypeDef HAL_FLASH_Unlock(void)
|
||||||
{
|
{
|
||||||
if (HAL_IS_BIT_SET(FLASH->CR, FLASH_CR_LOCK))
|
HAL_StatusTypeDef status = HAL_OK;
|
||||||
|
|
||||||
|
if(READ_BIT(FLASH->CR, FLASH_CR_LOCK) != RESET)
|
||||||
{
|
{
|
||||||
/* Authorize the FLASH Registers access */
|
/* Authorize the FLASH Registers access */
|
||||||
WRITE_REG(FLASH->KEYR, FLASH_KEY1);
|
WRITE_REG(FLASH->KEYR, FLASH_KEY1);
|
||||||
WRITE_REG(FLASH->KEYR, FLASH_KEY2);
|
WRITE_REG(FLASH->KEYR, FLASH_KEY2);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return HAL_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/* Verify Flash is unlocked */
|
||||||
|
if(READ_BIT(FLASH->CR, FLASH_CR_LOCK) != RESET)
|
||||||
|
{
|
||||||
|
status = HAL_ERROR;
|
||||||
|
}
|
||||||
|
}
|
||||||
#if defined(FLASH_BANK2_END)
|
#if defined(FLASH_BANK2_END)
|
||||||
if (HAL_IS_BIT_SET(FLASH->CR2, FLASH_CR2_LOCK))
|
if(READ_BIT(FLASH->CR2, FLASH_CR2_LOCK) != RESET)
|
||||||
{
|
{
|
||||||
/* Authorize the FLASH BANK2 Registers access */
|
/* Authorize the FLASH BANK2 Registers access */
|
||||||
WRITE_REG(FLASH->KEYR2, FLASH_KEY1);
|
WRITE_REG(FLASH->KEYR2, FLASH_KEY1);
|
||||||
WRITE_REG(FLASH->KEYR2, FLASH_KEY2);
|
WRITE_REG(FLASH->KEYR2, FLASH_KEY2);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return HAL_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/* Verify Flash BANK2 is unlocked */
|
||||||
|
if(READ_BIT(FLASH->CR2, FLASH_CR2_LOCK) != RESET)
|
||||||
|
{
|
||||||
|
status = HAL_ERROR;
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif /* FLASH_BANK2_END */
|
#endif /* FLASH_BANK2_END */
|
||||||
return HAL_OK;
|
|
||||||
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_flash_ex.c
|
* @file stm32f1xx_hal_flash_ex.c
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Extended FLASH HAL module driver.
|
* @brief Extended FLASH HAL module driver.
|
||||||
*
|
*
|
||||||
* This file provides firmware functions to manage the following
|
* This file provides firmware functions to manage the following
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_gpio.c
|
* @file stm32f1xx_hal_gpio.c
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief GPIO HAL module driver.
|
* @brief GPIO HAL module driver.
|
||||||
* This file provides firmware functions to manage the following
|
* This file provides firmware functions to manage the following
|
||||||
* functionalities of the General Purpose Input/Output (GPIO) peripheral:
|
* functionalities of the General Purpose Input/Output (GPIO) peripheral:
|
||||||
@@ -263,11 +261,11 @@ void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init)
|
|||||||
case GPIO_MODE_EVT_RISING_FALLING:
|
case GPIO_MODE_EVT_RISING_FALLING:
|
||||||
/* Check the GPIO pull parameter */
|
/* Check the GPIO pull parameter */
|
||||||
assert_param(IS_GPIO_PULL(GPIO_Init->Pull));
|
assert_param(IS_GPIO_PULL(GPIO_Init->Pull));
|
||||||
if(GPIO_Init->Pull == GPIO_NOPULL)
|
if (GPIO_Init->Pull == GPIO_NOPULL)
|
||||||
{
|
{
|
||||||
config = GPIO_CR_MODE_INPUT + GPIO_CR_CNF_INPUT_FLOATING;
|
config = GPIO_CR_MODE_INPUT + GPIO_CR_CNF_INPUT_FLOATING;
|
||||||
}
|
}
|
||||||
else if(GPIO_Init->Pull == GPIO_PULLUP)
|
else if (GPIO_Init->Pull == GPIO_PULLUP)
|
||||||
{
|
{
|
||||||
config = GPIO_CR_MODE_INPUT + GPIO_CR_CNF_INPUT_PU_PD;
|
config = GPIO_CR_MODE_INPUT + GPIO_CR_CNF_INPUT_PU_PD;
|
||||||
|
|
||||||
@@ -299,11 +297,11 @@ void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init)
|
|||||||
registeroffset = (iocurrent < GPIO_PIN_8) ? (position << 2U) : ((position - 8U) << 2U);
|
registeroffset = (iocurrent < GPIO_PIN_8) ? (position << 2U) : ((position - 8U) << 2U);
|
||||||
|
|
||||||
/* Apply the new configuration of the pin to the register */
|
/* Apply the new configuration of the pin to the register */
|
||||||
MODIFY_REG((*configregister), ((GPIO_CRL_MODE0 | GPIO_CRL_CNF0) << registeroffset ), (config << registeroffset));
|
MODIFY_REG((*configregister), ((GPIO_CRL_MODE0 | GPIO_CRL_CNF0) << registeroffset), (config << registeroffset));
|
||||||
|
|
||||||
/*--------------------- EXTI Mode Configuration ------------------------*/
|
/*--------------------- EXTI Mode Configuration ------------------------*/
|
||||||
/* Configure the External Interrupt or event for the current IO */
|
/* Configure the External Interrupt or event for the current IO */
|
||||||
if((GPIO_Init->Mode & EXTI_MODE) == EXTI_MODE)
|
if ((GPIO_Init->Mode & EXTI_MODE) == EXTI_MODE)
|
||||||
{
|
{
|
||||||
/* Enable AFIO Clock */
|
/* Enable AFIO Clock */
|
||||||
__HAL_RCC_AFIO_CLK_ENABLE();
|
__HAL_RCC_AFIO_CLK_ENABLE();
|
||||||
@@ -314,7 +312,7 @@ void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init)
|
|||||||
|
|
||||||
|
|
||||||
/* Configure the interrupt mask */
|
/* Configure the interrupt mask */
|
||||||
if((GPIO_Init->Mode & GPIO_MODE_IT) == GPIO_MODE_IT)
|
if ((GPIO_Init->Mode & GPIO_MODE_IT) == GPIO_MODE_IT)
|
||||||
{
|
{
|
||||||
SET_BIT(EXTI->IMR, iocurrent);
|
SET_BIT(EXTI->IMR, iocurrent);
|
||||||
}
|
}
|
||||||
@@ -324,7 +322,7 @@ void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Configure the event mask */
|
/* Configure the event mask */
|
||||||
if((GPIO_Init->Mode & GPIO_MODE_EVT) == GPIO_MODE_EVT)
|
if ((GPIO_Init->Mode & GPIO_MODE_EVT) == GPIO_MODE_EVT)
|
||||||
{
|
{
|
||||||
SET_BIT(EXTI->EMR, iocurrent);
|
SET_BIT(EXTI->EMR, iocurrent);
|
||||||
}
|
}
|
||||||
@@ -334,7 +332,7 @@ void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Enable or disable the rising trigger */
|
/* Enable or disable the rising trigger */
|
||||||
if((GPIO_Init->Mode & RISING_EDGE) == RISING_EDGE)
|
if ((GPIO_Init->Mode & RISING_EDGE) == RISING_EDGE)
|
||||||
{
|
{
|
||||||
SET_BIT(EXTI->RTSR, iocurrent);
|
SET_BIT(EXTI->RTSR, iocurrent);
|
||||||
}
|
}
|
||||||
@@ -344,7 +342,7 @@ void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Enable or disable the falling trigger */
|
/* Enable or disable the falling trigger */
|
||||||
if((GPIO_Init->Mode & FALLING_EDGE) == FALLING_EDGE)
|
if ((GPIO_Init->Mode & FALLING_EDGE) == FALLING_EDGE)
|
||||||
{
|
{
|
||||||
SET_BIT(EXTI->FTSR, iocurrent);
|
SET_BIT(EXTI->FTSR, iocurrent);
|
||||||
}
|
}
|
||||||
@@ -391,7 +389,7 @@ void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin)
|
|||||||
registeroffset = (iocurrent < GPIO_PIN_8) ? (position << 2U) : ((position - 8U) << 2U);
|
registeroffset = (iocurrent < GPIO_PIN_8) ? (position << 2U) : ((position - 8U) << 2U);
|
||||||
|
|
||||||
/* CRL/CRH default value is floating input(0x04) shifted to correct position */
|
/* CRL/CRH default value is floating input(0x04) shifted to correct position */
|
||||||
MODIFY_REG(*configregister, ((GPIO_CRL_MODE0 | GPIO_CRL_CNF0) << registeroffset ), GPIO_CRL_CNF0_0 << registeroffset);
|
MODIFY_REG(*configregister, ((GPIO_CRL_MODE0 | GPIO_CRL_CNF0) << registeroffset), GPIO_CRL_CNF0_0 << registeroffset);
|
||||||
|
|
||||||
/* ODR default value is 0 */
|
/* ODR default value is 0 */
|
||||||
CLEAR_BIT(GPIOx->ODR, iocurrent);
|
CLEAR_BIT(GPIOx->ODR, iocurrent);
|
||||||
@@ -401,7 +399,7 @@ void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin)
|
|||||||
|
|
||||||
tmp = AFIO->EXTICR[position >> 2U];
|
tmp = AFIO->EXTICR[position >> 2U];
|
||||||
tmp &= 0x0FU << (4U * (position & 0x03U));
|
tmp &= 0x0FU << (4U * (position & 0x03U));
|
||||||
if(tmp == (GPIO_GET_INDEX(GPIOx) << (4U * (position & 0x03U))))
|
if (tmp == (GPIO_GET_INDEX(GPIOx) << (4U * (position & 0x03U))))
|
||||||
{
|
{
|
||||||
tmp = 0x0FU << (4U * (position & 0x03U));
|
tmp = 0x0FU << (4U * (position & 0x03U));
|
||||||
CLEAR_BIT(AFIO->EXTICR[position >> 2U], tmp);
|
CLEAR_BIT(AFIO->EXTICR[position >> 2U], tmp);
|
||||||
@@ -445,7 +443,7 @@ void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin)
|
|||||||
* This parameter can be GPIO_PIN_x where x can be (0..15).
|
* This parameter can be GPIO_PIN_x where x can be (0..15).
|
||||||
* @retval The input port pin value.
|
* @retval The input port pin value.
|
||||||
*/
|
*/
|
||||||
GPIO_PinState HAL_GPIO_ReadPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
|
GPIO_PinState HAL_GPIO_ReadPin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
|
||||||
{
|
{
|
||||||
GPIO_PinState bitstatus;
|
GPIO_PinState bitstatus;
|
||||||
|
|
||||||
@@ -475,12 +473,25 @@ GPIO_PinState HAL_GPIO_ReadPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
|
|||||||
* This parameter can be one of GPIO_PIN_x where x can be (0..15).
|
* This parameter can be one of GPIO_PIN_x where x can be (0..15).
|
||||||
* @param PinState: specifies the value to be written to the selected bit.
|
* @param PinState: specifies the value to be written to the selected bit.
|
||||||
* This parameter can be one of the GPIO_PinState enum values:
|
* This parameter can be one of the GPIO_PinState enum values:
|
||||||
* @arg GPIO_BIT_RESET: to clear the port pin
|
* @arg GPIO_PIN_RESET: to clear the port pin
|
||||||
* @arg GPIO_BIT_SET: to set the port pin
|
* @arg GPIO_PIN_SET: to set the port pin
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
//void HAL_GPIO_WritePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState)
|
void HAL_GPIO_WritePin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState)
|
||||||
|
{
|
||||||
|
/* Check the parameters */
|
||||||
|
assert_param(IS_GPIO_PIN(GPIO_Pin));
|
||||||
|
assert_param(IS_GPIO_PIN_ACTION(PinState));
|
||||||
|
|
||||||
|
if (PinState != GPIO_PIN_RESET)
|
||||||
|
{
|
||||||
|
GPIOx->BSRR = GPIO_Pin;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GPIOx->BSRR = (uint32_t)GPIO_Pin << 16U;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Toggles the specified GPIO pin
|
* @brief Toggles the specified GPIO pin
|
||||||
@@ -488,7 +499,7 @@ GPIO_PinState HAL_GPIO_ReadPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
|
|||||||
* @param GPIO_Pin: Specifies the pins to be toggled.
|
* @param GPIO_Pin: Specifies the pins to be toggled.
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
void HAL_GPIO_TogglePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
|
void HAL_GPIO_TogglePin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
|
||||||
{
|
{
|
||||||
/* Check the parameters */
|
/* Check the parameters */
|
||||||
assert_param(IS_GPIO_PIN(GPIO_Pin));
|
assert_param(IS_GPIO_PIN(GPIO_Pin));
|
||||||
@@ -506,7 +517,7 @@ void HAL_GPIO_TogglePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
|
|||||||
* This parameter can be any combination of GPIO_Pin_x where x can be (0..15).
|
* This parameter can be any combination of GPIO_Pin_x where x can be (0..15).
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
HAL_StatusTypeDef HAL_GPIO_LockPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
|
HAL_StatusTypeDef HAL_GPIO_LockPin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
|
||||||
{
|
{
|
||||||
__IO uint32_t tmp = GPIO_LCKR_LCKK;
|
__IO uint32_t tmp = GPIO_LCKR_LCKK;
|
||||||
|
|
||||||
@@ -525,7 +536,7 @@ HAL_StatusTypeDef HAL_GPIO_LockPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
|
|||||||
/* Read LCKK bit*/
|
/* Read LCKK bit*/
|
||||||
tmp = GPIOx->LCKR;
|
tmp = GPIOx->LCKR;
|
||||||
|
|
||||||
if((uint32_t)(GPIOx->LCKR & GPIO_LCKR_LCKK))
|
if ((uint32_t)(GPIOx->LCKR & GPIO_LCKR_LCKK))
|
||||||
{
|
{
|
||||||
return HAL_OK;
|
return HAL_OK;
|
||||||
}
|
}
|
||||||
@@ -543,7 +554,7 @@ HAL_StatusTypeDef HAL_GPIO_LockPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
|
|||||||
void HAL_GPIO_EXTI_IRQHandler(uint16_t GPIO_Pin)
|
void HAL_GPIO_EXTI_IRQHandler(uint16_t GPIO_Pin)
|
||||||
{
|
{
|
||||||
/* EXTI line interrupt detected */
|
/* EXTI line interrupt detected */
|
||||||
if(__HAL_GPIO_EXTI_GET_IT(GPIO_Pin) != RESET)
|
if (__HAL_GPIO_EXTI_GET_IT(GPIO_Pin) != RESET)
|
||||||
{
|
{
|
||||||
__HAL_GPIO_EXTI_CLEAR_IT(GPIO_Pin);
|
__HAL_GPIO_EXTI_CLEAR_IT(GPIO_Pin);
|
||||||
HAL_GPIO_EXTI_Callback(GPIO_Pin);
|
HAL_GPIO_EXTI_Callback(GPIO_Pin);
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_gpio_ex.c
|
* @file stm32f1xx_hal_gpio_ex.c
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief GPIO Extension HAL module driver.
|
* @brief GPIO Extension HAL module driver.
|
||||||
* This file provides firmware functions to manage the following
|
* This file provides firmware functions to manage the following
|
||||||
* functionalities of the General Purpose Input/Output (GPIO) extension peripheral.
|
* functionalities of the General Purpose Input/Output (GPIO) extension peripheral.
|
||||||
@@ -103,7 +101,7 @@ void HAL_GPIOEx_ConfigEventout(uint32_t GPIO_PortSource, uint32_t GPIO_PinSource
|
|||||||
assert_param(IS_AFIO_EVENTOUT_PIN(GPIO_PinSource));
|
assert_param(IS_AFIO_EVENTOUT_PIN(GPIO_PinSource));
|
||||||
|
|
||||||
/* Apply the new configuration */
|
/* Apply the new configuration */
|
||||||
MODIFY_REG(AFIO->EVCR, (AFIO_EVCR_PORT)|(AFIO_EVCR_PIN), (GPIO_PortSource)|(GPIO_PinSource));
|
MODIFY_REG(AFIO->EVCR, (AFIO_EVCR_PORT) | (AFIO_EVCR_PIN), (GPIO_PortSource) | (GPIO_PinSource));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_hcd.c
|
* @file stm32f1xx_hal_hcd.c
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief HCD HAL module driver.
|
* @brief HCD HAL module driver.
|
||||||
* This file provides firmware functions to manage the following
|
* This file provides firmware functions to manage the following
|
||||||
* functionalities of the USB Peripheral Controller:
|
* functionalities of the USB Peripheral Controller:
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_i2c.c
|
* @file stm32f1xx_hal_i2c.c
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief I2C HAL module driver.
|
* @brief I2C HAL module driver.
|
||||||
* This file provides firmware functions to manage the following
|
* This file provides firmware functions to manage the following
|
||||||
* functionalities of the Inter Integrated Circuit (I2C) peripheral:
|
* functionalities of the Inter Integrated Circuit (I2C) peripheral:
|
||||||
@@ -406,6 +404,12 @@ HAL_StatusTypeDef HAL_I2C_Init(I2C_HandleTypeDef *hi2c)
|
|||||||
/* Get PCLK1 frequency */
|
/* Get PCLK1 frequency */
|
||||||
pclk1 = HAL_RCC_GetPCLK1Freq();
|
pclk1 = HAL_RCC_GetPCLK1Freq();
|
||||||
|
|
||||||
|
/* Check the minimum allowed PCLK1 frequency */
|
||||||
|
if (I2C_MIN_PCLK_FREQ(pclk1, hi2c->Init.ClockSpeed) == 1U)
|
||||||
|
{
|
||||||
|
return HAL_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
/* Calculate frequency range */
|
/* Calculate frequency range */
|
||||||
freqrange = I2C_FREQRANGE(pclk1);
|
freqrange = I2C_FREQRANGE(pclk1);
|
||||||
|
|
||||||
@@ -583,7 +587,7 @@ HAL_StatusTypeDef HAL_I2C_DeInit(I2C_HandleTypeDef *hi2c)
|
|||||||
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
||||||
* the configuration information for the specified I2C.
|
* the configuration information for the specified I2C.
|
||||||
* @param DevAddress Target device address: The device 7 bits address value
|
* @param DevAddress Target device address: The device 7 bits address value
|
||||||
* in datasheet must be shift at right before call interface
|
* in datasheet must be shifted to the left before calling the interface
|
||||||
* @param pData Pointer to data buffer
|
* @param pData Pointer to data buffer
|
||||||
* @param Size Amount of data to be sent
|
* @param Size Amount of data to be sent
|
||||||
* @param Timeout Timeout duration
|
* @param Timeout Timeout duration
|
||||||
@@ -715,7 +719,7 @@ HAL_StatusTypeDef HAL_I2C_Master_Transmit(I2C_HandleTypeDef *hi2c, uint16_t DevA
|
|||||||
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
||||||
* the configuration information for the specified I2C.
|
* the configuration information for the specified I2C.
|
||||||
* @param DevAddress Target device address: The device 7 bits address value
|
* @param DevAddress Target device address: The device 7 bits address value
|
||||||
* in datasheet must be shift at right before call interface
|
* in datasheet must be shifted to the left before calling the interface
|
||||||
* @param pData Pointer to data buffer
|
* @param pData Pointer to data buffer
|
||||||
* @param Size Amount of data to be sent
|
* @param Size Amount of data to be sent
|
||||||
* @param Timeout Timeout duration
|
* @param Timeout Timeout duration
|
||||||
@@ -1181,7 +1185,7 @@ HAL_StatusTypeDef HAL_I2C_Slave_Receive(I2C_HandleTypeDef *hi2c, uint8_t *pData,
|
|||||||
hi2c->XferSize--;
|
hi2c->XferSize--;
|
||||||
hi2c->XferCount--;
|
hi2c->XferCount--;
|
||||||
|
|
||||||
if((__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_BTF) == SET) && (Size != 0U))
|
if((__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_BTF) == SET) && (hi2c->XferSize != 0U))
|
||||||
{
|
{
|
||||||
/* Read data from DR */
|
/* Read data from DR */
|
||||||
(*hi2c->pBuffPtr++) = hi2c->Instance->DR;
|
(*hi2c->pBuffPtr++) = hi2c->Instance->DR;
|
||||||
@@ -1231,7 +1235,7 @@ HAL_StatusTypeDef HAL_I2C_Slave_Receive(I2C_HandleTypeDef *hi2c, uint8_t *pData,
|
|||||||
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
||||||
* the configuration information for the specified I2C.
|
* the configuration information for the specified I2C.
|
||||||
* @param DevAddress Target device address: The device 7 bits address value
|
* @param DevAddress Target device address: The device 7 bits address value
|
||||||
* in datasheet must be shift at right before call interface
|
* in datasheet must be shifted to the left before calling the interface
|
||||||
* @param pData Pointer to data buffer
|
* @param pData Pointer to data buffer
|
||||||
* @param Size Amount of data to be sent
|
* @param Size Amount of data to be sent
|
||||||
* @retval HAL status
|
* @retval HAL status
|
||||||
@@ -1308,7 +1312,7 @@ HAL_StatusTypeDef HAL_I2C_Master_Transmit_IT(I2C_HandleTypeDef *hi2c, uint16_t D
|
|||||||
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
||||||
* the configuration information for the specified I2C.
|
* the configuration information for the specified I2C.
|
||||||
* @param DevAddress Target device address: The device 7 bits address value
|
* @param DevAddress Target device address: The device 7 bits address value
|
||||||
* in datasheet must be shift at right before call interface
|
* in datasheet must be shifted to the left before calling the interface
|
||||||
* @param pData Pointer to data buffer
|
* @param pData Pointer to data buffer
|
||||||
* @param Size Amount of data to be sent
|
* @param Size Amount of data to be sent
|
||||||
* @retval HAL status
|
* @retval HAL status
|
||||||
@@ -1390,7 +1394,7 @@ HAL_StatusTypeDef HAL_I2C_Master_Receive_IT(I2C_HandleTypeDef *hi2c, uint16_t De
|
|||||||
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
||||||
* the configuration information for the specified I2C.
|
* the configuration information for the specified I2C.
|
||||||
* @param DevAddress Target device address: The device 7 bits address value
|
* @param DevAddress Target device address: The device 7 bits address value
|
||||||
* in datasheet must be shift at right before call interface
|
* in datasheet must be shifted to the left before calling the interface
|
||||||
* @param pData Pointer to data buffer
|
* @param pData Pointer to data buffer
|
||||||
* @param Size Amount of data to be sent
|
* @param Size Amount of data to be sent
|
||||||
* @param XferOptions Options of Transfer, value of @ref I2C_XferOptions_definition
|
* @param XferOptions Options of Transfer, value of @ref I2C_XferOptions_definition
|
||||||
@@ -1493,7 +1497,7 @@ HAL_StatusTypeDef HAL_I2C_Master_Sequential_Transmit_IT(I2C_HandleTypeDef *hi2c,
|
|||||||
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
||||||
* the configuration information for the specified I2C.
|
* the configuration information for the specified I2C.
|
||||||
* @param DevAddress Target device address: The device 7 bits address value
|
* @param DevAddress Target device address: The device 7 bits address value
|
||||||
* in datasheet must be shift at right before call interface
|
* in datasheet must be shifted to the left before calling the interface
|
||||||
* @param pData Pointer to data buffer
|
* @param pData Pointer to data buffer
|
||||||
* @param Size Amount of data to be sent
|
* @param Size Amount of data to be sent
|
||||||
* @param XferOptions Options of Transfer, value of @ref I2C_XferOptions_definition
|
* @param XferOptions Options of Transfer, value of @ref I2C_XferOptions_definition
|
||||||
@@ -1955,7 +1959,7 @@ HAL_StatusTypeDef HAL_I2C_DisableListen_IT(I2C_HandleTypeDef *hi2c)
|
|||||||
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
||||||
* the configuration information for the specified I2C.
|
* the configuration information for the specified I2C.
|
||||||
* @param DevAddress Target device address: The device 7 bits address value
|
* @param DevAddress Target device address: The device 7 bits address value
|
||||||
* in datasheet must be shift at right before call interface
|
* in datasheet must be shifted to the left before calling the interface
|
||||||
* @param pData Pointer to data buffer
|
* @param pData Pointer to data buffer
|
||||||
* @param Size Amount of data to be sent
|
* @param Size Amount of data to be sent
|
||||||
* @retval HAL status
|
* @retval HAL status
|
||||||
@@ -2073,7 +2077,7 @@ HAL_StatusTypeDef HAL_I2C_Master_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint16_t
|
|||||||
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
||||||
* the configuration information for the specified I2C.
|
* the configuration information for the specified I2C.
|
||||||
* @param DevAddress Target device address: The device 7 bits address value
|
* @param DevAddress Target device address: The device 7 bits address value
|
||||||
* in datasheet must be shift at right before call interface
|
* in datasheet must be shifted to the left before calling the interface
|
||||||
* @param pData Pointer to data buffer
|
* @param pData Pointer to data buffer
|
||||||
* @param Size Amount of data to be sent
|
* @param Size Amount of data to be sent
|
||||||
* @retval HAL status
|
* @retval HAL status
|
||||||
@@ -2192,7 +2196,7 @@ HAL_StatusTypeDef HAL_I2C_Master_Receive_DMA(I2C_HandleTypeDef *hi2c, uint16_t D
|
|||||||
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
||||||
* the configuration information for the specified I2C.
|
* the configuration information for the specified I2C.
|
||||||
* @param DevAddress Target device address: The device 7 bits address value
|
* @param DevAddress Target device address: The device 7 bits address value
|
||||||
* in datasheet must be shift at right before call interface
|
* in datasheet must be shifted to the left before calling the interface
|
||||||
* @retval HAL status
|
* @retval HAL status
|
||||||
*/
|
*/
|
||||||
HAL_StatusTypeDef HAL_I2C_Master_Abort_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress)
|
HAL_StatusTypeDef HAL_I2C_Master_Abort_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress)
|
||||||
@@ -2429,7 +2433,8 @@ HAL_StatusTypeDef HAL_I2C_Slave_Receive_DMA(I2C_HandleTypeDef *hi2c, uint8_t *pD
|
|||||||
* @brief Write an amount of data in blocking mode to a specific memory address
|
* @brief Write an amount of data in blocking mode to a specific memory address
|
||||||
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
||||||
* the configuration information for the specified I2C.
|
* the configuration information for the specified I2C.
|
||||||
* @param DevAddress Target device address
|
* @param DevAddress Target device address: The device 7 bits address value
|
||||||
|
* in datasheet must be shifted to the left before calling the interface
|
||||||
* @param MemAddress Internal memory address
|
* @param MemAddress Internal memory address
|
||||||
* @param MemAddSize Size of internal memory address
|
* @param MemAddSize Size of internal memory address
|
||||||
* @param pData Pointer to data buffer
|
* @param pData Pointer to data buffer
|
||||||
@@ -2562,7 +2567,8 @@ HAL_StatusTypeDef HAL_I2C_Mem_Write(I2C_HandleTypeDef *hi2c, uint16_t DevAddress
|
|||||||
* @brief Read an amount of data in blocking mode from a specific memory address
|
* @brief Read an amount of data in blocking mode from a specific memory address
|
||||||
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
||||||
* the configuration information for the specified I2C.
|
* the configuration information for the specified I2C.
|
||||||
* @param DevAddress Target device address
|
* @param DevAddress Target device address: The device 7 bits address value
|
||||||
|
* in datasheet must be shifted to the left before calling the interface
|
||||||
* @param MemAddress Internal memory address
|
* @param MemAddress Internal memory address
|
||||||
* @param MemAddSize Size of internal memory address
|
* @param MemAddSize Size of internal memory address
|
||||||
* @param pData Pointer to data buffer
|
* @param pData Pointer to data buffer
|
||||||
@@ -2827,7 +2833,8 @@ HAL_StatusTypeDef HAL_I2C_Mem_Read(I2C_HandleTypeDef *hi2c, uint16_t DevAddress,
|
|||||||
* @brief Write an amount of data in non-blocking mode with Interrupt to a specific memory address
|
* @brief Write an amount of data in non-blocking mode with Interrupt to a specific memory address
|
||||||
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
||||||
* the configuration information for the specified I2C.
|
* the configuration information for the specified I2C.
|
||||||
* @param DevAddress Target device address
|
* @param DevAddress Target device address: The device 7 bits address value
|
||||||
|
* in datasheet must be shifted to the left before calling the interface
|
||||||
* @param MemAddress Internal memory address
|
* @param MemAddress Internal memory address
|
||||||
* @param MemAddSize Size of internal memory address
|
* @param MemAddSize Size of internal memory address
|
||||||
* @param pData Pointer to data buffer
|
* @param pData Pointer to data buffer
|
||||||
@@ -2912,7 +2919,8 @@ HAL_StatusTypeDef HAL_I2C_Mem_Write_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddr
|
|||||||
* @brief Read an amount of data in non-blocking mode with Interrupt from a specific memory address
|
* @brief Read an amount of data in non-blocking mode with Interrupt from a specific memory address
|
||||||
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
||||||
* the configuration information for the specified I2C.
|
* the configuration information for the specified I2C.
|
||||||
* @param DevAddress Target device address
|
* @param DevAddress Target device address: The device 7 bits address value
|
||||||
|
* in datasheet must be shifted to the left before calling the interface
|
||||||
* @param MemAddress Internal memory address
|
* @param MemAddress Internal memory address
|
||||||
* @param MemAddSize Size of internal memory address
|
* @param MemAddSize Size of internal memory address
|
||||||
* @param pData Pointer to data buffer
|
* @param pData Pointer to data buffer
|
||||||
@@ -3002,7 +3010,8 @@ HAL_StatusTypeDef HAL_I2C_Mem_Read_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddre
|
|||||||
* @brief Write an amount of data in non-blocking mode with DMA to a specific memory address
|
* @brief Write an amount of data in non-blocking mode with DMA to a specific memory address
|
||||||
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
||||||
* the configuration information for the specified I2C.
|
* the configuration information for the specified I2C.
|
||||||
* @param DevAddress Target device address
|
* @param DevAddress Target device address: The device 7 bits address value
|
||||||
|
* in datasheet must be shifted to the left before calling the interface
|
||||||
* @param MemAddress Internal memory address
|
* @param MemAddress Internal memory address
|
||||||
* @param MemAddSize Size of internal memory address
|
* @param MemAddSize Size of internal memory address
|
||||||
* @param pData Pointer to data buffer
|
* @param pData Pointer to data buffer
|
||||||
@@ -3122,7 +3131,8 @@ HAL_StatusTypeDef HAL_I2C_Mem_Write_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAdd
|
|||||||
* @brief Reads an amount of data in non-blocking mode with DMA from a specific memory address.
|
* @brief Reads an amount of data in non-blocking mode with DMA from a specific memory address.
|
||||||
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
||||||
* the configuration information for the specified I2C.
|
* the configuration information for the specified I2C.
|
||||||
* @param DevAddress Target device address
|
* @param DevAddress Target device address: The device 7 bits address value
|
||||||
|
* in datasheet must be shifted to the left before calling the interface
|
||||||
* @param MemAddress Internal memory address
|
* @param MemAddress Internal memory address
|
||||||
* @param MemAddSize Size of internal memory address
|
* @param MemAddSize Size of internal memory address
|
||||||
* @param pData Pointer to data buffer
|
* @param pData Pointer to data buffer
|
||||||
@@ -3283,7 +3293,8 @@ HAL_StatusTypeDef HAL_I2C_Mem_Read_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddr
|
|||||||
* @note This function is used with Memory devices
|
* @note This function is used with Memory devices
|
||||||
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
||||||
* the configuration information for the specified I2C.
|
* the configuration information for the specified I2C.
|
||||||
* @param DevAddress Target device address
|
* @param DevAddress Target device address: The device 7 bits address value
|
||||||
|
* in datasheet must be shifted to the left before calling the interface
|
||||||
* @param Trials Number of trials
|
* @param Trials Number of trials
|
||||||
* @param Timeout Timeout duration
|
* @param Timeout Timeout duration
|
||||||
* @retval HAL status
|
* @retval HAL status
|
||||||
@@ -3467,7 +3478,48 @@ void HAL_I2C_EV_IRQHandler(I2C_HandleTypeDef *hi2c)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* Slave mode selected */
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* ADDR set --------------------------------------------------------------*/
|
||||||
|
if(((sr1itflags & I2C_FLAG_ADDR) != RESET) && ((itsources & I2C_IT_EVT) != RESET))
|
||||||
|
{
|
||||||
|
I2C_Slave_ADDR(hi2c);
|
||||||
|
}
|
||||||
|
/* STOPF set --------------------------------------------------------------*/
|
||||||
|
else if(((sr1itflags & I2C_FLAG_STOPF) != RESET) && ((itsources & I2C_IT_EVT) != RESET))
|
||||||
|
{
|
||||||
|
I2C_Slave_STOPF(hi2c);
|
||||||
|
}
|
||||||
|
/* I2C in mode Transmitter -----------------------------------------------*/
|
||||||
|
else if((sr2itflags & I2C_FLAG_TRA) != RESET)
|
||||||
|
{
|
||||||
|
/* TXE set and BTF reset -----------------------------------------------*/
|
||||||
|
if(((sr1itflags & I2C_FLAG_TXE) != RESET) && ((itsources & I2C_IT_BUF) != RESET) && ((sr1itflags & I2C_FLAG_BTF) == RESET))
|
||||||
|
{
|
||||||
|
I2C_SlaveTransmit_TXE(hi2c);
|
||||||
|
}
|
||||||
|
/* BTF set -------------------------------------------------------------*/
|
||||||
|
else if(((sr1itflags & I2C_FLAG_BTF) != RESET) && ((itsources & I2C_IT_EVT) != RESET))
|
||||||
|
{
|
||||||
|
I2C_SlaveTransmit_BTF(hi2c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* I2C in mode Receiver --------------------------------------------------*/
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* RXNE set and BTF reset ----------------------------------------------*/
|
||||||
|
if(((sr1itflags & I2C_FLAG_RXNE) != RESET) && ((itsources & I2C_IT_BUF) != RESET) && ((sr1itflags & I2C_FLAG_BTF) == RESET))
|
||||||
|
{
|
||||||
|
I2C_SlaveReceive_RXNE(hi2c);
|
||||||
|
}
|
||||||
|
/* BTF set -------------------------------------------------------------*/
|
||||||
|
else if(((sr1itflags & I2C_FLAG_BTF) != RESET) && ((itsources & I2C_IT_EVT) != RESET))
|
||||||
|
{
|
||||||
|
I2C_SlaveReceive_BTF(hi2c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -4725,7 +4777,7 @@ static void I2C_ITError(I2C_HandleTypeDef *hi2c)
|
|||||||
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
||||||
* the configuration information for I2C module
|
* the configuration information for I2C module
|
||||||
* @param DevAddress Target device address: The device 7 bits address value
|
* @param DevAddress Target device address: The device 7 bits address value
|
||||||
* in datasheet must be shift at right before call interface
|
* in datasheet must be shifted to the left before calling the interface
|
||||||
* @param Timeout Timeout duration
|
* @param Timeout Timeout duration
|
||||||
* @param Tickstart Tick start value
|
* @param Tickstart Tick start value
|
||||||
* @retval HAL status
|
* @retval HAL status
|
||||||
@@ -4801,7 +4853,7 @@ static HAL_StatusTypeDef I2C_MasterRequestWrite(I2C_HandleTypeDef *hi2c, uint16_
|
|||||||
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
||||||
* the configuration information for I2C module
|
* the configuration information for I2C module
|
||||||
* @param DevAddress Target device address: The device 7 bits address value
|
* @param DevAddress Target device address: The device 7 bits address value
|
||||||
* in datasheet must be shift at right before call interface
|
* in datasheet must be shifted to the left before calling the interface
|
||||||
* @param Timeout Timeout duration
|
* @param Timeout Timeout duration
|
||||||
* @param Tickstart Tick start value
|
* @param Tickstart Tick start value
|
||||||
* @retval HAL status
|
* @retval HAL status
|
||||||
@@ -4907,7 +4959,8 @@ static HAL_StatusTypeDef I2C_MasterRequestRead(I2C_HandleTypeDef *hi2c, uint16_t
|
|||||||
* @brief Master sends target device address followed by internal memory address for write request.
|
* @brief Master sends target device address followed by internal memory address for write request.
|
||||||
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
||||||
* the configuration information for I2C module
|
* the configuration information for I2C module
|
||||||
* @param DevAddress Target device address
|
* @param DevAddress Target device address: The device 7 bits address value
|
||||||
|
* in datasheet must be shifted to the left before calling the interface
|
||||||
* @param MemAddress Internal memory address
|
* @param MemAddress Internal memory address
|
||||||
* @param MemAddSize Size of internal memory address
|
* @param MemAddSize Size of internal memory address
|
||||||
* @param Timeout Timeout duration
|
* @param Timeout Timeout duration
|
||||||
@@ -4997,7 +5050,8 @@ static HAL_StatusTypeDef I2C_RequestMemoryWrite(I2C_HandleTypeDef *hi2c, uint16_
|
|||||||
* @brief Master sends target device address followed by internal memory address for read request.
|
* @brief Master sends target device address followed by internal memory address for read request.
|
||||||
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
* @param hi2c Pointer to a I2C_HandleTypeDef structure that contains
|
||||||
* the configuration information for I2C module
|
* the configuration information for I2C module
|
||||||
* @param DevAddress Target device address
|
* @param DevAddress Target device address: The device 7 bits address value
|
||||||
|
* in datasheet must be shifted to the left before calling the interface
|
||||||
* @param MemAddress Internal memory address
|
* @param MemAddress Internal memory address
|
||||||
* @param MemAddSize Size of internal memory address
|
* @param MemAddSize Size of internal memory address
|
||||||
* @param Timeout Timeout duration
|
* @param Timeout Timeout duration
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_i2s.c
|
* @file stm32f1xx_hal_i2s.c
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief I2S HAL module driver.
|
* @brief I2S HAL module driver.
|
||||||
* This file provides firmware functions to manage the following
|
* This file provides firmware functions to manage the following
|
||||||
* functionalities of the Integrated Interchip Sound (I2S) peripheral:
|
* functionalities of the Integrated Interchip Sound (I2S) peripheral:
|
||||||
@@ -1363,7 +1361,7 @@ static void I2S_IRQHandler(I2S_HandleTypeDef *hi2s)
|
|||||||
I2S_Receive_IT(hi2s);
|
I2S_Receive_IT(hi2s);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* I2S Overrun error interrupt occured -------------------------------------*/
|
/* I2S Overrun error interrupt occurred -------------------------------------*/
|
||||||
if(((i2ssr & I2S_FLAG_OVR) == I2S_FLAG_OVR) && (__HAL_I2S_GET_IT_SOURCE(hi2s, I2S_IT_ERR) != RESET))
|
if(((i2ssr & I2S_FLAG_OVR) == I2S_FLAG_OVR) && (__HAL_I2S_GET_IT_SOURCE(hi2s, I2S_IT_ERR) != RESET))
|
||||||
{
|
{
|
||||||
/* Disable RXNE and ERR interrupt */
|
/* Disable RXNE and ERR interrupt */
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_irda.c
|
* @file stm32f1xx_hal_irda.c
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief IRDA HAL module driver.
|
* @brief IRDA HAL module driver.
|
||||||
* This file provides firmware functions to manage the following
|
* This file provides firmware functions to manage the following
|
||||||
* functionalities of the IrDA SIR ENDEC block (IrDA):
|
* functionalities of the IrDA SIR ENDEC block (IrDA):
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_iwdg.c
|
* @file stm32f1xx_hal_iwdg.c
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief IWDG HAL module driver.
|
* @brief IWDG HAL module driver.
|
||||||
* This file provides firmware functions to manage the following
|
* This file provides firmware functions to manage the following
|
||||||
* functionalities of the Independent Watchdog (IWDG) peripheral:
|
* functionalities of the Independent Watchdog (IWDG) peripheral:
|
||||||
@@ -166,7 +164,7 @@ HAL_StatusTypeDef HAL_IWDG_Init(IWDG_HandleTypeDef *hiwdg)
|
|||||||
uint32_t tickstart;
|
uint32_t tickstart;
|
||||||
|
|
||||||
/* Check the IWDG handle allocation */
|
/* Check the IWDG handle allocation */
|
||||||
if(hiwdg == NULL)
|
if (hiwdg == NULL)
|
||||||
{
|
{
|
||||||
return HAL_ERROR;
|
return HAL_ERROR;
|
||||||
}
|
}
|
||||||
@@ -190,9 +188,9 @@ HAL_StatusTypeDef HAL_IWDG_Init(IWDG_HandleTypeDef *hiwdg)
|
|||||||
tickstart = HAL_GetTick();
|
tickstart = HAL_GetTick();
|
||||||
|
|
||||||
/* Wait for register to be updated */
|
/* Wait for register to be updated */
|
||||||
while(hiwdg->Instance->SR != RESET)
|
while (hiwdg->Instance->SR != RESET)
|
||||||
{
|
{
|
||||||
if((HAL_GetTick() - tickstart ) > HAL_IWDG_DEFAULT_TIMEOUT)
|
if ((HAL_GetTick() - tickstart) > HAL_IWDG_DEFAULT_TIMEOUT)
|
||||||
{
|
{
|
||||||
return HAL_TIMEOUT;
|
return HAL_TIMEOUT;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_mmc.c
|
* @file stm32f1xx_hal_mmc.c
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief MMC card HAL module driver.
|
* @brief MMC card HAL module driver.
|
||||||
* This file provides firmware functions to manage the following
|
* This file provides firmware functions to manage the following
|
||||||
* functionalities of the Secure Digital (MMC) peripheral:
|
* functionalities of the Secure Digital (MMC) peripheral:
|
||||||
|
|||||||
109
workspace/TS100/HAL_Driver/Src/stm32f1xx_hal_msp_template.c
Normal file
109
workspace/TS100/HAL_Driver/Src/stm32f1xx_hal_msp_template.c
Normal file
@@ -0,0 +1,109 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file stm32f1xx_hal_msp_template.c
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief HAL BSP module.
|
||||||
|
* This file template is located in the HAL folder and should be copied
|
||||||
|
* to the user folder.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* <h2><center>© 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.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "stm32f1xx_hal.h"
|
||||||
|
|
||||||
|
/** @addtogroup STM32F1xx_HAL_Driver
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup HAL_MSP HAL_MSP
|
||||||
|
* @brief HAL MSP module.
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Private typedef -----------------------------------------------------------*/
|
||||||
|
/* Private define ------------------------------------------------------------*/
|
||||||
|
/* Private macro -------------------------------------------------------------*/
|
||||||
|
/* Private variables ---------------------------------------------------------*/
|
||||||
|
/* Private function prototypes -----------------------------------------------*/
|
||||||
|
/* Private functions ---------------------------------------------------------*/
|
||||||
|
|
||||||
|
/** @defgroup HAL_MSP_Exported_Functions HAL MSP Exported Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Initializes the Global MSP.
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void HAL_MspInit(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief DeInitializes the Global MSP.
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void HAL_MspDeInit(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Initializes the PPP MSP.
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void HAL_PPP_MspInit(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief DeInitializes the PPP MSP.
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void HAL_PPP_MspDeInit(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_nand.c
|
* @file stm32f1xx_hal_nand.c
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief NAND HAL module driver.
|
* @brief NAND HAL module driver.
|
||||||
* This file provides a generic firmware to drive NAND memories mounted
|
* This file provides a generic firmware to drive NAND memories mounted
|
||||||
* as external device.
|
* as external device.
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_nor.c
|
* @file stm32f1xx_hal_nor.c
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief NOR HAL module driver.
|
* @brief NOR HAL module driver.
|
||||||
* This file provides a generic firmware to drive NOR memories mounted
|
* This file provides a generic firmware to drive NOR memories mounted
|
||||||
* as external device.
|
* as external device.
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_pccard.c
|
* @file stm32f1xx_hal_pccard.c
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief PCCARD HAL module driver.
|
* @brief PCCARD HAL module driver.
|
||||||
* This file provides a generic firmware to drive PCCARD memories mounted
|
* This file provides a generic firmware to drive PCCARD memories mounted
|
||||||
* as external device.
|
* as external device.
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_pcd.c
|
* @file stm32f1xx_hal_pcd.c
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief PCD HAL module driver.
|
* @brief PCD HAL module driver.
|
||||||
* This file provides firmware functions to manage the following
|
* This file provides firmware functions to manage the following
|
||||||
* functionalities of the USB Peripheral Controller:
|
* functionalities of the USB Peripheral Controller:
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_pcd_ex.c
|
* @file stm32f1xx_hal_pcd_ex.c
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Extended PCD HAL module driver.
|
* @brief Extended PCD HAL module driver.
|
||||||
* This file provides firmware functions to manage the following
|
* This file provides firmware functions to manage the following
|
||||||
* functionalities of the USB Peripheral Controller:
|
* functionalities of the USB Peripheral Controller:
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_pwr.c
|
* @file stm32f1xx_hal_pwr.c
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief PWR HAL module driver.
|
* @brief PWR HAL module driver.
|
||||||
*
|
*
|
||||||
* This file provides firmware functions to manage the following
|
* This file provides firmware functions to manage the following
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_rcc.c
|
* @file stm32f1xx_hal_rcc.c
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief RCC HAL module driver.
|
* @brief RCC HAL module driver.
|
||||||
* This file provides firmware functions to manage the following
|
* This file provides firmware functions to manage the following
|
||||||
* functionalities of the Reset and Clock Control (RCC) peripheral:
|
* functionalities of the Reset and Clock Control (RCC) peripheral:
|
||||||
@@ -207,42 +205,144 @@ static void RCC_Delay(uint32_t mdelay);
|
|||||||
* @brief Resets the RCC clock configuration to the default reset state.
|
* @brief Resets the RCC clock configuration to the default reset state.
|
||||||
* @note The default reset state of the clock configuration is given below:
|
* @note The default reset state of the clock configuration is given below:
|
||||||
* - HSI ON and used as system clock source
|
* - HSI ON and used as system clock source
|
||||||
* - HSE and PLL OFF
|
* - HSE, PLL, PLL2 and PLL3 are OFF
|
||||||
* - AHB, APB1 and APB2 prescaler set to 1.
|
* - AHB, APB1 and APB2 prescaler set to 1.
|
||||||
* - CSS and MCO1 OFF
|
* - CSS and MCO1 OFF
|
||||||
* - All interrupts disabled
|
* - All interrupts disabled
|
||||||
|
* - All flags are cleared
|
||||||
* @note This function does not modify the configuration of the
|
* @note This function does not modify the configuration of the
|
||||||
* - Peripheral clocks
|
* - Peripheral clocks
|
||||||
* - LSI, LSE and RTC clocks
|
* - LSI, LSE and RTC clocks
|
||||||
* @retval None
|
* @retval HAL_StatusTypeDef
|
||||||
*/
|
*/
|
||||||
void HAL_RCC_DeInit(void)
|
HAL_StatusTypeDef HAL_RCC_DeInit(void)
|
||||||
{
|
{
|
||||||
/* Switch SYSCLK to HSI */
|
uint32_t tickstart;
|
||||||
CLEAR_BIT(RCC->CFGR, RCC_CFGR_SW);
|
|
||||||
|
|
||||||
/* Reset HSEON, CSSON, & PLLON bits */
|
/* Get Start Tick */
|
||||||
CLEAR_BIT(RCC->CR, RCC_CR_HSEON | RCC_CR_CSSON | RCC_CR_PLLON);
|
tickstart = HAL_GetTick();
|
||||||
|
|
||||||
/* Reset HSEBYP bit */
|
/* Set HSION bit */
|
||||||
CLEAR_BIT(RCC->CR, RCC_CR_HSEBYP);
|
SET_BIT(RCC->CR, RCC_CR_HSION);
|
||||||
|
|
||||||
/* Reset CFGR register */
|
/* Wait till HSI is ready */
|
||||||
CLEAR_REG(RCC->CFGR);
|
while (READ_BIT(RCC->CR, RCC_CR_HSIRDY) == RESET)
|
||||||
|
{
|
||||||
|
if ((HAL_GetTick() - tickstart) > HSI_TIMEOUT_VALUE)
|
||||||
|
{
|
||||||
|
return HAL_TIMEOUT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Set HSITRIM bits to the reset value */
|
/* Set HSITRIM bits to the reset value */
|
||||||
MODIFY_REG(RCC->CR, RCC_CR_HSITRIM, (0x10U << RCC_CR_HSITRIM_Pos));
|
MODIFY_REG(RCC->CR, RCC_CR_HSITRIM, (0x10U << RCC_CR_HSITRIM_Pos));
|
||||||
|
|
||||||
#if defined(RCC_CFGR2_SUPPORT)
|
/* Get Start Tick */
|
||||||
/* Reset CFGR2 register */
|
tickstart = HAL_GetTick();
|
||||||
CLEAR_REG(RCC->CFGR2);
|
|
||||||
|
|
||||||
#endif /* RCC_CFGR2_SUPPORT */
|
/* Reset CFGR register */
|
||||||
/* Disable all interrupts */
|
CLEAR_REG(RCC->CFGR);
|
||||||
CLEAR_REG(RCC->CIR);
|
|
||||||
|
/* Wait till clock switch is ready */
|
||||||
|
while (READ_BIT(RCC->CFGR, RCC_CFGR_SWS) != RESET)
|
||||||
|
{
|
||||||
|
if ((HAL_GetTick() - tickstart) > CLOCKSWITCH_TIMEOUT_VALUE)
|
||||||
|
{
|
||||||
|
return HAL_TIMEOUT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Update the SystemCoreClock global variable */
|
/* Update the SystemCoreClock global variable */
|
||||||
SystemCoreClock = HSI_VALUE;
|
SystemCoreClock = HSI_VALUE;
|
||||||
|
|
||||||
|
/* Adapt Systick interrupt period */
|
||||||
|
if(HAL_InitTick(TICK_INT_PRIORITY) != HAL_OK)
|
||||||
|
{
|
||||||
|
return HAL_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Get Start Tick */
|
||||||
|
tickstart = HAL_GetTick();
|
||||||
|
|
||||||
|
/* Second step is to clear PLLON bit */
|
||||||
|
CLEAR_BIT(RCC->CR, RCC_CR_PLLON);
|
||||||
|
|
||||||
|
/* Wait till PLL is disabled */
|
||||||
|
while (READ_BIT(RCC->CR, RCC_CR_PLLRDY) != RESET)
|
||||||
|
{
|
||||||
|
if ((HAL_GetTick() - tickstart) > PLL_TIMEOUT_VALUE)
|
||||||
|
{
|
||||||
|
return HAL_TIMEOUT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ensure to reset PLLSRC and PLLMUL bits */
|
||||||
|
CLEAR_REG(RCC->CFGR);
|
||||||
|
|
||||||
|
/* Get Start Tick */
|
||||||
|
tickstart = HAL_GetTick();
|
||||||
|
|
||||||
|
/* Reset HSEON & CSSON bits */
|
||||||
|
CLEAR_BIT(RCC->CR, RCC_CR_HSEON | RCC_CR_CSSON);
|
||||||
|
|
||||||
|
/* Wait till HSE is disabled */
|
||||||
|
while (READ_BIT(RCC->CR, RCC_CR_HSERDY) != RESET)
|
||||||
|
{
|
||||||
|
if ((HAL_GetTick() - tickstart) > HSE_TIMEOUT_VALUE)
|
||||||
|
{
|
||||||
|
return HAL_TIMEOUT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Reset HSEBYP bit */
|
||||||
|
CLEAR_BIT(RCC->CR, RCC_CR_HSEBYP);
|
||||||
|
|
||||||
|
#if defined(RCC_PLL2_SUPPORT)
|
||||||
|
/* Get Start Tick */
|
||||||
|
tickstart = HAL_GetTick();
|
||||||
|
|
||||||
|
/* Clear PLL2ON bit */
|
||||||
|
CLEAR_BIT(RCC->CR, RCC_CR_PLL2ON);
|
||||||
|
|
||||||
|
/* Wait till PLL2 is disabled */
|
||||||
|
while (READ_BIT(RCC->CR, RCC_CR_PLL2RDY) != RESET)
|
||||||
|
{
|
||||||
|
if ((HAL_GetTick() - tickstart) > PLL2_TIMEOUT_VALUE)
|
||||||
|
{
|
||||||
|
return HAL_TIMEOUT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* RCC_PLL2_SUPPORT */
|
||||||
|
|
||||||
|
#if defined(RCC_PLLI2S_SUPPORT)
|
||||||
|
/* Get Start Tick */
|
||||||
|
tickstart = HAL_GetTick();
|
||||||
|
|
||||||
|
/* Clear PLL3ON bit */
|
||||||
|
CLEAR_BIT(RCC->CR, RCC_CR_PLL3ON);
|
||||||
|
|
||||||
|
/* Wait till PLL3 is disabled */
|
||||||
|
while (READ_BIT(RCC->CR, RCC_CR_PLL3RDY) != RESET)
|
||||||
|
{
|
||||||
|
if ((HAL_GetTick() - tickstart) > PLLI2S_TIMEOUT_VALUE)
|
||||||
|
{
|
||||||
|
return HAL_TIMEOUT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* RCC_PLLI2S_SUPPORT */
|
||||||
|
|
||||||
|
#if defined(RCC_CFGR2_PREDIV1)
|
||||||
|
/* Reset CFGR2 register */
|
||||||
|
CLEAR_REG(RCC->CFGR2);
|
||||||
|
#endif /* RCC_CFGR2_PREDIV1 */
|
||||||
|
|
||||||
|
/* Reset all CSR flags */
|
||||||
|
SET_BIT(RCC->CSR, RCC_CSR_RMVF);
|
||||||
|
|
||||||
|
/* Disable all interrupts */
|
||||||
|
CLEAR_REG(RCC->CIR);
|
||||||
|
|
||||||
|
return HAL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -738,6 +838,19 @@ HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, ui
|
|||||||
/*-------------------------- HCLK Configuration --------------------------*/
|
/*-------------------------- HCLK Configuration --------------------------*/
|
||||||
if(((RCC_ClkInitStruct->ClockType) & RCC_CLOCKTYPE_HCLK) == RCC_CLOCKTYPE_HCLK)
|
if(((RCC_ClkInitStruct->ClockType) & RCC_CLOCKTYPE_HCLK) == RCC_CLOCKTYPE_HCLK)
|
||||||
{
|
{
|
||||||
|
/* Set the highest APBx dividers in order to ensure that we do not go through
|
||||||
|
a non-spec phase whatever we decrease or increase HCLK. */
|
||||||
|
if(((RCC_ClkInitStruct->ClockType) & RCC_CLOCKTYPE_PCLK1) == RCC_CLOCKTYPE_PCLK1)
|
||||||
|
{
|
||||||
|
MODIFY_REG(RCC->CFGR, RCC_CFGR_PPRE1, RCC_HCLK_DIV16);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(((RCC_ClkInitStruct->ClockType) & RCC_CLOCKTYPE_PCLK2) == RCC_CLOCKTYPE_PCLK2)
|
||||||
|
{
|
||||||
|
MODIFY_REG(RCC->CFGR, RCC_CFGR_PPRE2, (RCC_HCLK_DIV16 << 3));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Set the new HCLK clock divider */
|
||||||
assert_param(IS_RCC_HCLK(RCC_ClkInitStruct->AHBCLKDivider));
|
assert_param(IS_RCC_HCLK(RCC_ClkInitStruct->AHBCLKDivider));
|
||||||
MODIFY_REG(RCC->CFGR, RCC_CFGR_HPRE, RCC_ClkInitStruct->AHBCLKDivider);
|
MODIFY_REG(RCC->CFGR, RCC_CFGR_HPRE, RCC_ClkInitStruct->AHBCLKDivider);
|
||||||
}
|
}
|
||||||
@@ -1027,12 +1140,12 @@ uint32_t HAL_RCC_GetSysClockFreq(void)
|
|||||||
/* PLLCLK = PLL2CLK / PREDIV1 * PLLMUL with PLL2CLK = HSE/PREDIV2 * PLL2MUL */
|
/* PLLCLK = PLL2CLK / PREDIV1 * PLLMUL with PLL2CLK = HSE/PREDIV2 * PLL2MUL */
|
||||||
prediv2 = ((RCC->CFGR2 & RCC_CFGR2_PREDIV2) >> RCC_CFGR2_PREDIV2_Pos) + 1;
|
prediv2 = ((RCC->CFGR2 & RCC_CFGR2_PREDIV2) >> RCC_CFGR2_PREDIV2_Pos) + 1;
|
||||||
pll2mul = ((RCC->CFGR2 & RCC_CFGR2_PLL2MUL) >> RCC_CFGR2_PLL2MUL_Pos) + 2;
|
pll2mul = ((RCC->CFGR2 & RCC_CFGR2_PLL2MUL) >> RCC_CFGR2_PLL2MUL_Pos) + 2;
|
||||||
pllclk = (uint32_t)((((HSE_VALUE / prediv2) * pll2mul) / prediv) * pllmul);
|
pllclk = (uint32_t)(((uint64_t)HSE_VALUE * (uint64_t)pll2mul * (uint64_t)pllmul) / ((uint64_t)prediv2 * (uint64_t)prediv));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* HSE used as PLL clock source : PLLCLK = HSE/PREDIV1 * PLLMUL */
|
/* HSE used as PLL clock source : PLLCLK = HSE/PREDIV1 * PLLMUL */
|
||||||
pllclk = (uint32_t)((HSE_VALUE / prediv) * pllmul);
|
pllclk = (uint32_t)((HSE_VALUE * pllmul) / prediv);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If PLLMUL was set to 13 means that it was to cover the case PLLMUL 6.5 (avoid using float) */
|
/* If PLLMUL was set to 13 means that it was to cover the case PLLMUL 6.5 (avoid using float) */
|
||||||
@@ -1043,7 +1156,7 @@ uint32_t HAL_RCC_GetSysClockFreq(void)
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
/* HSE used as PLL clock source : PLLCLK = HSE/PREDIV1 * PLLMUL */
|
/* HSE used as PLL clock source : PLLCLK = HSE/PREDIV1 * PLLMUL */
|
||||||
pllclk = (uint32_t)((HSE_VALUE / prediv) * pllmul);
|
pllclk = (uint32_t)((HSE_VALUE * pllmul) / prediv);
|
||||||
#endif /*RCC_CFGR2_PREDIV1SRC*/
|
#endif /*RCC_CFGR2_PREDIV1SRC*/
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_rcc_ex.c
|
* @file stm32f1xx_hal_rcc_ex.c
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Extended RCC HAL module driver.
|
* @brief Extended RCC HAL module driver.
|
||||||
* This file provides firmware functions to manage the following
|
* This file provides firmware functions to manage the following
|
||||||
* functionalities RCC extension peripheral:
|
* functionalities RCC extension peripheral:
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_rtc.c
|
* @file stm32f1xx_hal_rtc.c
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief RTC HAL module driver.
|
* @brief RTC HAL module driver.
|
||||||
* This file provides firmware functions to manage the following
|
* This file provides firmware functions to manage the following
|
||||||
* functionalities of the Real Time Clock (RTC) peripheral:
|
* functionalities of the Real Time Clock (RTC) peripheral:
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_rtc_ex.c
|
* @file stm32f1xx_hal_rtc_ex.c
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief Extended RTC HAL module driver.
|
* @brief Extended RTC HAL module driver.
|
||||||
* This file provides firmware functions to manage the following
|
* This file provides firmware functions to manage the following
|
||||||
* functionalities of the Real Time Clock (RTC) Extension peripheral:
|
* functionalities of the Real Time Clock (RTC) Extension peripheral:
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
* @file stm32f1xx_hal_sd.c
|
* @file stm32f1xx_hal_sd.c
|
||||||
* @author MCD Application Team
|
* @author MCD Application Team
|
||||||
* @version V1.1.1
|
|
||||||
* @date 12-May-2017
|
|
||||||
* @brief SD card HAL module driver.
|
* @brief SD card HAL module driver.
|
||||||
* This file provides firmware functions to manage the following
|
* This file provides firmware functions to manage the following
|
||||||
* functionalities of the Secure Digital (SD) peripheral:
|
* functionalities of the Secure Digital (SD) peripheral:
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user