SAMV71 Xplained Ultra Software Package 1.3

afec.c File Reference

#include "chip.h"

Go to the source code of this file.

Functions

void AFEC_Initialize (Afec *pAFE, uint32_t dwID)
 Initialize the AFE controller.
uint32_t AFEC_SetClock (Afec *pAFE, uint32_t dwClk, uint32_t dwMck)
 Set AFE clock.
void AFEC_SetTiming (Afec *pAFE, uint32_t dwStartup, uint32_t dwTracking, uint32_t dwSettling)
 Set AFE timing.
void AFEC_SetTrigger (Afec *pAFE, uint32_t dwTrgSel)
 Set AFE trigger.
void AFEC_SetSleepMode (Afec *pAFE, uint8_t bEnDis)
 Enable/Disable sleep mode.
void AFEC_SetFastWakeup (Afec *pAFE, uint8_t bEnDis)
 Enable/Disable fast wake up.
void AFEC_SetSequenceMode (Afec *pAFE, uint8_t bEnDis)
 Enable/Disable sequence mode.
void AFEC_SetSequence (Afec *pAFE, uint32_t dwSEQ1, uint32_t dwSEQ2)
 Set channel sequence.
void AFEC_SetSequenceByList (Afec *pAFE, uint8_t ucChList[], uint8_t ucNumCh)
 Set channel sequence by given channel list.
void AFEC_SetAnalogChange (Afec *pAFE, uint8_t bEnDis)
 Set analog change. IF enabled, it allows different analog settings for each channel, otherwise, DIFF0, GAIN0 and OFF0 are used for all channels.
void AFEC_SetTagEnable (Afec *pAFE, uint8_t bEnDis)
 Set "TAG" mode, show channel number in last data or not.
void AFEC_SetCompareChannel (Afec *pAFE, uint32_t dwChannel)
 Set compare channel.
void AFEC_SetCompareMode (Afec *pAFE, uint32_t dwMode)
 Set compare mode.
void AFEC_SetComparisonWindow (Afec *pAFE, uint32_t dwHi_Lo)
 Set comparison window.
uint32_t AFEC_GetConvertedData (Afec *pAFE, uint32_t dwChannel)
 Return the Channel Converted Data.
void AFEC_SetStartupTime (Afec *pAFE, uint32_t dwUs)
void AFEC_SetTrackingTime (Afec *pAFE, uint32_t dwNs)
void AFEC_SetAnalogOffset (Afec *pAFE, uint32_t dwChannel, uint32_t aoffset)
 Set analog offset to be used for channel CSEL.
void AFEC_SetAnalogControl (Afec *pAFE, uint32_t control)
 Set analog offset to be used for channel CSEL.

Detailed Description

Implementation of Analog-to-Digital Converter (AFE).

Definition in file afec.c.


Function Documentation

uint32_t AFEC_GetConvertedData ( Afec pAFE,
uint32_t  dwChannel 
)

Return the Channel Converted Data.

Parameters:
pAFE Pointer to an AFE instance.
dwChannel channel to get converted value

Definition at line 342 of file afec.c.

void AFEC_Initialize ( Afec pAFE,
uint32_t  dwID 
)

Initialize the AFE controller.

Parameters:
pAFE Pointer to an AFE instance.
dwID AFE Index

Definition at line 94 of file afec.c.

Here is the call graph for this function:

void AFEC_SetAnalogChange ( Afec pAFE,
uint8_t  bEnDis 
)

Set analog change. IF enabled, it allows different analog settings for each channel, otherwise, DIFF0, GAIN0 and OFF0 are used for all channels.

Parameters:
pAFE Pointer to an AFE instance.
bEnDis Enable/Disable.

Definition at line 270 of file afec.c.

void AFEC_SetAnalogControl ( Afec pAFE,
uint32_t  control 
)

Set analog offset to be used for channel CSEL.

Parameters:
afec Base address of the AFEC.
control Analog control value.

Definition at line 444 of file afec.c.

void AFEC_SetAnalogOffset ( Afec pAFE,
uint32_t  dwChannel,
uint32_t  aoffset 
)

Set analog offset to be used for channel CSEL.

Parameters:
afec Base address of the AFEC.
dwChannel AFEC channel number.
aoffset Analog offset value.

