AN-175
21
Holt Integrated Circuits
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; // disable auto /SS output, reset /SS Output
SPI0CR2 = SPI0CR2 & ~SPI0CR2_MODFEN_MASK; // disable auto /SS output, reset SPI0 Mode
SPI0_nSS = 0; // assert the SPI0 /SS strobe
for(ByteCount=0; ByteCount< 13; By+) // Transmit command=0x12 + 12
{
dummy = txrx8bits(TXBuffer[ByteCount], 1); // Transmit the whole message,
// ignore return values
}
SPI0_nSS = 1; // negate the SPI0 /SS strobe
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.
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from