6 Replies Latest reply on Sep 16, 2016 1:20 AM by user_1377889

    Another problem with SPI [SOLVED]




      Some time ago i did a project and used SPI_txBufferRead and SPI_rxBufferRead variables to know where in the FIFO buffer i "was".

      • SPI_txBufferRead = Transmits buffer location of the last data read from the buffer and transmitted by SPI Master hardware.
      • SPI_rxBufferRead = Receives buffer location of the last data read from the buffer by the API.

      (This information is at the end of the page 20 of the current SPI Datasheet.)


      Now i'm trying to use the same variables and Creator gives me an error "Build error: 'SPI_txBufferRead' undeclared (first use in this function)"


      After some checking theres an "announcement" at the end of the SPI.h file:




      * The following code is DEPRECATED and
      * should not be used in new projects.


      #define SPI_WriteByte   SPI_WriteTxData
      #define SPI_ReadByte    SPI_ReadRxData
      void  SPI_SetInterruptMode(uint8 intSrc)       ;
      uint8 SPI_ReadStatus(void)                     ;
      void  SPI_EnableInt(void)                      ;
      void  SPI_DisableInt(void)                     ;


      #define SPI_TXDATA                 (SPI_TXDATA_REG)
      #define SPI_RXDATA                 (SPI_RXDATA_REG)
      #define SPI_AUX_CONTROLDP0         (SPI_AUX_CONTROL_DP0_REG)
      #define SPI_TXBUFFERREAD           (SPI_txBufferRead)
      #define SPI_TXBUFFERWRITE          (SPI_txBufferWrite)
      #define SPI_RXBUFFERREAD           (SPI_rxBufferRead)
      #define SPI_RXBUFFERWRITE          (SPI_rxBufferWrite)




      and there's SPI_txBufferRead :/.




      So, there's any new way to know in what position of the FIFO i'm?


      I need to use it know because i'm having some problems with those FIFOs.




      Thanks in advance




      BTW i'm using CY8CKIT-059 kit