Definition at line 431 of file afec.c.

uint32_t AFEC_SetClock ( Afec pAFE,
uint32_t  dwClk,
uint32_t  dwMck 
)

Set AFE clock.

Parameters:
pAFE Pointer to an AFE instance.
dwPres prescale value
dwMck Board MCK (Hz)
Returns:
AFE clock

Definition at line 116 of file afec.c.

void AFEC_SetCompareChannel ( Afec pAFE,
uint32_t  dwChannel 
)

Set compare channel.

Parameters:
pAFE Pointer to an AFE instance.
dwChannel channel number to be set,16 for all channels

Definition at line 300 of file afec.c.

void AFEC_SetCompareMode ( Afec pAFE,
uint32_t  dwMode 
)

Set compare mode.

Parameters:
pAFE Pointer to an AFE instance.
dwMode compare mode

Definition at line 319 of file afec.c.

void AFEC_SetComparisonWindow ( Afec pAFE,
uint32_t  dwHi_Lo 
)

Set comparison window.

Parameters:
pAFE Pointer to an AFE instance.
dwHi_Lo Comparison Window

Definition at line 331 of file afec.c.

void AFEC_SetFastWakeup ( Afec pAFE,
uint8_t  bEnDis 
)

Enable/Disable fast wake up.

Parameters:
pAFE Pointer to an AFE instance.
bEnDis Enable/Disable fast wake up in sleep mode.

Definition at line 196 of file afec.c.

void AFEC_SetSequence ( Afec pAFE,
uint32_t  dwSEQ1,
uint32_t  dwSEQ2 
)

Set channel sequence.

Parameters:
pAFE Pointer to an AFE instance.
dwSEQ1 Sequence 1 ~ 8 channel number.
dwSEQ2 Sequence 9 ~ 16 channel number.

Definition at line 231 of file afec.c.

void AFEC_SetSequenceByList ( Afec pAFE,
uint8_t  ucChList[],
uint8_t  ucNumCh 
)

Set channel sequence by given channel list.

Parameters:
pAFE Pointer to an AFE instance.
ucChList Channel list.
ucNumCh Number of channels in list.

Definition at line 244 of file afec.c.

void AFEC_SetSequenceMode ( Afec pAFE,
uint8_t  bEnDis 
)

Enable/Disable sequence mode.

Parameters:
pAFE Pointer to an AFE instance.
bEnDis Enable/Disable sequence mode.

Definition at line 211 of file afec.c.

void AFEC_SetSleepMode ( Afec pAFE,
uint8_t  bEnDis 
)

Enable/Disable sleep mode.

Parameters:
pAFE Pointer to an AFE instance.
bEnDis Enable/Disable sleep mode.

Definition at line 181 of file afec.c.

void AFEC_SetStartupTime ( Afec pAFE,
uint32_t  dwUs 
)

Sets the AFE startup time.

Parameters:
pAFE Pointer to an AFE instance.
dwUs Startup time in uS.

Definition at line 358 of file afec.c.

void AFEC_SetTagEnable ( Afec pAFE,
uint8_t  bEnDis 
)

Set "TAG" mode, show channel number in last data or not.

Parameters:
pAFE Pointer to an AFE instance.
bEnDis Enable/Disable TAG value.

Definition at line 285 of file afec.c.

void AFEC_SetTiming ( Afec pAFE,
uint32_t  dwStartup,
uint32_t  dwTracking,
uint32_t  dwSettling 
)

Set AFE timing.

Parameters:
pAFE Pointer to an AFE instance.
dwStartup startup value
dwTracking tracking value
dwSettling settling value

Definition at line 140 of file afec.c.

void AFEC_SetTrackingTime ( Afec pAFE,
uint32_t  dwNs 
)

Set AFE tracking time

Parameters:
pAFE Pointer to an AFE instance.
dwNs Tracking time in nS.

Definition at line 402 of file afec.c.

void AFEC_SetTrigger ( Afec pAFE,
uint32_t  dwTrgSel 
)

Set AFE trigger.

Parameters:
pAFE Pointer to an AFE instance.
dwTrgSel Trigger selection

Definition at line 164 of file afec.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines