[NUCLEO_F103RB] Update to std periph driver V3.6.1

pull/158/head
bcostm 2014-02-01 18:48:55 +01:00
parent b275fc579a
commit 3fba65b769
50 changed files with 198 additions and 191 deletions

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file misc.c
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file provides all the miscellaneous firmware functions (add-on
* to CMSIS functions).
*******************************************************************************
@ -237,4 +237,4 @@ void SysTick_CLKSourceConfig(uint32_t SysTick_CLKSource)
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file misc.h
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file contains all the functions prototypes for the miscellaneous
* firmware library functions (add-on to CMSIS functions).
*******************************************************************************
@ -232,4 +232,4 @@ void SysTick_CLKSourceConfig(uint32_t SysTick_CLKSource);
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_adc.c
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file provides all the ADC firmware functions.
*******************************************************************************
* Copyright (c) 2014, STMicroelectronics
@ -1319,4 +1319,4 @@ void ADC_ClearITPendingBit(ADC_TypeDef* ADCx, uint16_t ADC_IT)
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_adc.h
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file contains all the functions prototypes for the ADC firmware
* library.
*******************************************************************************
@ -495,4 +495,4 @@ void ADC_ClearITPendingBit(ADC_TypeDef* ADCx, uint16_t ADC_IT);
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_bkp.c
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file provides all the BKP firmware functions.
*******************************************************************************
* Copyright (c) 2014, STMicroelectronics
@ -320,4 +320,4 @@ void BKP_ClearITPendingBit(void)
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_bkp.h
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file contains all the functions prototypes for the BKP firmware
* library.
*******************************************************************************
@ -207,4 +207,4 @@ void BKP_ClearITPendingBit(void);
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_can.c
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file provides all the CAN firmware functions.
*******************************************************************************
* Copyright (c) 2014, STMicroelectronics
@ -1427,4 +1427,4 @@ static ITStatus CheckITStatus(uint32_t CAN_Reg, uint32_t It_Bit)
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_can.h
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file contains all the functions prototypes for the CAN firmware
* library.
*******************************************************************************
@ -709,4 +709,4 @@ void CAN_ClearITPendingBit(CAN_TypeDef* CANx, uint32_t CAN_IT);
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_cec.c
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file provides all the CEC firmware functions.
*******************************************************************************
* Copyright (c) 2014, STMicroelectronics
@ -445,4 +445,4 @@ void CEC_ClearITPendingBit(uint16_t CEC_IT)
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_cec.h
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file contains all the functions prototypes for the CEC firmware
* library.
*******************************************************************************
@ -222,4 +222,4 @@ void CEC_ClearITPendingBit(uint16_t CEC_IT);
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file Project/STM32F10x_StdPeriph_Template/stm32f10x_conf.h
* @author MCD Application Team
* @version V3.5.0
* @date 08-April-2011
* @version V3.6.1
* @date 05-March-2012
* @brief Library configuration file.
*******************************************************************************
* Copyright (c) 2014, STMicroelectronics
@ -89,4 +89,4 @@
#endif /* __STM32F10x_CONF_H */
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_crc.c
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file provides all the CRC firmware functions.
*******************************************************************************
* Copyright (c) 2014, STMicroelectronics
@ -172,4 +172,4 @@ uint8_t CRC_GetIDRegister(void)
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_crc.h
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file contains all the functions prototypes for the CRC firmware
* library.
*******************************************************************************
@ -106,4 +106,4 @@ uint8_t CRC_GetIDRegister(void);
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_dac.c
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file provides all the DAC firmware functions.
*******************************************************************************
* Copyright (c) 2014, STMicroelectronics
@ -583,4 +583,4 @@ void DAC_ClearITPendingBit(uint32_t DAC_Channel, uint32_t DAC_IT)
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_dac.h
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file contains all the functions prototypes for the DAC firmware
* library.
*******************************************************************************
@ -329,4 +329,4 @@ void DAC_ClearITPendingBit(uint32_t DAC_Channel, uint32_t DAC_IT);
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_dbgmcu.c
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file provides all the DBGMCU firmware functions.
*******************************************************************************
* Copyright (c) 2014, STMicroelectronics
@ -174,4 +174,4 @@ void DBGMCU_Config(uint32_t DBGMCU_Periph, FunctionalState NewState)
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_dbgmcu.h
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file contains all the functions prototypes for the DBGMCU
* firmware library.
*******************************************************************************
@ -131,4 +131,4 @@ void DBGMCU_Config(uint32_t DBGMCU_Periph, FunctionalState NewState);
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_dma.c
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file provides all the DMA firmware functions.
*******************************************************************************
* Copyright (c) 2014, STMicroelectronics
@ -726,4 +726,4 @@ void DMA_ClearITPendingBit(uint32_t DMAy_IT)
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_dma.h
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file contains all the functions prototypes for the DMA firmware
* library.
*******************************************************************************
@ -451,4 +451,4 @@ void DMA_ClearITPendingBit(uint32_t DMAy_IT);
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_exti.c
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file provides all the EXTI firmware functions.
*******************************************************************************
* Copyright (c) 2014, STMicroelectronics
@ -281,4 +281,4 @@ void EXTI_ClearITPendingBit(uint32_t EXTI_Line)
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_exti.h
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file contains all the functions prototypes for the EXTI firmware
* library.
*******************************************************************************
@ -97,7 +97,7 @@ typedef struct
This parameter can be a value of @ref EXTIMode_TypeDef */
EXTITrigger_TypeDef EXTI_Trigger; /*!< Specifies the trigger signal active edge for the EXTI lines.
This parameter can be a value of @ref EXTIMode_TypeDef */
This parameter can be a value of @ref EXTITrigger_TypeDef */
FunctionalState EXTI_LineCmd; /*!< Specifies the new state of the selected EXTI lines.
This parameter can be set either to ENABLE or DISABLE */
@ -196,4 +196,4 @@ void EXTI_ClearITPendingBit(uint32_t EXTI_Line);
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_flash.c
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file provides all the FLASH firmware functions.
*******************************************************************************
* Copyright (c) 2014, STMicroelectronics
@ -88,11 +88,6 @@
#define WRP3_Mask ((uint32_t)0xFF000000)
#define OB_USER_BFB2 ((uint16_t)0x0008)
/* FLASH Keys */
#define RDP_Key ((uint16_t)0x00A5)
#define FLASH_KEY1 ((uint32_t)0x45670123)
#define FLASH_KEY2 ((uint32_t)0xCDEF89AB)
/* FLASH BANK address */
#define FLASH_BANK1_END_ADDRESS ((uint32_t)0x807FFFF)
@ -1696,4 +1691,4 @@ FLASH_Status FLASH_WaitForLastBank2Operation(uint32_t Timeout)
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_flash.h
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file contains all the functions prototypes for the FLASH
* firmware library.
*******************************************************************************
@ -438,4 +438,4 @@ FLASH_Status FLASH_BootConfig(uint16_t FLASH_BOOT);
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_fsmc.c
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file provides all the FSMC firmware functions.
*******************************************************************************
* Copyright (c) 2014, STMicroelectronics
@ -878,4 +878,4 @@ void FSMC_ClearITPendingBit(uint32_t FSMC_Bank, uint32_t FSMC_IT)
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_fsmc.h
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file contains all the functions prototypes for the FSMC firmware
* library.
*******************************************************************************
@ -745,4 +745,4 @@ void FSMC_ClearITPendingBit(uint32_t FSMC_Bank, uint32_t FSMC_IT);
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_gpio.c
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file provides all the GPIO firmware functions.
*******************************************************************************
* Copyright (c) 2014, STMicroelectronics
@ -662,4 +662,4 @@ void GPIO_ETH_MediaInterfaceConfig(uint32_t GPIO_ETH_MediaInterface)
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_gpio.h
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file contains all the functions prototypes for the GPIO
* firmware library.
*******************************************************************************
@ -397,4 +397,4 @@ void GPIO_ETH_MediaInterfaceConfig(uint32_t GPIO_ETH_MediaInterface);
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_i2c.c
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file provides all the I2C firmware functions.
*******************************************************************************
* Copyright (c) 2014, STMicroelectronics
@ -1343,4 +1343,4 @@ void I2C_ClearITPendingBit(I2C_TypeDef* I2Cx, uint32_t I2C_IT)
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_i2c.h
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file contains all the functions prototypes for the I2C firmware
* library.
*******************************************************************************
@ -696,4 +696,4 @@ void I2C_ClearITPendingBit(I2C_TypeDef* I2Cx, uint32_t I2C_IT);
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_iwdg.c
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file provides all the IWDG firmware functions.
*******************************************************************************
* Copyright (c) 2014, STMicroelectronics
@ -202,4 +202,4 @@ FlagStatus IWDG_GetFlagStatus(uint16_t IWDG_FLAG)
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_iwdg.h
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file contains all the functions prototypes for the IWDG
* firmware library.
*******************************************************************************
@ -152,4 +152,4 @@ FlagStatus IWDG_GetFlagStatus(uint16_t IWDG_FLAG);
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_pwr.c
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file provides all the PWR firmware functions.
*******************************************************************************
* Copyright (c) 2014, STMicroelectronics
@ -319,4 +319,4 @@ void PWR_ClearFlag(uint32_t PWR_FLAG)
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_pwr.h
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file contains all the functions prototypes for the PWR firmware
* library.
*******************************************************************************
@ -168,4 +168,4 @@ void PWR_ClearFlag(uint32_t PWR_FLAG);
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_rcc.c
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file provides all the RCC firmware functions.
*******************************************************************************
* Copyright (c) 2014, STMicroelectronics
@ -1482,4 +1482,4 @@ void RCC_ClearITPendingBit(uint8_t RCC_IT)
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_rcc.h
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file contains all the functions prototypes for the RCC firmware
* library.
*******************************************************************************
@ -739,4 +739,4 @@ void RCC_ClearITPendingBit(uint8_t RCC_IT);
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_rtc.c
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file provides all the RTC firmware functions.
*******************************************************************************
* Copyright (c) 2014, STMicroelectronics
@ -147,9 +147,22 @@ void RTC_ExitConfigMode(void)
*/
uint32_t RTC_GetCounter(void)
{
uint16_t tmp = 0;
tmp = RTC->CNTL;
return (((uint32_t)RTC->CNTH << 16 ) | tmp) ;
uint16_t high1 = 0, high2 = 0, low = 0;
high1 = RTC->CNTH;
low = RTC->CNTL;
high2 = RTC->CNTH;
if (high1 != high2)
{ /* In this case the counter roll over during reading of CNTL and CNTH registers,
read again CNTL register then return the counter value */
return (((uint32_t) high2 << 16 ) | RTC->CNTL);
}
else
{ /* No counter roll over during reading of CNTL and CNTH registers, counter
value is equal to first value of CNTL and CNTH */
return (((uint32_t) high1 << 16 ) | low);
}
}
/**
@ -351,4 +364,4 @@ void RTC_ClearITPendingBit(uint16_t RTC_IT)
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_rtc.h
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file contains all the functions prototypes for the RTC firmware
* library.
*******************************************************************************
@ -147,4 +147,4 @@ void RTC_ClearITPendingBit(uint16_t RTC_IT);
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_sdio.c
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file provides all the SDIO firmware functions.
*******************************************************************************
* Copyright (c) 2014, STMicroelectronics
@ -268,8 +268,7 @@ void SDIO_SetPowerState(uint32_t SDIO_PowerState)
/* Check the parameters */
assert_param(IS_SDIO_POWER_STATE(SDIO_PowerState));
SDIO->POWER &= PWR_PWRCTRL_MASK;
SDIO->POWER |= SDIO_PowerState;
SDIO->POWER = SDIO_PowerState;
}
/**
@ -811,4 +810,4 @@ void SDIO_ClearITPendingBit(uint32_t SDIO_IT)
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_sdio.h
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file contains all the functions prototypes for the SDIO firmware
* library.
*******************************************************************************
@ -543,4 +543,4 @@ void SDIO_ClearITPendingBit(uint32_t SDIO_IT);
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_spi.c
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file provides all the SPI firmware functions.
*******************************************************************************
* Copyright (c) 2014, STMicroelectronics
@ -920,4 +920,4 @@ void SPI_I2S_ClearITPendingBit(SPI_TypeDef* SPIx, uint8_t SPI_I2S_IT)
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_spi.h
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file contains all the functions prototypes for the SPI firmware
* library.
*******************************************************************************
@ -499,4 +499,4 @@ void SPI_I2S_ClearITPendingBit(SPI_TypeDef* SPIx, uint8_t SPI_I2S_IT);
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_tim.c
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file provides all the TIM firmware functions.
*******************************************************************************
* Copyright (c) 2014, STMicroelectronics
@ -2126,10 +2126,10 @@ void TIM_UpdateDisableConfig(TIM_TypeDef* TIMx, FunctionalState NewState)
* @param TIMx: where x can be 1 to 17 to select the TIM peripheral.
* @param TIM_UpdateSource: specifies the Update source.
* This parameter can be one of the following values:
* @arg TIM_UpdateSource_Regular: Source of update is the counter overflow/underflow
* @arg TIM_UpdateSource_Global: Source of update is the counter overflow/underflow
or the setting of UG bit, or an update generation
through the slave mode controller.
* @arg TIM_UpdateSource_Global: Source of update is counter overflow/underflow.
* @arg TIM_UpdateSource_Regular: Source of update is counter overflow/underflow.
* @retval None
*/
void TIM_UpdateRequestConfig(TIM_TypeDef* TIMx, uint16_t TIM_UpdateSource)
@ -2902,4 +2902,4 @@ static void TI4_Config(TIM_TypeDef* TIMx, uint16_t TIM_ICPolarity, uint16_t TIM_
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_tim.h
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file contains all the functions prototypes for the TIM firmware
* library.
*******************************************************************************
@ -1176,4 +1176,4 @@ void TIM_ClearITPendingBit(TIM_TypeDef* TIMx, uint16_t TIM_IT);
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_usart.c
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file provides all the USART firmware functions.
*******************************************************************************
* Copyright (c) 2014, STMicroelectronics
@ -962,7 +962,8 @@ void USART_ClearFlag(USART_TypeDef* USARTx, uint16_t USART_FLAG)
* @arg USART_IT_TC: Transmission complete interrupt
* @arg USART_IT_RXNE: Receive Data register not empty interrupt
* @arg USART_IT_IDLE: Idle line detection interrupt
* @arg USART_IT_ORE: OverRun Error interrupt
* @arg USART_IT_ORE_RX : OverRun Error interrupt if the RXNEIE bit is set
* @arg USART_IT_ORE_ER : OverRun Error interrupt if the EIE bit is set
* @arg USART_IT_NE: Noise Error interrupt
* @arg USART_IT_FE: Framing Error interrupt
* @arg USART_IT_PE: Parity Error interrupt
@ -1070,4 +1071,4 @@ void USART_ClearITPendingBit(USART_TypeDef* USARTx, uint16_t USART_IT)
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_usart.h
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file contains all the functions prototypes for the USART
* firmware library.
*******************************************************************************
@ -258,22 +258,35 @@ typedef struct
#define USART_IT_TXE ((uint16_t)0x0727)
#define USART_IT_TC ((uint16_t)0x0626)
#define USART_IT_RXNE ((uint16_t)0x0525)
#define USART_IT_ORE_RX ((uint16_t)0x0325) /* In case interrupt is generated if the RXNEIE bit is set */
#define USART_IT_IDLE ((uint16_t)0x0424)
#define USART_IT_LBD ((uint16_t)0x0846)
#define USART_IT_CTS ((uint16_t)0x096A)
#define USART_IT_ERR ((uint16_t)0x0060)
#define USART_IT_ORE ((uint16_t)0x0360)
#define USART_IT_ORE_ER ((uint16_t)0x0360) /* In case interrupt is generated if the EIE bit is set */
#define USART_IT_NE ((uint16_t)0x0260)
#define USART_IT_FE ((uint16_t)0x0160)
/** @defgroup USART_Legacy
* @{
*/
#define USART_IT_ORE USART_IT_ORE_ER
/**
* @}
*/
#define IS_USART_CONFIG_IT(IT) (((IT) == USART_IT_PE) || ((IT) == USART_IT_TXE) || \
((IT) == USART_IT_TC) || ((IT) == USART_IT_RXNE) || \
((IT) == USART_IT_IDLE) || ((IT) == USART_IT_LBD) || \
((IT) == USART_IT_CTS) || ((IT) == USART_IT_ERR))
#define IS_USART_GET_IT(IT) (((IT) == USART_IT_PE) || ((IT) == USART_IT_TXE) || \
((IT) == USART_IT_TC) || ((IT) == USART_IT_RXNE) || \
((IT) == USART_IT_IDLE) || ((IT) == USART_IT_LBD) || \
((IT) == USART_IT_CTS) || ((IT) == USART_IT_ORE) || \
((IT) == USART_IT_ORE_RX) || ((IT) == USART_IT_ORE_ER) || \
((IT) == USART_IT_NE) || ((IT) == USART_IT_FE))
#define IS_USART_CLEAR_IT(IT) (((IT) == USART_IT_TC) || ((IT) == USART_IT_RXNE) || \
((IT) == USART_IT_LBD) || ((IT) == USART_IT_CTS))
/**
@ -350,9 +363,7 @@ typedef struct
((FLAG) == USART_FLAG_NE) || ((FLAG) == USART_FLAG_FE))
#define IS_USART_CLEAR_FLAG(FLAG) ((((FLAG) & (uint16_t)0xFC9F) == 0x00) && ((FLAG) != (uint16_t)0x00))
#define IS_USART_PERIPH_FLAG(PERIPH, USART_FLAG) ((((*(uint32_t*)&(PERIPH)) != UART4_BASE) &&\
((*(uint32_t*)&(PERIPH)) != UART5_BASE)) \
|| ((USART_FLAG) != USART_FLAG_CTS))
#define IS_USART_BAUDRATE(BAUDRATE) (((BAUDRATE) > 0) && ((BAUDRATE) < 0x0044AA21))
#define IS_USART_ADDRESS(ADDRESS) ((ADDRESS) <= 0xF)
#define IS_USART_DATA(DATA) ((DATA) <= 0x1FF)
@ -424,4 +435,4 @@ void USART_ClearITPendingBit(USART_TypeDef* USARTx, uint16_t USART_IT);
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_wwdg.c
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file provides all the WWDG firmware functions.
*******************************************************************************
* Copyright (c) 2014, STMicroelectronics
@ -236,4 +236,4 @@ void WWDG_ClearFlag(void)
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file stm32f10x_wwdg.h
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief This file contains all the functions prototypes for the WWDG firmware
* library.
*******************************************************************************
@ -127,4 +127,4 @@ void WWDG_ClearFlag(void);
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file system_stm32f10x.c
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.1
* @date 05-March-2012
* @brief CMSIS Cortex-M3 Device Peripheral Access Layer System Source File.
*
* 1. This file provides two functions and one global variable to be called from
@ -1106,4 +1106,4 @@ static void SetSysClockTo72(void)
/**
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -2,8 +2,8 @@
******************************************************************************
* @file system_stm32f10x.h
* @author MCD Application Team
* @version V3.5.0
* @date 11-March-2011
* @version V3.6.2
* @date 28-February-2013
* @brief CMSIS Cortex-M3 Device Peripheral Access Layer System Header File.
*******************************************************************************
* Copyright (c) 2014, STMicroelectronics
@ -110,4 +110,4 @@ extern void SystemCoreClockUpdate(void);
/**
* @}
*/
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -30,41 +30,29 @@
#include "sleep_api.h"
#include "cmsis.h"
// This function is only necessary if the HSE is used.
/*
static void SYSCLKConfig_STOP(void)
{
ErrorStatus HSEStartUpStatus;
RCC_HSEConfig(RCC_HSE_ON); // Enable HSE
HSEStartUpStatus = RCC_WaitForHSEStartUp(); // Wait till HSE is ready
if (HSEStartUpStatus == SUCCESS) {
RCC_PLLCmd(ENABLE); // Enable PLL
while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET) {} // Wait till PLL is ready
RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK); // Select PLL as system clock source
while(RCC_GetSYSCLKSource() != 0x08) {} // Wait till PLL is used as system clock source
}
}
*/
void sleep(void)
{
// Disable us_ticker update interrupt
TIM_ITConfig(TIM1, TIM_IT_Update, DISABLE);
SCB->SCR = 0; // Normal sleep mode for ARM core
__WFI();
// Re-ensable us_ticker update interrupt
TIM_ITConfig(TIM1, TIM_IT_Update, ENABLE);
}
void deepsleep(void)
{
{
// Disable us_ticker update interrupt
TIM_ITConfig(TIM1, TIM_IT_Update, DISABLE);
// Enable PWR clock
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);
// Request to enter STOP mode with regulator in low power mode
PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI);
// At this stage the system has resumed from STOP mode.
// Re-configure the system clock: enable HSE, PLL and select
// PLL as system clock source (because HSE and PLL are disabled in STOP mode).
//SYSCLKConfig_STOP();
PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI);
// Re-ensable us_ticker update interrupt
TIM_ITConfig(TIM1, TIM_IT_Update, ENABLE);
}