The table below lists the main functions used by the AFEC.
Function Name | Description | Location | Impacted Registers |
---|---|---|---|
void AFEC_Initialize arguments: Afec* pAFEC; uint32_t dwId |
Initialize the Power Management Controller to enable the AFEC clock | afec.c | PMC_PCSR0 (ID 29), PMC_PCSR1 (ID 40), AFEC_CR, AFEC_MR |
uint32_t AFEC_SetClock arguments: Afec* pAFEC; uint32_t dwPres; uint32_t dwMck |
Configure the PRESCAL value of the AFEC_MR register to get the required AFEC frequency | afec.c | AFEC_MR |
void AFEC_SetTiming arguments: Afec* pAFEC; uint32_t dwStartup; uint32_t dwTracking; uint32_t wSettling |
Configure the TRANSFER, STARTUP and TRACKTIM bits of the AFEC_MR register | afec.c | AFEC_MR |
void AFEC_SetTrigger arguments: Afec* pAFEC; uint32_t dwTrgSel |
Configure the trigger source | afec.c | AFEC_MR |
void AFEC_SetAnalogChange arguments: Afec* pAFEC; uint8_t bEnDis |
If enabled, it allows different analog settings for each channel, Otherwise, DIFF0, GAIN0 and OFF0 are used for all channels. |
afec.c | |
void AFEC_SetSleepMode arguments: Afec* pAFEC; uint8_t bEnDis |
Enable/Disable Sleep mode | afec.c | AFEC_MR |
void AFEC_SetFastWakeup arguments: Afec* pAFEC; uint8_t bEnDis |
Enable/Disable Fast Wake-up mode | afec.c | AFEC_MR |
void AFEC_SetSequenceMode arguments: Afec* pAFEC; uint8_t bEnDis |
Enable/Disable Sequence mode | afec.c | AFEC_MR |
void AFEC_SetSequence arguments: Afec* pAFEC; uint32_t dwSEQ1 ; uint32_t dwSEQ2 |
Set channel sequence. | afec.c |
AFEC_SEQ1R AFEC_SEQ2R |
void AFEC_SetSequenceByList arguments: Afec* pAFEC; uint8_t ucChList[] ; uint8_t ucNumCh |
Set sequence by list | afec.c |
AFEC_SEQ1R AFEC_SEQ2R |
void AFEC_SetTagEnable arguments: Afec* pAFEC; uint8_t bEnDis |
Set "TAG" mode, show channel number in last data or not. | afec.c | AFEC_EMR |
void AFEC_SetCompareChannel arguments: Afec* pAFEC; uint32_t dwChannel |
Set compare channel | afec.c | AFEC_EMR |
void AFEC_SetCompareMode arguments: Afec* pAFEC; uint32_t dwMode |
Enable/Disable Compare mode | afec.c | AFEC_EMR |
void AFEC_SetComparisonWindow arguments: Afec* pAFEC; uint32_t dwHi |
Set comparison values | afec.c | AFEC_CWR |
uint32_t AFEC_GetConvertedData arguments: Afec* pAFEC; uint32_t dwChannel |
Get the last converted data | afec.c | AFEC_CSELR |
void AFEC_SetStartupTime arguments: Afec* pAFEC; uint32_t dwUs |
Set the start-up time | afec.c | AFEC_MR |
void AFEC_SetTrackingTime arguments: Afec* pAFEC; uint32_t dwNs |
Set the tracking time | afec.c | AFEC_MR |
void AFEC_SetAnalogOffset arguments: Afec* pAFEC; uint32_t dwChannel ; uint32_t aoffset |
Set the analog offset | afec.c |
AFEC_CSELR AFEC_COCR |
void AFEC_SetAnalogControl arguments: Afec* pAFEC ; uint32_t control |
Set analog offset to be used for channel CSEL | afec.c | AFEC_ACR |
uint32_t Afe_ConfigureDma arguments: AfeDma *pAfed ; Afec *pAfeHw ; uint8_t AfeId; sXdmad *pXdmad |
Configure the DMA to work with AFEC | afe_dma.c | |
uint32_t Afe_SendData arguments: AfeDma *pAfed ; AfeCmd *pCommand |
Send AFEC data with the DMA | afe_dma.c |