📄 stm32f10x_usart.lst
字号:
703 * - USART_FLAG_ORE
704 * - USART_FLAG_NE
705 * - USART_FLAG_FE
706 * - USART_FLAG_PE
707 * Output : None
708 * Return : The new state of USART_FLAG (SET or RESET).
709 *******************************************************************************/
710 FlagStatus USART_GetFlagStatus(USART_TypeDef* USARTx, u16 USART_FLAG)
711 {
712 FlagStatus bitstatus = RESET;
713
714 /* Check the parameters */
715 assert(IS_USART_FLAG(USART_FLAG));
716
717 if ((USARTx->SR & USART_FLAG) != (u16)RESET)
718 {
719 bitstatus = SET;
720 }
721 else
722 {
723 bitstatus = RESET;
724 }
725 return bitstatus;
726 }
727
728 /*******************************************************************************
729 * Function Name : USART_ClearFlag
730 * Description : Clears the USARTx's pending flags.
731 * Input : - USARTx: where x can be 1, 2 or 3 to select the USART
732 * peripheral.
733 * - USART_FLAG: specifies the flag to clear.
734 * This parameter can be any combination of the following values:
735 * - USART_FLAG_CTS
736 * - USART_FLAG_LBD
737 * - USART_FLAG_TXE
738 * - USART_FLAG_TC
739 * - USART_FLAG_RXNE
740 * - USART_FLAG_IDLE
741 * - USART_FLAG_ORE
742 * - USART_FLAG_NE
743 * - USART_FLAG_FE
744 * - USART_FLAG_PE
745 * Output : None
746 * Return : None
747 *******************************************************************************/
748 void USART_ClearFlag(USART_TypeDef* USARTx, u16 USART_FLAG)
749 {
750 /* Check the parameters */
751 assert(IS_USART_CLEAR_FLAG(USART_FLAG));
752
753 USARTx->SR &= (u16)~USART_FLAG;
754 }
755
756 /*******************************************************************************
757 * Function Name : USART_GetITStatus
758 * Description : Checks whether the specified USART interrupt has occurred or not.
759 * Input : - USARTx: where x can be 1, 2 or 3 to select the USART
760 * peripheral.
761 * - USART_IT: specifies the USART interrupt source to check.
762 * This parameter can be one of the following values:
763 * - USART_IT_PE
764 * - USART_IT_TXE
765 * - USART_IT_TC
766 * - USART_IT_RXNE
767 * - USART_IT_IDLE
768 * - USART_IT_LBD
769 * - USART_IT_CTS
770 * - USART_IT_ORE
771 * - USART_IT_NE
772 * - USART_IT_FE
773 * Output : None
774 * Return : The new state of USART_IT (SET or RESET).
775 *******************************************************************************/
776 ITStatus USART_GetITStatus(USART_TypeDef* USARTx, u16 USART_IT)
777 {
778 u32 bitpos = 0x00, itmask = 0x00, usartreg = 0;
779 ITStatus bitstatus = RESET;
780
781 /* Check the parameters */
782 assert(IS_USART_IT(USART_IT));
783
784 /* Get the USART register index */
785 usartreg = (((u8)USART_IT) >> 0x05);
786
787 /* Get the interrupt position */
788 itmask = USART_IT & USART_IT_Mask;
789
790 itmask = (u32)0x01 << itmask;
791
792 if (usartreg == 0x01) /* The IT is in CR1 register */
793 {
794 itmask &= USARTx->CR1;
795 }
796 else if (usartreg == 0x02) /* The IT is in CR2 register */
797 {
798 itmask &= USARTx->CR2;
799 }
800 else /* The IT is in CR3 register */
801 {
802 itmask &= USARTx->CR3;
803 }
804
805 bitpos = USART_IT >> 0x08;
806
807 bitpos = (u32)0x01 << bitpos;
808 bitpos &= USARTx->SR;
809
810 if ((itmask != (u16)RESET)&&(bitpos != (u16)RESET))
811 {
812 bitstatus = SET;
813 }
814 else
815 {
816 bitstatus = RESET;
817 }
818 return bitstatus;
819 }
820
821 /*******************************************************************************
822 * Function Name : USART_ClearITPendingBit
823 * Description : Clears the USARTx抯 interrupt pending bits.
824 * Input : - USARTx: where x can be 1, 2 or 3 to select the USART
825 * peripheral.
826 * - USART_IT: specifies the interrupt pending bit to clear.
827 * This parameter can be one of the following values:
828 * - USART_IT_PE
829 * - USART_IT_TXE
830 * - USART_IT_TC
831 * - USART_IT_RXNE
832 * - USART_IT_IDLE
833 * - USART_IT_LBD
834 * - USART_IT_CTS
835 * - USART_IT_ORE
836 * - USART_IT_NE
837 * - USART_IT_FE
838 * Output : None
839 * Return : None
840 *******************************************************************************/
841 void USART_ClearITPendingBit(USART_TypeDef* USARTx, u16 USART_IT)
842 {
843 u32 bitpos = 0x00, itmask = 0x00;
844
845 /* Check the parameters */
846 assert(IS_USART_IT(USART_IT));
847
848 bitpos = USART_IT >> 0x08;
849
850 itmask = (u32)0x01 << bitpos;
851 USARTx->SR &= ~itmask;
852 }
853
854 /******************* (C) COPYRIGHT 2007 STMicroelectronics *****END OF FILE****/
Maximum stack usage in bytes:
Function CSTACK
-------- ------
USART_ClearFlag 12
USART_ClearITPendingBit 12
USART_Cmd 12
USART_DMACmd 16
USART_DeInit 4
USART_GetFlagStatus 12
USART_GetITStatus 12
USART_HalfDuplexCmd 12
USART_ITConfig 16
USART_Init 36
USART_IrDACmd 12
USART_IrDAConfig 12
USART_LINBreakDetectLengthConfig
12
USART_LINCmd 12
USART_ReceiveData 0
USART_ReceiverWakeUpCmd 12
USART_SendBreak 0
USART_SendData 12
USART_SetAddress 12
USART_SetGuardTime 0
USART_SetPrescaler 0
USART_SmartCardCmd 12
USART_SmartCardNACKCmd 12
USART_StructInit 0
USART_WakeUpConfig 12
Segment part sizes:
Function/Label Bytes
-------------- -----
USART_DeInit 96
USART_Init 480
USART_StructInit 44
USART_Cmd 52
USART_ITConfig 152
USART_DMACmd 72
USART_SetAddress 44
USART_WakeUpConfig 48
USART_ReceiverWakeUpCmd 52
USART_LINBreakDetectLengthConfig
44
USART_LINCmd 52
USART_SendData 32
USART_ReceiveData 8
USART_SendBreak 10
USART_SetGuardTime 18
USART_SetPrescaler 16
USART_SmartCardCmd 52
USART_SmartCardNACKCmd 52
USART_HalfDuplexCmd 52
USART_IrDAConfig 48
USART_IrDACmd 48
USART_GetFlagStatus 84
USART_ClearFlag 36
USART_GetITStatus 192
USART_ClearITPendingBit 112
??DataTable11 4
??DataTable13 4
??DataTable14 4
??DataTable15 4
??DataTable16 4
??DataTable17 4
??DataTable18 4
??DataTable22 4
??DataTable32 4
??DataTable37 4
??DataTable39 4
??DataTable47 4
??DataTable48 4
??DataTable49 4
??DataTable50 4
??DataTable51 4
??DataTable52 4
??DataTable53 4
?<Constant "C:\\David JIANG\\ST MCU...">
92
Others 32
2 000 bytes in segment CODE
92 bytes in segment DATA_C
1 968 bytes of CODE memory (+ 32 bytes shared)
92 bytes of CONST memory
Errors: none
Warnings: none
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -