James Reynolds / AD594x Driver
Embed: (wiki syntax)

« Back to documentation index

Sequencer_FIFO_Functions

Sequencer_FIFO_Functions
[Sequencer_FIFO]

Functions

void AD5940_FIFOCfg (FIFOCfg_Type *pFifoCfg)
 Configure AD5940 FIFO.
AD5940Err AD5940_FIFOGetCfg (FIFOCfg_Type *pFifoCfg)
 Read current FIFO configuration.
void AD5940_FIFOCtrlS (uint32_t FifoSrc, BoolFlag FifoEn)
 Configure AD5940 FIFO Source and enable or disable FIFO.
void AD5940_FIFOThrshSet (uint32_t FIFOThresh)
 Configure AD5940 Data FIFO threshold value.
uint32_t AD5940_FIFOGetCnt (void)
 Get Data count in FIFO.
void AD5940_SEQCfg (SEQCfg_Type *pSeqCfg)
 Initialize Sequencer.
AD5940Err AD5940_SEQGetCfg (SEQCfg_Type *pSeqCfg)
 Read back current sequencer configuration and store it to pSeqCfg.
void AD5940_SEQCtrlS (BoolFlag SeqEn)
 Enable or Disable sequencer.
void AD5940_SEQHaltS (void)
 Halt sequencer immediately.
void AD5940_SEQMmrTrig (uint32_t SeqId)
 Trigger sequencer by register write.
void AD5940_SEQCmdWrite (uint32_t StartAddr, const uint32_t *pCommand, uint32_t CmdCnt)
 Write sequencer commands to AD5940 SRAM.
void AD5940_SEQInfoCfg (SEQInfo_Type *pSeq)
 Initialize Sequence INFO.
AD5940Err AD5940_SEQInfoGet (uint32_t SeqId, SEQInfo_Type *pSeqInfo)
 Get sequence info: start address and sequence length.
void AD5940_SEQGpioCtrlS (uint32_t Gpio)
 Control GPIO with register SYNCEXTDEVICE.
uint32_t AD5940_SEQTimeOutRd (void)
 Read back current count down timer value for Sequencer Timer Out command.
AD5940Err AD5940_SEQGpioTrigCfg (SeqGpioTrig_Cfg *pSeqGpioTrigCfg)
 Configure GPIO to allow it to trigger corresponding sequence(SEQ0/1/2/3).
void AD5940_WUPTCfg (WUPTCfg_Type *pWuptCfg)
 Configure Wakeup Timer.
void AD5940_WUPTCtrl (BoolFlag Enable)
 Enable or disable wakeup timer.
AD5940Err AD5940_WUPTTime (uint32_t SeqId, uint32_t SleepTime, uint32_t WakeupTime)
 Configure WakeupTimer.

Function Documentation

void AD5940_FIFOCfg ( FIFOCfg_Type pFifoCfg )

Configure AD5940 FIFO.

Parameters:
pFifoCfg,:Pointer to configuration structure.
Returns:
return none.

Definition at line 2003 of file ad5940.c.

void AD5940_FIFOCtrlS ( uint32_t  FifoSrc,
BoolFlag  FifoEn 
)

Configure AD5940 FIFO Source and enable or disable FIFO.

Parameters:
FifoSrc: available choices are FIFOSRC_Const

  • FIFOSRC_SINC3 SINC3 data
  • FIFOSRC_DFT DFT real and imaginary part
  • FIFOSRC_SINC2NOTCH SINC2+NOTCH block. Notch can be bypassed, so SINC2 data can be feed to FIFO
  • FIFOSRC_VAR Statistic variance output
  • FIFOSRC_MEAN Statistic mean output
FifoEn,:enable or disable the FIFO.
Returns:
return none.

Definition at line 2063 of file ad5940.c.

AD5940Err AD5940_FIFOGetCfg ( FIFOCfg_Type pFifoCfg )

Read current FIFO configuration.

Parameters:
pFifoCfg,:Pointer to a buffer that used to store FIFO configuration.
Returns:
return AD5940ERR_OK if succeed.

Definition at line 2031 of file ad5940.c.

uint32_t AD5940_FIFOGetCnt ( void   )

Get Data count in FIFO.

Returns:
return none.

Definition at line 2089 of file ad5940.c.

void AD5940_FIFOThrshSet ( uint32_t  FIFOThresh )

Configure AD5940 Data FIFO threshold value.

Parameters:
FIFOThresh,:FIFO threshold value
Returns:
return none.

Definition at line 2079 of file ad5940.c.

void AD5940_SEQCfg ( SEQCfg_Type pSeqCfg )

Initialize Sequencer.

Parameters:
pSeqCfg,:Pointer to configuration structure
Returns:
return none.

Definition at line 2101 of file ad5940.c.

void AD5940_SEQCmdWrite ( uint32_t  StartAddr,
const uint32_t *  pCommand,
uint32_t  CmdCnt 
)

