Add second interface to AVB-DC SPI interface

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
User avatar
140dB
Member
Posts: 10
Joined: Fri Nov 07, 2014 1:30 pm

Add second interface to AVB-DC SPI interface

Post by 140dB »

I would like to know how you go about adding to the SPI interface (NOT THE PERIPHERAL but the .XC extenstion interface) with in the AVB-DC application. The interface is defined and I have tried to follow the example from the programming manual and can't seem to get it right. 

I would like to enable another task to communicate with the SPI task already defined in the AVB-DC application. 

Any one have successe with this? 

interface spi_interface {   /** This function issues a single command without parameters to the SPI,   * and reads up to 4 bytes status value from the device.   *   * \param cmd command value - listed above   *   * \param returnBytes The number of bytes that are to be read from the   * device after the command is issued. 0 means no bytes   * will be read.   *   * \returns the read bytes, or zero if no bytes were requested. If multiple   * bytes are requested, then the last byte read is in the least-significant   * byte of the return value.   */   int command_status(int cmd, unsigned returnBytes);       /** This function issues a single command with a 3-byte address parameter   * and an optional data-set to be output to or input form the device.   *   * \param cmd command value - listed above   *   * \param address the address to send to the SPI device. Only the least   * significant 24 bits are used.   *   * \param data an array of data that contains either data to be written to   * the device, or which is used to store that that is   * read from the device.   *   * \param returnBytes If positive, then this is the number of bytes that   * are to be read from the device, into ``data``. If   * negative, then this is (minus) the number of bytes to   * be written to the device from ``data``. 0 means no   * bytes will be read or written.   *   */   void command_address_status(int cmd, unsigned int address, unsigned char data[], int returnBytes);   };       /** Task that implements a SPI interface to serial flash, typically the boot flash.   *   * Can be combined or distributed into other tasks.   *   * \param i_spi server interface of type ``spi_interface``   * \param spi_ports reference to a ``fl_spi_ports`` structure containing the SPI flash ports and clockblock   */   [[distributable]]   void spi_task(server interface spi_interface i_spi, fl_spi_ports &spi_ports);   #endif       #endif  

Read




Post Reply