MG32F10x Standard Peripherals Firmware Library

mg32f10x_sfm.h
浏览该文件的文档.
1
10 /* Define to prevent recursive inclusion -------------------------------------*/
11 #ifndef __MG32F10x_SFM_H
12 #define __MG32F10x_SFM_H
13
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17
18 /* Includes ------------------------------------------------------------------*/
19 #include "mg32f10x.h"
20
29 /* Exported types ------------------------------------------------------------*/
30 /* Exported constants --------------------------------------------------------*/
31
39 #define SFM_USBP_DETECT_SE0 0x0100
40 #define SFM_USBP_DETECT_JSTAT 0x0200
41 #define SFM_USBP_DETECT_KSTAT 0x0400
42 #define SFM_USBP_DETECT_SE1 0x0800
43
50 #define SFM_USBP_FLAG_SE0 0x01
51 #define SFM_USBP_FLAG_JSTAT 0x02
52 #define SFM_USBP_FLAG_KSTAT 0x04
53 #define SFM_USBP_FLAG_SE1 0x08
54
62 /* Exported macro ------------------------------------------------------------*/
63 /* Exported functions --------------------------------------------------------*/
64
65 void CRC_SFM_DeInit(void);
66 uint32_t SFM_ComputeBit1Number(uint32_t Data);
67 void SFM_ExpandBits(uint32_t Data, uint32_t* pBuffer, uint32_t ExpandRate);
68 void SFM_USBPort_DetectConfig(uint32_t SFM_USBP_DETECT, FunctionalState NewState);
69 FlagStatus SFM_USBPort_GetFlagStatus(uint32_t SFM_USBP_FLAG);
70 void SFM_USBPort_ClearFlag(uint32_t SFM_USBP_FLAG);
71
80 #ifdef __cplusplus
81 }
82 #endif
83
84 #endif /* __MG32F10x_SFM_H */
SFM_ComputeBit1Number
uint32_t SFM_ComputeBit1Number(uint32_t Data)
Returns the number of bit 1 in a word(32-bit).
Definition: mg32f10x_sfm.c:48
SFM_USBPort_GetFlagStatus
FlagStatus SFM_USBPort_GetFlagStatus(uint32_t SFM_USBP_FLAG)
Checks whether the specified USB Port flag is set or not.
Definition: mg32f10x_sfm.c:106
SFM_USBPort_ClearFlag
void SFM_USBPort_ClearFlag(uint32_t SFM_USBP_FLAG)
Clears the USB Port's pending flags.
Definition: mg32f10x_sfm.c:131
SFM_USBPort_DetectConfig
void SFM_USBPort_DetectConfig(uint32_t SFM_USBP_DETECT, FunctionalState NewState)
Configure the USB Port state detect function.
Definition: mg32f10x_sfm.c:86
CRC_SFM_DeInit
void CRC_SFM_DeInit(void)
Deinitializes the CRC and SFM peripheral registers to their default reset values.
Definition: mg32f10x_sfm.c:37
SFM_ExpandBits
void SFM_ExpandBits(uint32_t Data, uint32_t *pBuffer, uint32_t ExpandRate)
Expand a word(32-bit) with specified rate.
Definition: mg32f10x_sfm.c:62