This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf52 sdk13 fail at nrf_spi_event_check

hi ,everyone:

my code always fail at nrf_spi_event_check, why? 

I suggest that the code don't use the semphore to broke spi.

Parents
  • Hi,

    The nrf_spi_event_check function just reads a register value, there is no semaphore there. In fact, the implementation is a one-liner (SDK 15):

    __STATIC_INLINE bool nrf_spi_event_check(NRF_SPI_Type * p_reg,
                                             nrf_spi_event_t spi_event)
    {
        return (bool)*(volatile uint32_t *)((uint8_t *)p_reg + (uint32_t)spi_event);
    }

    It is not clear to me what you are doing and how it is failing. Can you be more specific?

    I would also want to mention that you may want to use the SPI driver (master or slave) instead of doing the low level stuff yourself.

Reply
  • Hi,

    The nrf_spi_event_check function just reads a register value, there is no semaphore there. In fact, the implementation is a one-liner (SDK 15):

    __STATIC_INLINE bool nrf_spi_event_check(NRF_SPI_Type * p_reg,
                                             nrf_spi_event_t spi_event)
    {
        return (bool)*(volatile uint32_t *)((uint8_t *)p_reg + (uint32_t)spi_event);
    }

    It is not clear to me what you are doing and how it is failing. Can you be more specific?

    I would also want to mention that you may want to use the SPI driver (master or slave) instead of doing the low level stuff yourself.

Children
No Data
Related