3 Replies Latest reply on Mar 18, 2019 2:24 AM by SrinathS_16

    211A status bits and DLL support

    jocac_4016601

      3.16 CY_CALLBACK_EVENTS

      Enumeration defining UART/SPI transfer error or status bit maps.

      Description

      Enumeration lists the bit maps that are used to report error or status during UART/SPI transfer.

      Members

      Members                                                      Description

      CY_UART_CTS_BIT = 0x01                        CTS pin notification bit

      CY_UART_DSR_BIT = 0x02                        State of transmission carrier. This signal corresponds to V.24 signal 106 andRS-232 signal DSR.

      CY_UART_BREAK_BIT = 0x04                    State of break detection mechanism of the device

      CY_UART_RING_SIGNAL_BIT = 0x08        State of ring signal detection of the device

      CY_UART_FRAME_ERROR_BIT = 0x10     A framing error has occurred

      CY_UART_PARITY_ERROR_BIT = 0x20     A parity error has occured

      CY_UART_DATA_OVERRUN_BIT= 0x40     Received data has been discarded due to overrun in the device

      CY_UART_DCD_BIT = 0x100                        State of receiver carrier detection mechanism of device. This signal corresponds to V.24 signal 109 and RS-232 signal DCD

      CY_SPI_TX_UNDERFLOW_BIT = 0x200      Notification sent when SPI fifo is empty

      CY_SPI_BUS_ERROR_BIT = 0x400             Spi bus error has been detected

      CY_ERROR_EVENT_FAILED_BIT = 0x800  Event thread failed

       

      Question: How can I read these bits directly?  Do you have a DLL to allow me to do that?

        • 1. Re: 211A status bits and DLL support
          SrinathS_16

          Hello,

           

          - The CY_CALLBACK_EVENTS enum type values can be read only as part of the callback function registered using the CySetEventNotification() API.

          - Please add the below function block as a callback function.

          void callbackFunc(UINT16 bitmask)

          {

              /* bitmask can be read here to identify the event occurred */

              return;

          }

          The below statement registers the callback function to be executed whenever there is a CY_CALLBACK_EVENTS event.

          rStatus = CySetEventNotification(handle, &callbackFunc);

           

          Best regards,

          Srinath S

          • 2. Re: 211A status bits and DLL support
            jocac_4016601

            So, the correct answer is that there is no way to read the bits. thanks.  Why not just say that?

            • 3. Re: 211A status bits and DLL support
              SrinathS_16

              Hello,

               

              As I had mentioned earlier, the status bits can be read when there is an occurrence of the event. The CySetEventNotification() API is used to set the function pointer that is to be invoked when there is an event occurrence. This call back function indicates the event through a bit-mask.

               

              Best regards,

              Srinath S