Logo
NGFC_SENTTx_Demo

Demo program for SENT Transmitter 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 SENTTransmitterUsage ()
 
int main (int argc, char *argv[])
 

Variables

uint enable =1
 enable mode bit for the SENT Transmitter 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
 
uint signal_polarity =0
 Signal polarity for the SENT Transmitter IP Core Channel. The output will be active high when the bit is set to 0 and inverted when the bit is toggled. It takes values 0 or 1 and defaults to 0.
 
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 Transmitter 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 setting up the transmitter mode or transmitting data mode. It takes values 0-Configuration Mode/1-Send Data Mode. It defaults to 0.
 
uint number_of_data_nibbles =1
 Number of data nibbles to be transmitted by the SENT Transmitter IP Core Channel. It takes values 1 to 6. It defaults to 1.
 
uint low_tick_number =5
 Indicates number of ticks signal is low between falling edge and following positive edge and takes values greater than 5 and less than 11 inclusive. It defaults to 5.
 
uint tick_length =3
 Length of clock tick (in microseconds) and takes values greater than 1 and less than 990 inclusive. It defaults to 3.
 
uint type =0
 Configure the SENT Transmitter IP Core Channel to transmit 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 sent multiple ID's in succession. The Same ID can be repeated within the sequence. The ID's will be sent in the order in which they appear in the list.
 
uint data [MAX_SENT_NIBBLES]
 This array contains 1 to 6 data nibbles to be transmitted. This is read from the file specified using -d option.
 
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 transmitted and can take values 1 to 512. It defaults to 0.
 
uint nshorts =0
 It is the number of short messages to be transmitted and can take values 1 to 4. It defaults to 0.
 
uint short_or_enhanced_data [MAX_SENT_ENHANCEDIDS]
 This array contains data to be transmitted using short or enhanced format. This is read from the file specified using -d option.
 
fpgawb_ipcore_sent_tx_configure_t config
 fpgawb_ipcore_sent_tx_configure_t struct which stores configuration information for SENT Transmission. Check fpgawb_lib.h or api call documentation for more information
 
fpgawb_ipcore_sent_tx_data_t data_config [FPGAWB_MAX_IPCORE_CHANNELS]
 fpgawb_ipcore_sent_tx_data_t struct which stores configuration information and the data to be transmitted by the SENT Transmitter. Check fpgawb_lib.h or api call documentation for more information
 
fpgawb_ipcore_sent_tx_info_t info
 fpgawb_ipcore_sent_tx_info_t struct which has the status information of the SENT Transmission after the API call execution. Check fpgawb_lib.h or api call documentation for more information
 

Function Documentation

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_Tx_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 TRANSMITTER CHANNEL
fpgawb_SENT_Tx_Activate_Ch(handle,chan,enable)
This call activates the SENT Transmitter IP Core Channel by setting enable="1.

Step 6: CONFIGURE SENT TRANSMITTER CHANNEL
fpgawb_SENT_Tx_Configure_Ch(handle,chan,&config)
This call configures the initial set up parameters like number_of_data_nibbles, low_tick_number, tick_length and signal_polarity for the SENT Transmitter IP Core Channel.

Step 7: WRITE CHANNEL DATA
fpgawb_SENT_Tx_Write_Ch_Data(handle,chan,&data_config)
This call writes the data to be transmitted by the SENT Transmitter IP Core Channel.

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

void SENTTransmitterUsage ( )

Usage:
./fpgawb_ipcore_sent_transmitter [-b Board] [-B EnchancedBitID] [-c ChannelNumber] [-C ConfigMode] [-d DataFile] [-e Enable] [-E nEnhanced] [-l LowTickNumber] [-L LegacyCRC] [-n NumberOfDataNibbles] [-s SignalPolarity] [-S nShorts] [-t Type] [-T TickLength]

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-Send Data mode) 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 Low Tick Number - # ticks signal is low between falling edge & following positive edge (5 to 11) 5
-L Legacy CRC (0/1) 0
-n Number of Data Nibbles to be transmitted (1 to 6) 1
-s Signal Polarity (0/1) 0
-S nshorts (1-4) 0
-t Type (0 - short/1 -Enhanced/2 -Fast) 0
-T Tick Length in microseconds (1 to 990) 3


Examples:
Configure- ./fpgawb_ipcore_sent_transmitter -C0 -b0 -c0 -l5 -n6 -T3 -s0 Short- ./fpgawb_ipcore_sent_transmitter -dangles/sent_transmitter_data_short.dat -C1 -b0 -c0 -n6 -S4 -t0 -T3 -B8 -L0
Enhanced- ./fpgawb_ipcore_sent_transmitter -dangles/sent_transmitter_data_enhanced.dat -C1 -b0 -c0 -n6 -E48 -t1 -T3 -B8 -L0
Fast- ./fpgawb_ipcore_sent_transmitter -dangles/sent_transmitter_long_data.dat -C1 -b0 -c0 -n6 -t2 -T3 -L0