HOLT HI-3110 User Manual page 21

Hide thumbs Also See for HI-3110:
Table of Contents

Advertisement

This function is used to transmit a command byte followed by a multiple number of data bytes
contained into the array passed by the pointer. In this case it's used to load the SPI Write Transmit FIFO
command byte 0x12 and the frame data bytes.
void TransmitStandardFrame(uint8 *TXBuffer)
{
uint8 static ByteCount,dummy;
SPI0CR1 = SPI0CR1 & ~SPI0CR1_SSOE_MASK;
SPI0CR2 = SPI0CR2 & ~SPI0CR2_MODFEN_MASK;
SPI0_nSS = 0;
for(ByteCount=0; ByteCount< 13; ByteCount++)
{
dummy = txrx8bits(TXBuffer[ByteCount], 1);
}
SPI0_nSS = 1;
SPI0CR1 |= SPI0CR1_SPE_MASK|SPI0CR1_SSOE_MASK;
SPI0CR2 |= SPI0CR2_MODFEN_MASK;
}
Al l the other functions in this module are based on and utilize these basic functions.
Init3110()
This function is provided to initialize the HI-3110 for the desired mode and bit rate.
uint8 Init3110(const mode, uint8 ttdiv, uint8 wakeup, uint8 reset, uint8 bor)
See the 3110Driver.h header file for the options available in the define statements.
Uart.c Serial Port (RS-232)
The drivers to support the serial port are contained in this module. There are some function drivers to
allow messages to be sent and received on the UART. This is useful to log status or data messages on
Hyper-terminal or any other terminal program. It currently uses polling to determine when the data
receive or transmit registers can be read or written.
GPI and GP2
The HI-3110 general purpose output pins can be configured to output status information described in
the GPINE register. The program configures these differently depending on the mode and the LED10 and
LED11 will turn on when these are at a logic low. GP1 and GP2 are configured to output TXCPLT and
RXFIFO to generate interrupts.
21
AN-175
// disable auto /SS output, reset /SS Output
// disable auto /SS output, reset SPI0 Mode
// assert the SPI0 /SS strobe
// Transmit command=0x12 +
// Transmit the whole message,
// ignore return values
// negate the SPI0 /SS strobe
12
Holt Integrated Circuits

Advertisement

Table of Contents
loading

Table of Contents