Software Library API naibrd 2.24.0
See all documentation at naii.docs.com
ad_fifo.c File Reference

Enumerations

enum  ad_fifo_commands {
  AD_FIFO_CMD_SW_TRIGGER , AD_FIFO_CMD_READ_FIFO , AD_FIFO_CMD_READ_FIFO_SINGLESTEPPING , AD_FIFO_CMD_DISPLAY_FIFO_STATUS ,
  AD_FIFO_CMD_CLEAR_FIFO , AD_FIFO_CMD_CONFIG , AD_FIFO_CMD_COUNT
}
 

Functions

static bool_t ADFIFO_RunMenu (int32_t cardIndex, int32_t module, uint32_t modid)
 RunMenu illustrates the channel configuration and prepares the menu which will handle user command requests. Returns NAI_TRUE if the user enters the Quit Command at any point within its scope.
 
static void ADFIFO_displayChannelCfg (int32_t cardIndex, int32_t module, int32_t MAX_CHANNELS)
 AD_displayChannelCfg display each channel's settings and values for: words in fifo, high threshold, low threshold, sample delay, size of fifo, sample rate, buffer control, trigger control, and the status register.
 
static nai_status_t ADFIFO_SwTrigger (int32_t paramCount, int32_t *p_params)
 AD_SwTrigger calls the SoftwareTrigger API which causes the FIFO to start sampling.
 
static nai_status_t ADFIFO_PrintSamplesInFifoSingleStepping (int32_t paramCount, int32_t *p_params)
 
static nai_status_t ADFIFO_PrintSamplesInFifo (int32_t paramCount, int32_t *p_params)
 
static nai_status_t ADFIFO_DisplayFifoStatus (int32_t paramCount, int32_t *p_params)
 AD_DisplayFifoStatus illustrates which of the following flags have been raised: Sample Done, FIFO Full, High Limit, Low Limit, Empty.
 
static nai_status_t ADFIFO_ClearFifo (int32_t paramCount, int32_t *p_params)
 AD_ClearFifo empties the specified channel's FIFO buffer.
 
static nai_status_t ADFIFO_ConfigChannel (int32_t paramCount, int32_t *p_params)
 AD_configChannel initiates all the channels for writing and handles the user requests to configure the channels.
 
static void ADFIFO_printBufferRequest ()
 
static void ADFIFO_printTriggerCtrlRequest ()
 
static void ADFIFO_GetSamplesInFifo (int32_t cardIndex, int32_t module, int32_t channel, uint32_t count, uint32_t *samplesInFifo)
 
static void ADFIFO_GetBufferControls (int32_t cardIndex, int32_t module, int32_t channel, bool_t Buffer_Controls[])
 
static void ADFIFO_GetFifoReadInfo (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *p_outsamplesToRead, bool_t *p_outbufferControls)
 AD_ReadFifo handles the user request to read a certain number of samples from the FIFO.
 
int32_t AD_FifoMenu (void)
 The purpose of the AD_FifoMenu is to illustrate the methods to call in the naibrd library to perform FIFO operations with the AD modules for configuration setup and reading the channels.
 

Variables

static const int8_t * SAMPLE_PGM_NAME = (const int8_t *)"AD Module FIFO Operation Program"
 
static const int8_t * CONFIG_FILE = (const int8_t *)"default_AD_fifo.txt"
 
naiapp_cmdtbl_params_t AD_FifoMenuCmds []
 

Enumeration Type Documentation

◆ ad_fifo_commands

Enumerator
AD_FIFO_CMD_SW_TRIGGER 
AD_FIFO_CMD_READ_FIFO 
AD_FIFO_CMD_READ_FIFO_SINGLESTEPPING 
AD_FIFO_CMD_DISPLAY_FIFO_STATUS 
AD_FIFO_CMD_CLEAR_FIFO 
AD_FIFO_CMD_CONFIG 
AD_FIFO_CMD_COUNT 

Function Documentation

◆ AD_FifoMenu()

int32_t AD_FifoMenu ( void )

The purpose of the AD_FifoMenu is to illustrate the methods to call in the naibrd library to perform FIFO operations with the AD modules for configuration setup and reading the channels.

The following system configuration routines from the nai_sys_cfg.c file are called to assist with the configuration setup for this program prior to calling the naibrd DT routines.

  • ClearDeviceCfg
  • QuerySystemCfg
  • DisplayDeviceCfg
  • GetBoardSNModCfg
  • SaveDeviceCfg

◆ ADFIFO_ClearFifo()

static nai_status_t ADFIFO_ClearFifo ( int32_t paramCount,
int32_t * p_params )
static

AD_ClearFifo empties the specified channel's FIFO buffer.

◆ ADFIFO_ConfigChannel()

static nai_status_t ADFIFO_ConfigChannel ( int32_t paramCount,
int32_t * p_params )
static

AD_configChannel initiates all the channels for writing and handles the user requests to configure the channels.

◆ ADFIFO_displayChannelCfg()

static void ADFIFO_displayChannelCfg ( int32_t cardIndex,
int32_t module,
int32_t MAX_CHANNELS )
static

AD_displayChannelCfg display each channel's settings and values for: words in fifo, high threshold, low threshold, sample delay, size of fifo, sample rate, buffer control, trigger control, and the status register.