Write sequencer commands to AD5940 SRAM.

Returns:
return none.

Definition at line 2196 of file ad5940.c.

void AD5940_SEQCtrlS ( BoolFlag  SeqEn )

Enable or Disable sequencer.

Note:
Only after valid trigger signal, sequencer can run.
Returns:
return none.

Definition at line 2161 of file ad5940.c.

AD5940Err AD5940_SEQGetCfg ( SEQCfg_Type pSeqCfg )

Read back current sequencer configuration and store it to pSeqCfg.

Parameters:
pSeqCfg,:Pointer to structure
Returns:
return AD5940ERR_OK if succeed.

Definition at line 2139 of file ad5940.c.

void AD5940_SEQGpioCtrlS ( uint32_t  Gpio )

Control GPIO with register SYNCEXTDEVICE.

Because sequencer have no ability to access register GPIOOUT, so we use this register for sequencer.

Parameters:
Gpio: Select from {AGPIO_Pin0|AGPIO_Pin1|AGPIO_Pin2|AGPIO_Pin3|AGPIO_Pin4|AGPIO_Pin5|AGPIO_Pin6|AGPIO_Pin7}

  • The combination of GPIO pins. The selected pins will be set to High. Others will be pulled low.
Returns:
return None.

Definition at line 2287 of file ad5940.c.

AD5940Err AD5940_SEQGpioTrigCfg ( SeqGpioTrig_Cfg *  pSeqGpioTrigCfg )

Configure GPIO to allow it to trigger corresponding sequence(SEQ0/1/2/3).

There are four sequences. We can use GPIO to trigger each sequence. For example, GP0 or GP4 can be used to trigger sequence0 and GP3 or GP7 to trigger sequence3. There are five mode available to detect pin action: Rising edge, falling edge, both rising and falling edge, low level or high level. Be careful to use level detection. The trigger signal is always available if the pin level is matched. Once the sequence is done, it will immediately run again if the pin level is still matched.

Returns:
return AD5940ERR_OK if succeed.

Definition at line 2311 of file ad5940.c.

void AD5940_SEQHaltS ( void   )

Halt sequencer immediately.

Use this to debug. In normal application, there is no situation that can use this function.

Returns:
return none.

Definition at line 2176 of file ad5940.c.

void AD5940_SEQInfoCfg ( SEQInfo_Type pSeq )

Initialize Sequence INFO.

There are four set of registers that record sequence information. The info contains command start address in SRAM and sequence length. Hardware can automatically manage these four sequences. If the application requires more than 4 sequences, user should manually record the sequence Info(address and length) in MCU.

Parameters:
pSeq,:Pointer to configuration structure. Specify sequence start address in SRAM and sequence length.
Returns:
return none.

Definition at line 2215 of file ad5940.c.

AD5940Err AD5940_SEQInfoGet ( uint32_t  SeqId,
SEQInfo_Type pSeqInfo 
)

Get sequence info: start address and sequence length.

Parameters:
SeqId,:Select from {SEQID_0, SEQID_1, SEQID_2, SEQID_3}

  • Select which sequence we want to get the information.
pSeqInfo,:Pointer to sequence info structure.
Returns:
return AD5940ERR_OK when succeed.

Definition at line 2248 of file ad5940.c.

void AD5940_SEQMmrTrig ( uint32_t  SeqId )

Trigger sequencer by register write.

Returns:
return none.

Definition at line 2185 of file ad5940.c.

uint32_t AD5940_SEQTimeOutRd ( void   )

Read back current count down timer value for Sequencer Timer Out command.

Returns:
return register value of Sequencer Timer out value.

Definition at line 2296 of file ad5940.c.

void AD5940_WUPTCfg ( WUPTCfg_Type pWuptCfg )

Configure Wakeup Timer.

Parameters:
pWuptCfg,:Pointer to configuration structure.
Returns:
return none.

Definition at line 2362 of file ad5940.c.

void AD5940_WUPTCtrl ( BoolFlag  Enable )

Enable or disable wakeup timer.

Parameters:
Enable: {bTRUE, bFALSE}

  • bTRUE: enable wakeup timer
  • bFALSE: Disable wakeup timer
Returns:
return none.

Definition at line 2419 of file ad5940.c.

AD5940Err AD5940_WUPTTime ( uint32_t  SeqId,
uint32_t  SleepTime,
uint32_t  WakeupTime 
)

Configure WakeupTimer.

Parameters:
SeqId,:Select from SEQID_0/1/2/3. The wakeup timer will load corresponding value from four sets of registers.
SleepTime,:After how much time, AFE will try to enter hibernate. We disabled this feature in AD59840_Initialize. After this timer expired, nothing will happen.
WakeupTime,:After how much time, AFE will wakeup and trigger corresponding sequencer.
Note:
By SleepTime and WakeupTime, the sequencer is triggered periodically and period is (SleepTime+WakeupTime)
Returns:
return none.

Definition at line 2439 of file ad5940.c.