📄 stm32f10x_rcc.lst
字号:
914 * Description : Forces or releases the Backup domain reset.
915 * Input : - NewState: new state of the Backup domain reset.
916 * This parameter can be: ENABLE or DISABLE.
917 * Output : None
918 * Return : None
919 *******************************************************************************/
920 void RCC_BackupResetCmd(FunctionalState NewState)
921 {
922 /* Check the parameters */
923 assert_param(IS_FUNCTIONAL_STATE(NewState));
924
925 *(vu32 *) BDCR_BDRST_BB = (u32)NewState;
926 }
927
928 /*******************************************************************************
929 * Function Name : RCC_ClockSecuritySystemCmd
930 * Description : Enables or disables the Clock Security System.
931 * Input : - NewState: new state of the Clock Security System..
932 * This parameter can be: ENABLE or DISABLE.
933 * Output : None
934 * Return : None
935 *******************************************************************************/
936 void RCC_ClockSecuritySystemCmd(FunctionalState NewState)
937 {
938 /* Check the parameters */
939 assert_param(IS_FUNCTIONAL_STATE(NewState));
940
941 *(vu32 *) CR_CSSON_BB = (u32)NewState;
942 }
943
944 /*******************************************************************************
945 * Function Name : RCC_MCOConfig
946 * Description : Selects the clock source to output on MCO pin.
947 * Input : - RCC_MCO: specifies the clock source to output.
948 * This parameter can be one of the following values:
949 * - RCC_MCO_NoClock: No clock selected
950 * - RCC_MCO_SYSCLK: System clock selected
951 * - RCC_MCO_HSI: HSI oscillator clock selected
952 * - RCC_MCO_HSE: HSE oscillator clock selected
953 * - RCC_MCO_PLLCLK_Div2: PLL clock divided by 2 selected
954 * Output : None
955 * Return : None
956 *******************************************************************************/
957 void RCC_MCOConfig(u8 RCC_MCO)
958 {
959 /* Check the parameters */
960 assert_param(IS_RCC_MCO(RCC_MCO));
961
962 /* Perform Byte access to MCO[26:24] bits to select the MCO source */
963 *(vu8 *) 0x40021007 = RCC_MCO;
964 }
965
966 /*******************************************************************************
967 * Function Name : RCC_GetFlagStatus
968 * Description : Checks whether the specified RCC flag is set or not.
969 * Input : - RCC_FLAG: specifies the flag to check.
970 * This parameter can be one of the following values:
971 * - RCC_FLAG_HSIRDY: HSI oscillator clock ready
972 * - RCC_FLAG_HSERDY: HSE oscillator clock ready
973 * - RCC_FLAG_PLLRDY: PLL clock ready
974 * - RCC_FLAG_LSERDY: LSE oscillator clock ready
975 * - RCC_FLAG_LSIRDY: LSI oscillator clock ready
976 * - RCC_FLAG_PINRST: Pin reset
977 * - RCC_FLAG_PORRST: POR/PDR reset
978 * - RCC_FLAG_SFTRST: Software reset
979 * - RCC_FLAG_IWDGRST: Independent Watchdog reset
980 * - RCC_FLAG_WWDGRST: Window Watchdog reset
981 * - RCC_FLAG_LPWRRST: Low Power reset
982 * Output : None
983 * Return : The new state of RCC_FLAG (SET or RESET).
984 *******************************************************************************/
985 FlagStatus RCC_GetFlagStatus(u8 RCC_FLAG)
986 {
987 u32 tmp = 0;
988 u32 statusreg = 0;
989 FlagStatus bitstatus = RESET;
990
991 /* Check the parameters */
992 assert_param(IS_RCC_FLAG(RCC_FLAG));
993
994 /* Get the RCC register index */
995 tmp = RCC_FLAG >> 5;
996
997 if (tmp == 1) /* The flag to check is in CR register */
998 {
999 statusreg = RCC->CR;
1000 }
1001 else if (tmp == 2) /* The flag to check is in BDCR register */
1002 {
1003 statusreg = RCC->BDCR;
1004 }
1005 else /* The flag to check is in CSR register */
1006 {
1007 statusreg = RCC->CSR;
1008 }
1009
1010 /* Get the flag position */
1011 tmp = RCC_FLAG & FLAG_Mask;
1012
1013 if ((statusreg & ((u32)1 << tmp)) != (u32)RESET)
1014 {
1015 bitstatus = SET;
1016 }
1017 else
1018 {
1019 bitstatus = RESET;
1020 }
1021
1022 /* Return the flag status */
1023 return bitstatus;
1024 }
1025
1026 /*******************************************************************************
1027 * Function Name : RCC_ClearFlag
1028 * Description : Clears the RCC reset flags.
1029 * The reset flags are: RCC_FLAG_PINRST, RCC_FLAG_PORRST,
1030 * RCC_FLAG_SFTRST, RCC_FLAG_IWDGRST, RCC_FLAG_WWDGRST,
1031 * RCC_FLAG_LPWRRST
1032 * Input : None
1033 * Output : None
1034 * Return : None
1035 *******************************************************************************/
1036 void RCC_ClearFlag(void)
1037 {
1038 /* Set RMVF bit to clear the reset flags */
1039 RCC->CSR |= CSR_RMVF_Set;
1040 }
1041
1042 /*******************************************************************************
1043 * Function Name : RCC_GetITStatus
1044 * Description : Checks whether the specified RCC interrupt has occurred or not.
1045 * Input : - RCC_IT: specifies the RCC interrupt source to check.
1046 * This parameter can be one of the following values:
1047 * - RCC_IT_LSIRDY: LSI ready interrupt
1048 * - RCC_IT_LSERDY: LSE ready interrupt
1049 * - RCC_IT_HSIRDY: HSI ready interrupt
1050 * - RCC_IT_HSERDY: HSE ready interrupt
1051 * - RCC_IT_PLLRDY: PLL ready interrupt
1052 * - RCC_IT_CSS: Clock Security System interrupt
1053 * Output : None
1054 * Return : The new state of RCC_IT (SET or RESET).
1055 *******************************************************************************/
1056 ITStatus RCC_GetITStatus(u8 RCC_IT)
1057 {
1058 ITStatus bitstatus = RESET;
1059
1060 /* Check the parameters */
1061 assert_param(IS_RCC_GET_IT(RCC_IT));
1062
1063 /* Check the status of the specified RCC interrupt */
1064 if ((RCC->CIR & RCC_IT) != (u32)RESET)
1065 {
1066 bitstatus = SET;
1067 }
1068 else
1069 {
1070 bitstatus = RESET;
1071 }
1072
1073 /* Return the RCC_IT status */
1074 return bitstatus;
1075 }
1076
1077 /*******************************************************************************
1078 * Function Name : RCC_ClearITPendingBit
1079 * Description : Clears the RCC抯 interrupt pending bits.
1080 * Input : - RCC_IT: specifies the interrupt pending bit to clear.
1081 * This parameter can be any combination of the following values:
1082 * - RCC_IT_LSIRDY: LSI ready interrupt
1083 * - RCC_IT_LSERDY: LSE ready interrupt
1084 * - RCC_IT_HSIRDY: HSI ready interrupt
1085 * - RCC_IT_HSERDY: HSE ready interrupt
1086 * - RCC_IT_PLLRDY: PLL ready interrupt
1087 * - RCC_IT_CSS: Clock Security System interrupt
1088 * Output : None
1089 * Return : None
1090 *******************************************************************************/
1091 void RCC_ClearITPendingBit(u8 RCC_IT)
1092 {
1093 /* Check the parameters */
1094 assert_param(IS_RCC_CLEAR_IT(RCC_IT));
1095
1096 /* Perform Byte access to RCC_CIR[23:16] bits to clear the selected interrupt
1097 pending bits */
1098 *(vu8 *) 0x4002100A = RCC_IT;
1099 }
1100
1101 /******************* (C) COPYRIGHT 2007 STMicroelectronics *****END OF FILE****/
Maximum stack usage in bytes:
Function .cstack
-------- -------
RCC_ADCCLKConfig 0
RCC_AHBPeriphClockCmd 0
RCC_APB1PeriphClockCmd 0
RCC_APB1PeriphResetCmd 0
RCC_APB2PeriphClockCmd 0
RCC_APB2PeriphResetCmd 0
RCC_AdjustHSICalibrationValue 0
RCC_BackupResetCmd 0
RCC_ClearFlag 0
RCC_ClearITPendingBit 0
RCC_ClockSecuritySystemCmd 0
RCC_DeInit 0
RCC_GetClocksFreq 16
RCC_GetFlagStatus 8
RCC_GetITStatus 0
RCC_GetSYSCLKSource 0
RCC_HCLKConfig 0
RCC_HSEConfig 8
RCC_HSICmd 0
RCC_ITConfig 0
RCC_LSEConfig 8
RCC_LSICmd 0
RCC_MCOConfig 0
RCC_PCLK1Config 0
RCC_PCLK2Config 0
RCC_PLLCmd 0
RCC_PLLConfig 0
RCC_RTCCLKCmd 0
RCC_RTCCLKConfig 0
RCC_SYSCLKConfig 0
RCC_USBCLKConfig 0
RCC_WaitForHSEStartUp 8
Section sizes:
Function/Label Bytes
-------------- -----
APBAHBPrescTable 16
ADCPrescTable 4
HSEStatus
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -