SPI Programming Manual (G06.24+, H06.03+, J06.03+)

SPI Programming Examples
SPI Programming Manual427506-006
E-68
Example E-14: Common Declarations for C
Examples
Example E-14: Common Declarations for C Examples
This C code contains common declarations used by the other C example programs.
Source File
SECCH
Example E-14. C File: SECCH Supporting Code
#include <tal.h> nolist
#include <cextdecs> nolist
#include <ctype.h> nolist
#include <stdio.h> nolist
#include <stdlib.h> nolist
#include <stddef.h> nolist
#include <time.h> nolist
#include <string.h> nolist
#include <memory.h> nolist
#include <fcntl.h> nolist
#include "zspic" nolist
#pragma list
/*
** File name: secch
** SPI EXAMPLE C Common Declarations and variables.
*/
#define tkn_1 16842753lu /* 1D '<<' 24 + 1D '<<' 16 + 1D */
#define tkn_2 16842754lu /* 1D '<<' 24 + 1D '<<' 16 + 2D */
#define tkn_3 16842755lu /* 1D '<<' 24 + 1D '<<' 16 + 3D */
#define tkn_4 16842756lu /* 1D '<<' 24 + 1D '<<' 16 + 4D */
#define tkn_5 16842757lu /* 1D '<<' 24 + 1D '<<' 16 + 5D */
#define tkn_6 16842758lu /* 1D '<<' 24 + 1D '<<' 16 + 6D */
#define false 0
#define true -1
/* SPI related variables */
short b1 [max_bufsize/2]; /* SPI buffer 1 */
short b2 [max_bufsize/2]; /* SPI buffer 2 */
short bufsize;
short err = 0;
short last_file_err; /* Set by "get_file_error" */
short get_count; /* Count param to SSGET/SSGETTKN
*/
long tkn_code;
short tkn_buffer_i [50]; /* For GET and PUT */
short* tkn_value; /* = @tkn_buffer_i; /* For GET and PUT */
long* tkn_value_2; /* = @tkn_buffer_i; /* For GET and PUT */
char* tkn_buffer; /* = @tkn_buffer_i '<<' 1; /8 For GET and PUT */
char val;
zspi_ddl_ssid_def ssid = {{'E','X','A','M','P','L','E','S'}, 1, 0};
zspi_ddl_tokencode_def tkn_code_def; /* = tkn_code; */
/* Program misc. variables */
short continue_flag; /* flag */