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

Enumerations

enum  ttl_basic_interrupt_commands {
  TTL_SUMMARY_INTERRUPT_CMD_CONFIGURE , TTL_SUMMARY_INTERRUPT_CMD_STATUS_READ , TTL_SUMMARY_INTERRUPT_CMD_STATUS_CLEAR , TTL_SUMMARY_INTERRUPT_CMD_FORCE_ERROR ,
  TTL_SUMMARY_INTERRUPT_CMD_COUNT
}
 

Functions

static int32_t Run_TTL_Summary (int32_t cardIndex, int32_t module, uint32_t modid)
 Run_TTL_Summary prompts the user for the card, module and channel to use for the application and calls Cfg_TTL_Channel if the card, module, channel is valid for as a ttl module.
 
static void Cfg_TTL_Channel (int32_t cardIndex, int32_t module, int32_t MaxChannel)
 Cfg_TTL_Channel handles calling the Display_TTL_ChannelCfg routine to display the ttl channel configuration and calling the routines associated with the user's menu commands.
 
static void Verify_TTL_ParamCnt (int32_t paramCnt)
 Verify_TTL_ParamCnt verifies parameter count and displays error message if invalid.
 
static nai_status_t Display_TTL_Status (int32_t paramCnt, int32_t *p_params)
 Display_TTL_Status illustrate the methods to call in the naibrd library to retrieve the status states.
 
static nai_status_t Clear_TTL_Status (int32_t paramCnt, int32_t *p_params)
 
static nai_status_t Force_BIT_Error (int32_t paramCnt, int32_t *p_params)
 
static nai_status_t Configure_TTL_Interrupt (int32_t paramCnt, int32_t *p_params)
 
static void SampleCallBack (uint32_t vector)
 
int32_t ttl_summary (void)
 The purpose of the ttl_summary example is to illustrate the methods to call in the naibrd library to perform basic operations with the ttl modules for interrupt configuration, reading fault statuses including the summary status register, clearing status bits and forcing a BIT error to observe status bits getting set in both the BIT status and summary registers. The summary register is bit-mapped by channel (bit index zero is channel 1) and reports a '1' if the corresponding channel has detected a fault in either BIT or over-current status. A latched summary bit can be cleared by writing a '1' to the bit. A BIT error condition can be forced in a DT channel by configuring the IO format for Push-Pull and setting the output state HIGH while an external VCC is unconnected. To demonstrate the aforementioned concepts, the user should run this sample application and enter the following sequence of menu commands (though in reality the user is free to follow any sequence):
 

Variables

static const int8_t * DEF_CONFIG_FILE = (const int8_t *)"default_TTL_Summary.txt"
 
static const int32_t DEF_TTL_CARD_INDEX = 0
 
static const int32_t DEF_TTL_MODULE = 1
 
static const int32_t DEF_TTL_CHANNEL = 1
 
static naiapp_cmdtbl_params_t TTL_SummaryMenuCmds []
 

Enumeration Type Documentation

◆ ttl_basic_interrupt_commands

Enumerator
TTL_SUMMARY_INTERRUPT_CMD_CONFIGURE 
TTL_SUMMARY_INTERRUPT_CMD_STATUS_READ 
TTL_SUMMARY_INTERRUPT_CMD_STATUS_CLEAR 
TTL_SUMMARY_INTERRUPT_CMD_FORCE_ERROR 
TTL_SUMMARY_INTERRUPT_CMD_COUNT 

Function Documentation

◆ Cfg_TTL_Channel()

static void Cfg_TTL_Channel ( int32_t cardIndex,
int32_t module,
int32_t MaxChannel )
static

Cfg_TTL_Channel handles calling the Display_TTL_ChannelCfg routine to display the ttl channel configuration and calling the routines associated with the user's menu commands.

◆ Clear_TTL_Status()

static nai_status_t Clear_TTL_Status ( int32_t paramCnt,
int32_t * p_params )
static

◆ Configure_TTL_Interrupt()

static nai_status_t Configure_TTL_Interrupt ( int32_t paramCnt,
int32_t * p_params )
static

◆ Display_TTL_Status()

