This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Passing Parameters to Software interrupt (EGU)

Hello! 

Short question: How can I pass a parameter to a SW Interrupt?

Expanded question:
I want the board to wait for an ammount of bytes comming from SPI, once this is done, it should activate an interrupt to allow the secundary SPI communication to pass the data to an SD card, how can i do so?

At the moment it works correctly by executing each task after the other, so SPI is working correctly i just need help on passing the SPI parameters to activate the second (SD-Card) task

Board: NRF52 pca10040

  • You need some global variables to handle this for you, e.g. that will work as kind of a state machine so when you receive the SPI interrupt you know what have been sent and received.

    Tip: If you are using nrf_drv_spi_init(), then you can find that the last parameter is called 'p_context', this can be a pointer to the global varible that you will also receive in the callback spi_evt_handler().

    Kenneth

  • Thank you! i will try this and let you know

  • SO that worked, actually what i was planning to do makes almost no sense/ if someone wants to know then send me a mail... 

    it is possible to manage Slave switsching with the software provided, doing what i wanted to do.... goes into interrupting the spi workflow 

Related