Logo
NGFC_SENTRx_Demo

Demo program for SENT Receiver IP Core.

The Usage() function shows how to execute the test program, options available and default values set for different configuration variables. The Variables section specifies variables used in the test program, what they specify, the values it holds and can take. The main() function specifies sequence of api calls executed and tested.

Functions

void SENTReceiverUsage ()
 
int main (int argc, char *argv[])
 
void Display_channels (fpgawb_ipcore_sent_rx_data_t *data_info)
 

Variables

uint enable =1
 enable mode bit for the SENT Receiver IP Core Channel. Toggling the enable signal will cause the registers to revert to default power-on states. Only once the board is enabled the register and data to be sent can be programmed on to the FPGA. It takes values 0 or 1 and defaults to 1
 
fpgawb_ipcore_t ip_core
 fpgawb_ipcore_t struct which stores useful information about the IP Core after executing get IP Info api call. Check fpgawb_lib.h or api call documentation for more information
 
int channel =-1
 Channel number for the SENT Receiver IP Core Channel. It takes values 0 to (number of IP Core channels-1) and defaults to -1 (test program executed for all channels)
 
uint config_mode =0
 Configuration mode for the test program. Indicates to run the program in configure mode or read data mode. It takes values 0-Configuration/1-Read Data. It defaults to 0.
 
uint number_of_data_nibbles =1
 Number of data nibbles to be transmitted by the SENT Receiver IP Core Channel. It takes values 1 to 6. It defaults to 1.
 
uint type =0
 Configure the SENT Receiver IP Core Channel to decode the read data in short format, enhanced format or fast. It takes values 0, 1 and 2. It defaults to 0.
 
uint sent_id [MAX_SENT_ENHANCEDIDS]
 Specify a ID to add ID for a short format message or enhaced format message. ID is 4 bit for short format message and 4 or 8 bit for enhanced format message.the channel can be configured to receive multiple ID's in succession. The Same ID can be repeated within the sequence. The ID's will be received in the order in which they appear in the list.
 
uint is_legacy_CRC =0
 CRC checksum is implemented as a series of shift left by 4 (multiply by 16) followed by a 256 array look-up. It takes values 0 and 1. It defaults to 0.
 
uint enhanced_bit_id =4
 It takes values 4 or 8 and indicates if the the SENT Ids used for enhanced message format is a 4 bit Id os a 8 bit Id. It defaults to 4.
 
uint nenhanceds =0
 It is the number of enhanced messages to be received and can take values 1 to 512. It defaults to 0.
 
uint nshorts =0
 It is the number of short messages to be received and can take values 1 to 4. It defaults to 0.
 
fpgawb_ipcore_sent_rx_configure_t config
 fpgawb_ipcore_sent_rx_configure_t struct which stores configuration information for SENT Receiver and decoding. Check fpgawb_lib.h or api call documentation for more information
 
fpgawb_ipcore_sent_rx_data_t data_info [FPGAWB_MAX_IPCORE_CHANNELS]
 fpgawb_ipcore_sent_rx_data_t struct which stores configuration information and the data read and decoded by the SENT Receiver. Check fpgawb_lib.h or api call documentation for more information
 
fpgawb_ipcore_sent_rx_info_t info
 fpgawb_ipcore_sent_rx_info_t struct which has the status information of the SENT Receiver. Check fpgawb_lib.h or api call documentation for more information
 

Function Documentation

void Display_channels ( fpgawb_ipcore_sent_rx_data_t *  data_info)

Step 7: READ CHANNEL DATA
fpgawb_SENT_Rx_Read_Ch_Data(handle,chan,&data_info[chan])
This call reads and decodes the data transmitted by the SENT Transmitter IP Core Channel.

int main ( int  argc,
char *  argv[] 
)

Step 1: OPEN DEVICE
ccrtNGFC_Open(&handle,board_no,oflags)
Before using any API calls, the user needs to open the device and get a handle. This handle is then used as the first argument in most of the following APIs.

Step 2: GET DRIVER INFO
ccrtNGFC_Get_Driver_Info(handle, &binfo)
This call returns useful driver information and saves in the ccrtngfc_driver_info_t structure for later use.

Step 3: GET LIBRARY INFO
ccrtNGFC_Get_Library_Info(handle, &linfo)
This call returns useful library information and saves in the ccrtngfc_library_info_t structure for later use.

Step 4: GET IP INFO
fpgawb_SENT_Rx_Get_Ip_Info(handle, &ip_core)
This call returns useful IP Core information and saves in the fpgawb_ipcore_t structure for later use.

Step 5: ACTIVATE SENT RECEIVER CHANNEL
fpgawb_SENT_Rx_Activate_Ch(handle,chan,enable)
This call activates the SENT Receiver IP Core Channel by setting enable="1.

Step 6: CONFIGURE SENT RECEIVER CHANNEL
fpgawb_SENT_Rx_Configure_Ch(handle,chan,&config)
This call configures the initial set up parameters like number_of_data_nibbles for the SENT Receiver IP Core Channel.

Step 8: CLOSE DEVICE
ccrtNGFC_Close(handle)
Closes the device with the handle.

void SENTReceiverUsage ( )

Usage:
./fpgawb_ipcore_sent_receiver [-b Board] [-B EnchancedBitID] [-c ChannelNumber] [-C ConfigMode] [-d DataFile] [-e Enable] [-E nEnhanced] [-L LegacyCRC] [-n NumberOfDataNibbles] [-S nShorts] [-t Type]

Options Default value
-b Board Number 0
-B Bit ID for Enhanced data ( 4 or 8 ) 4
-c channel Number (0-(Numchans-1) -1 (all channels)
-C Config Mode (0-Configuration mode/1-Read status) 0
-d Data File Name (Specify data nibbles with line breaks, max of 6) angles/data.dat
-e Enable (0/1) 1
-E nenhanced (1-512) 0
-L Legacy CRC (0/1) 0
-n Number of Data Nibbles to be received (1 to 6) 1
-S nshorts (1-4) 0
-t Type (0-Short/1-Enhanced/2-Fast) 0


Examples:
Configure- ./fpgawb_ipcore_sent_receiver -C0 -b0 -c0 -n6
Short- ./fpgawb_ipcore_sent_receiver -dangles/sent_receiver_sentId_short.dat -C1 -b0 -c0 -n6 -S4 -L0 -t0 -B8
Enhanced- ./fpgawb_ipcore_sent_receiver -dangles/sent_receiver_sentId_enhanced.dat -C1 -b0 -c0 -n6 -E48 -L0 -t1 -B8
Fast- ./fpgawb_ipcore_sent_receiver -C1 -b0 -c0 -n6 -t2