at91rm3400 ATMEL Corporation, at91rm3400 Datasheet - Page 62

no-image

at91rm3400

Manufacturer Part Number
at91rm3400
Description
Atmel Advanced At91 Arm Microcontroller
Manufacturer
ATMEL Corporation
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
at91rm3400-AU-002
Manufacturer:
Atmel
Quantity:
10 000
Using the Service
62
AT91RM3400
The first step is to find the address of the open service method AT91F_OpenCtlTempo using
the ROM Entry Service.
Allocate one instance of AT91S_CtlTempo and AT91S_SvcTempo in the application mem-
ory space:
Initialize the AT91S_CtlTempo instance by calling the AT91F_OpenCtlTempo function:
At this stage, the application can use the AT91S_CtlTempo service members.
If the application wants to overload an object member, it can be done now. For example, if
AT91F_CtlTempoCreate(
tion defined as my_CtlTempoCreate(...), the procedure is as follows:
I n m o s t c a s e s , i n i t i a l i z e t h e A T 9 1 S _ S v c T e m p o o b j e c t b y c a l l i n g t h e
AT91F_CtlTempoCreate method of the AT91S_CtlTempo service:
Start the timeout by calling
parameters, either a callback is started at the end of the countdown or the status of the time-
out is checked by reading the TickTempo member of the svcTempo1 object.
When the application needs another software timer to control a timeout, it:
// Allocate the service and the control tempo
AT91S_CtlTempo ctlTempo;
AT91S_SvcTempo svcTempo1;
// Initialize service
pAT91->OpenCtlTempo(&ctlTempo, (void *) &(pAT91->SYSTIMER_DESC));
// Overload AT91F_CtlTempoCreate
ctlTempo.CtlTempoCreate = my_CtlTempoCreate;
// Init the svcTempo1, link it to the AT91S_CtlTempo object
ctlTempo.CtlTempoCreate(&ctlTempo, &svcTempo1);
// Start the timeout
svcTempo1.Start(&svcTempo1,100,0,NULL,NULL);
// Wait for the timeout of 100 (unity depends on the timer programmation)
// No repetition and no callback.
while (svcTempo1.TickTempo);
Allocates one instance of AT91S_SvcTempo in the application memory space
// Allocate the service
AT91S_SvcTempo svcTempo2;
Initializes the AT91S_SvcTempo object calling the AT91F_CtlTempoCreate method of
the AT91S_CtlTempo service:
// Init the svcTempo2, link it to the AT91S_CtlTempo object
ctlTempo.CtlTempoCreate(&ctlTempo, &svcTempo2);
Start
&ctlTempo, &svcTempo1
method of the svcTempo1 object. Depending on the function
) method is to be replaced by the applica-
1790A–ATARM–11/03

Related parts for at91rm3400