Need help on SAMD20 Event System

1 post / 0 new
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


I am running the example program EVENT_QUICK_START_HOOK for the SAMD20 and I have some questions.

Inside it it configures an Event User with:


events_attach_user(resource, CONF_EVENT_USER);

Should I guess that theoretically when an event is triggered, then Timer0 is being started to operate and function based on some criteria given to it?

I tried to define the event user to various values, like:


The application blinks the led as it was doing with the initial value. This seems normal to me because it has a hook that is being called on overflow of TC4 (see bellow).

static void configure_event_interrupt(struct events_resource *resource,
		struct events_hook *hook)
	//! [setup_12]
	events_create_hook(hook, event_counter);
	//! [setup_12]

	//! [setup_13]
	events_add_hook(resource, hook);
	events_enable_interrupt_source(resource, EVENTS_INTERRUPT_DETECT);
	//! [setup_13]

So, the event user in that case seems to be of no use at all.


Should I always attach an event user no matter what? When commenting out the 'events_attach_user' function, the software does not seem to operate. What is the meaning of the event user since we have a callback hook?


Thank you very much.