Simulate an Event

Hello dear Nordic.
I am wondering if I can simulate a hardware event by the software by writing any value to the event register, or in other words to create artificial interrupt trigger? Or maybe you have a special API for such a thing?

volatile uint32_t *nfc_FieldOnEvent = (volatile uint32_t *)0x4005104;
*nfc_FieldOnEvent = 1;


Best regards, Genadi.

Parents Reply Children
  • Hi,

    I tested this now as well, but it seems that the event registers won't accept writing values of 1. I assumed that since the register is defined as read/write, it should be possible to set it to 1, but there might be some internal limitations in the HW that prevent the application from setting the register to anything other than '0'.

    This is not the intended use of the register. What do you want to achieve by setting it to 1? The peripheral will not be in the correct state if you generate a false event, so your application will likely not function properly. If you want to test part of your code that is executed when the event is generated, you may modify the interrupt handler to check another variable than the event register, that you will have full control over.

    Best regards,
    Jørgen

  • I have some issue with saving data to flash and NFC processing in the background, but that's another story. There is another way to check my hypothesis. 
    Thank you
    Best regards, Genadi

Related