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

spi_master_evt.evt_type

Hello, I am new to Nordic NRF51dk and I'm working on the SPICommunication_module c.

For the switch case statement, I am trying to understand what the spi_master_evt.evt_type is, which is located inside the switch statement argument. Can anyone help me explain clearly on what it does and how it works?

Thanks

Here is the link developer.nordicsemi.com/.../a00011.html

  • You can register a callback while you are doing spi_init

    // Register event handler for SPI master.
    spi_master_evt_handler_reg(spi_master_instance, spi_master_event_handler);
    

    now your spi_master_event_handler will be called whenever ANY type of event which is in spi_master_evt_type_t occurs. You can handle the cases which you would like to be notified.

    note that you get this events with your registered callback when when you register them with the spi driver explicitly by using

    spi_master_evt_handler_reg()
    
Related