HOLT HI-3110 User Manual page 11

Arinc 825 can bus controller evaluation board
Hide thumbs Also See for HI-3110:
Table of Contents

Advertisement

A PPO interrupt handler is provided to interrupt when the 3110 receives a CAN Bus frame of 
data. This interrupt handler is utilized only in Receive Mode Interrupt Mode‐6. Once an interrupt 
occurs the interrupt handler fetches the frame of data and stores the data into a global buffer 
(g_RXBuffer) and then sets a flag "g_RecRdy=TRUE". The main receiver function looks for this 
flag and fetches the new CAN data when this flag is set. 
There are two other possible sources for hardware interrupts using the XIRQ and IRQ inputs 
reserved for possible future use.  
 
3110Driver.c   Drivers 
 
All the HI‐3110 SPI drivers are contained in this module for reading and writing to the control 
registers,  status registers,  filters/masks and the FIFO's . 
There are several functions to read in a single byte from the 3110 SPI port, write a command to 
the 3110 SPI port and a few others which read or write a command plus a multiple number of 
bytes.  For example the function below is the basic function to write out a command plus one 
byte of data to the 3110 SPI port.  
 
// Write SPI Command with a Value to HI-3110
void W_CommandValue (uint8 cmd, uint8 value){
uint8 dummy;
SPI0CR1 = SPI0CR1 & ~SPI0CR1_SSOE_MASK;
reset /SS Output
SPI0CR2 = SPI0CR2 & ~SPI0CR2_MODFEN_MASK; // disable auto /SS output,
reset SPI0 Mode
SPI0_nSS = 0;
strobe
dummy = SPI0SR;
register
SPI0DR = cmd;
while (!SPI0SR_SPIF);
dummy = SPI0DR;
to reset SPIF
dummy = SPI0SR;
register
SPI0DR = value;
while (!SPI0SR_SPIF);
dummy = SPI0DR;
to reset SPIF
SPI0_nSS = 1;
strobe
SPI0CR1 = SPI0CR1 | SPI0CR1_SSOE_MASK;
set /SS Output Enable
// disable auto /SS output,
// assert the SPI0 /SS
// clear SPI status
// SPI
command
// read Rx data in Data Reg
// clear SPI status
// Reset values
// read Rx data in Data Reg
// negate the SPI0 /SS
// enable auto /SS output,

Advertisement

Table of Contents
loading

Table of Contents