Using SPI?

I’d like to use SPI. How do I set this up?

A serial port driver is supplied as part of the BSP. This device driver provides support for two synchronies serial ports implemented in the NET ARM chip. This driver supports “Serial peripheral Interface” (SPI) protocol. Detailed information is supplied in the HW reference guide and also in the sample example application “naspi”. Unlike well-defined asynchronies serial protocol (RS-232), SPI protocol is a proprietary specification used in the EEPROM’s and some Robotic applications. This particular driver is designed ant tested using: “SPI Serial EEPROM X25020” by XICOR. Direct Board-to-Board” data transfer. The SPI driver for the serial port 1 will be included in the BSP library if the constant BSP_INCLUDE_SPI_DRIVE_1 is defined in h\bspconf.h. The SPI driver for port 2 will be included in the BSP library if the constant BSP_INCLUDE_SPI_DRIVE_2 is defined in h\bspconf.h. Because the RS-232 serial drivers and the SPI drivers use the same hardware, they are commonly exclusive. You cannot specify BSP_INCLUDE_SERIAL_DRIVER_1 and BSP_INCLUDE_SPI_DRIVE_1 at the same time. Likewise, you cannot specify BSP_INCLUDE_SERIAL_DRIVER_2 and BSP_INCLUDE_SPI_DRIVE_2 at the same time. Unlike RS-232 protocol that does not have notion about “block of data”, SPI protocol has a notion about “block of data”. As the result of this, one block of data must be sent (received) using a single write (read) operation. SPI protocol makes no distinguish between “read” or “write” operation. HW will send and receive one bit of the data with every clock signal. If device is holding ‘high” signal on it “TXD” port during the write operation, hardware will read 0XFF byte into the input FIFO buffer for every byte written. In order to prevent sending or receiving information that “left over” in the serial port registers, driver will reset serial port before each read or write operation. The SPI driver can support MASTER and SLAVE mode. When configure to be a master, ability to control more then one device is provided. Driver can support NET ARM 40 and NET ARM 50-1 chip. NET ARM 40 can control one device that requires desertion and reassertion of the SEL signal between each successive serial byte. NET ARM 50-1 cannot control such devices. When running on the NET ARM 50-1 SPI driver can control serial clock phase and polarity.

It there and example for the connect em? The naspi example doesn’t seem to be included with NET-OS 6.0

My application needs to negotiate state using a handshake before invoking SPI Are there APIs for IO control? Where are the functions narm_write_reg / narm_read_reg documented?

Where can I take a look at the device driver API:s, in general, and for SPI in particular ?

Check out the bsp api reference guide for this.

Is there an example for Connect EM on how set up and use the SPI mode? The naspi example doesn’t seem to be included with NET-OS 6.0.