static nai_status_t Display_TTL_Status ( int32_t paramCnt,
int32_t * p_params )
static

Display_TTL_Status illustrate the methods to call in the naibrd library to retrieve the status states.

◆ Force_BIT_Error()

static nai_status_t Force_BIT_Error ( int32_t paramCnt,
int32_t * p_params )
static

◆ Run_TTL_Summary()

static int32_t Run_TTL_Summary ( int32_t cardIndex,
int32_t module,
uint32_t modid )
static

Run_TTL_Summary prompts the user for the card, module and channel to use for the application and calls Cfg_TTL_Channel if the card, module, channel is valid for as a ttl module.

◆ SampleCallBack()

static void SampleCallBack ( uint32_t vector)
static

◆ ttl_summary()

int32_t ttl_summary ( void )

The purpose of the ttl_summary example is to illustrate the methods to call in the naibrd library to perform basic operations with the ttl modules for interrupt configuration, reading fault statuses including the summary status register, clearing status bits and forcing a BIT error to observe status bits getting set in both the BIT status and summary registers. The summary register is bit-mapped by channel (bit index zero is channel 1) and reports a '1' if the corresponding channel has detected a fault in either BIT or over-current status. A latched summary bit can be cleared by writing a '1' to the bit. A BIT error condition can be forced in a DT channel by configuring the IO format for Push-Pull and setting the output state HIGH while an external VCC is unconnected. To demonstrate the aforementioned concepts, the user should run this sample application and enter the following sequence of menu commands (though in reality the user is free to follow any sequence):

clear - to clear all latched status registers (BIT, Overcurrent and Summary statuses) stat - to display all latched statuses int - to configure the interrupt subsystem on the user-selected channel fault - to generate a BIT error on the user-selected channel stat - to display all latched statuses clear - to clear all latched status registers

◆ Verify_TTL_ParamCnt()

static void Verify_TTL_ParamCnt ( int32_t paramCnt)
static

Verify_TTL_ParamCnt verifies parameter count and displays error message if invalid.

Variable Documentation

◆ DEF_CONFIG_FILE

const int8_t* DEF_CONFIG_FILE = (const int8_t *)"default_TTL_Summary.txt"
static

◆ DEF_TTL_CARD_INDEX

const int32_t DEF_TTL_CARD_INDEX = 0
static

◆ DEF_TTL_CHANNEL

const int32_t DEF_TTL_CHANNEL = 1
static

◆ DEF_TTL_MODULE

const int32_t DEF_TTL_MODULE = 1
static

◆ TTL_SummaryMenuCmds

naiapp_cmdtbl_params_t TTL_SummaryMenuCmds[]
static
Initial value:
= {
{"INT", "TTL Configure Interrupt", TTL_SUMMARY_INTERRUPT_CMD_CONFIGURE, Configure_TTL_Interrupt},
{"FAULT", "TTL Force BIT Error", TTL_SUMMARY_INTERRUPT_CMD_FORCE_ERROR, Force_BIT_Error},
}
static nai_status_t Force_BIT_Error(int32_t paramCnt, int32_t *p_params)
Definition ttl_summary.c:312
static nai_status_t Clear_TTL_Status(int32_t paramCnt, int32_t *p_params)
Definition ttl_summary.c:282
static nai_status_t Display_TTL_Status(int32_t paramCnt, int32_t *p_params)
Display_TTL_Status illustrate the methods to call in the naibrd library to retrieve the status states...
Definition ttl_summary.c:248
@ TTL_SUMMARY_INTERRUPT_CMD_FORCE_ERROR
Definition ttl_summary.c:46
@ TTL_SUMMARY_INTERRUPT_CMD_CONFIGURE
Definition ttl_summary.c:43
@ TTL_SUMMARY_INTERRUPT_CMD_STATUS_CLEAR
Definition ttl_summary.c:45
@ TTL_SUMMARY_INTERRUPT_CMD_STATUS_READ
Definition ttl_summary.c:44
static nai_status_t Configure_TTL_Interrupt(int32_t paramCnt, int32_t *p_params)
Definition ttl_summary.c:359