◆ ADFIFO_DisplayFifoStatus()

static nai_status_t ADFIFO_DisplayFifoStatus ( int32_t paramCount,
int32_t * p_params )
static

AD_DisplayFifoStatus illustrates which of the following flags have been raised: Sample Done, FIFO Full, High Limit, Low Limit, Empty.

◆ ADFIFO_GetBufferControls()

static void ADFIFO_GetBufferControls ( int32_t cardIndex,
int32_t module,
int32_t channel,
bool_t Buffer_Controls[] )
static

◆ ADFIFO_GetFifoReadInfo()

static void ADFIFO_GetFifoReadInfo ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t * p_outsamplesToRead,
bool_t * p_outbufferControls )
static

AD_ReadFifo handles the user request to read a certain number of samples from the FIFO.

◆ ADFIFO_GetSamplesInFifo()

static void ADFIFO_GetSamplesInFifo ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint32_t count,
uint32_t * samplesInFifo )
static

◆ ADFIFO_printBufferRequest()

static void ADFIFO_printBufferRequest ( )
static

◆ ADFIFO_PrintSamplesInFifo()

static nai_status_t ADFIFO_PrintSamplesInFifo ( int32_t paramCount,
int32_t * p_params )
static

◆ ADFIFO_PrintSamplesInFifoSingleStepping()

static nai_status_t ADFIFO_PrintSamplesInFifoSingleStepping ( int32_t paramCount,
int32_t * p_params )
static

◆ ADFIFO_printTriggerCtrlRequest()

static void ADFIFO_printTriggerCtrlRequest ( )
static

◆ ADFIFO_RunMenu()

static bool_t ADFIFO_RunMenu ( int32_t cardIndex,
int32_t module,
uint32_t modid )
static

RunMenu illustrates the channel configuration and prepares the menu which will handle user command requests. Returns NAI_TRUE if the user enters the Quit Command at any point within its scope.

◆ ADFIFO_SwTrigger()

static nai_status_t ADFIFO_SwTrigger ( int32_t paramCount,
int32_t * p_params )
static

AD_SwTrigger calls the SoftwareTrigger API which causes the FIFO to start sampling.

Variable Documentation

◆ AD_FifoMenuCmds

naiapp_cmdtbl_params_t AD_FifoMenuCmds[]
Initial value:
= {
{"TRG", "Execute Software Trigger", AD_FIFO_CMD_SW_TRIGGER, ADFIFO_SwTrigger},
{"R", "Read data from the FIFO, All-at-once", AD_FIFO_CMD_READ_FIFO, ADFIFO_PrintSamplesInFifo},
{"RS", "Read data from the FIFO, Single-Stepping", AD_FIFO_CMD_READ_FIFO_SINGLESTEPPING, ADFIFO_PrintSamplesInFifoSingleStepping},
{"STAT", "Display FIFO Status", AD_FIFO_CMD_DISPLAY_FIFO_STATUS, ADFIFO_DisplayFifoStatus},
{"CL", "Clear FIFO", AD_FIFO_CMD_CLEAR_FIFO, ADFIFO_ClearFifo},
{"CFG", "Configure FIFO", AD_FIFO_CMD_CONFIG, ADFIFO_ConfigChannel},
}
@ AD_FIFO_CMD_CONFIG
Definition ad_fifo.c:54
@ AD_FIFO_CMD_DISPLAY_FIFO_STATUS
Definition ad_fifo.c:52
@ AD_FIFO_CMD_SW_TRIGGER
Definition ad_fifo.c:49
@ AD_FIFO_CMD_READ_FIFO_SINGLESTEPPING
Definition ad_fifo.c:51
@ AD_FIFO_CMD_CLEAR_FIFO
Definition ad_fifo.c:53
@ AD_FIFO_CMD_READ_FIFO
Definition ad_fifo.c:50
static nai_status_t ADFIFO_SwTrigger(int32_t paramCount, int32_t *p_params)
AD_SwTrigger calls the SoftwareTrigger API which causes the FIFO to start sampling.
Definition ad_fifo.c:377
static nai_status_t ADFIFO_PrintSamplesInFifo(int32_t paramCount, int32_t *p_params)
Definition ad_fifo.c:589
static nai_status_t ADFIFO_ConfigChannel(int32_t paramCount, int32_t *p_params)
AD_configChannel initiates all the channels for writing and handles the user requests to configure th...
Definition ad_fifo.c:231
static nai_status_t ADFIFO_ClearFifo(int32_t paramCount, int32_t *p_params)
AD_ClearFifo empties the specified channel's FIFO buffer.
Definition ad_fifo.c:448
static nai_status_t ADFIFO_DisplayFifoStatus(int32_t paramCount, int32_t *p_params)
AD_DisplayFifoStatus illustrates which of the following flags have been raised: Sample Done,...
Definition ad_fifo.c:398
static nai_status_t ADFIFO_PrintSamplesInFifoSingleStepping(int32_t paramCount, int32_t *p_params)
Definition ad_fifo.c:518

◆ CONFIG_FILE

const int8_t* CONFIG_FILE = (const int8_t *)"default_AD_fifo.txt"
static

◆ SAMPLE_PGM_NAME

const int8_t* SAMPLE_PGM_NAME = (const int8_t *)"AD Module FIFO Operation Program"
static