RTEMS 6.3
Loading...
Searching...
No Matches
afec.c File Reference
#include "chip.h"

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).

Function Documentation

◆ AFEC_GetConvertedData()

uint32_t AFEC_GetConvertedData ( Afec * pAFE,
uint32_t dwChannel )
extern

Return the Channel Converted Data.

Parameters
pAFEPointer to an AFE instance.
dwChannelchannel to get converted value

◆ AFEC_Initialize()

void AFEC_Initialize ( Afec * pAFE,
uint32_t dwID )
extern

Initialize the AFE controller.

Parameters
pAFEPointer to an AFE instance.
dwIDAFE Index

◆ AFEC_SetAnalogChange()

void AFEC_SetAnalogChange ( Afec * pAFE,
uint8_t bEnDis )
extern

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

Parameters
pAFEPointer to an AFE instance.
bEnDisEnable/Disable.

◆ AFEC_SetAnalogControl()

void AFEC_SetAnalogControl ( Afec * pAFE,
uint32_t control )

Set analog offset to be used for channel CSEL.

Parameters
afecBase address of the AFEC.
controlAnalog control value.

◆ AFEC_SetAnalogOffset()

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

Set analog offset to be used for channel CSEL.

Parameters
afecBase address of the AFEC.
dwChannelAFEC channel number.
aoffsetAnalog offset value.

◆ AFEC_SetClock()

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

Set AFE clock.

Parameters
pAFEPointer to an AFE instance.
dwPresprescale value
dwMckBoard MCK (Hz)
Returns
AFE clock

◆ AFEC_SetCompareChannel()

void AFEC_SetCompareChannel ( Afec * pAFE,
uint32_t dwChannel )
extern

Set compare channel.

Parameters
pAFEPointer to an AFE instance.
dwChannelchannel number to be set,16 for all channels

◆ AFEC_SetCompareMode()

void AFEC_SetCompareMode ( Afec * pAFE,
uint32_t dwMode )
extern

Set compare mode.

Parameters
pAFEPointer to an AFE instance.
dwModecompare mode

◆ AFEC_SetComparisonWindow()

void AFEC_SetComparisonWindow ( Afec * pAFE,
uint32_t dwHi_Lo )
extern

Set comparison window.

Parameters
pAFEPointer to an AFE instance.
dwHi_LoComparison Window

◆ AFEC_SetFastWakeup()

void AFEC_SetFastWakeup ( Afec * pAFE,
uint8_t bEnDis )
extern

Enable/Disable fast wake up.

Parameters
pAFEPointer to an AFE instance.
bEnDisEnable/Disable fast wake up in sleep mode.

◆ AFEC_SetSequence()

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

Set channel sequence.

Parameters
pAFEPointer to an AFE instance.
dwSEQ1Sequence 1 ~ 8 channel number.
dwSEQ2Sequence 9 ~ 16 channel number.

◆ AFEC_SetSequenceByList()

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

Set channel sequence by given channel list.

Parameters
pAFEPointer to an AFE instance.
ucChListChannel list.
ucNumChNumber of channels in list.

◆ AFEC_SetSequenceMode()

void AFEC_SetSequenceMode ( Afec * pAFE,
uint8_t bEnDis )
extern

Enable/Disable sequence mode.

Parameters
pAFEPointer to an AFE instance.
bEnDisEnable/Disable sequence mode.

◆ AFEC_SetSleepMode()

void AFEC_SetSleepMode ( Afec * pAFE,
uint8_t bEnDis )
extern

Enable/Disable sleep mode.

Parameters
pAFEPointer to an AFE instance.
bEnDisEnable/Disable sleep mode.

◆ AFEC_SetStartupTime()

void AFEC_SetStartupTime ( Afec * pAFE,
uint32_t dwUs )

Sets the AFE startup time.

Parameters
pAFEPointer to an AFE instance.
dwUsStartup time in uS.

◆ AFEC_SetTagEnable()

void AFEC_SetTagEnable ( Afec * pAFE,
uint8_t bEnDis )
extern

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

Parameters
pAFEPointer to an AFE instance.
bEnDisEnable/Disable TAG value.

◆ AFEC_SetTiming()

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

Set AFE timing.

Parameters
pAFEPointer to an AFE instance.
dwStartupstartup value
dwTrackingtracking value
dwSettlingsettling value

◆ AFEC_SetTrackingTime()

void AFEC_SetTrackingTime ( Afec * pAFE,
uint32_t dwNs )

Set AFE tracking time

Parameters
pAFEPointer to an AFE instance.
dwNsTracking time in nS.

◆ AFEC_SetTrigger()

void AFEC_SetTrigger ( Afec * pAFE,
uint32_t dwTrgSel )
extern

Set AFE trigger.

Parameters
pAFEPointer to an AFE instance.
dwTrgSelTrigger selection