1 /* -------------------------------- Arctic Core ------------------------------
2 * Arctic Core - the open source AUTOSAR platform http://arccore.com
4 * Copyright (C) 2009 ArcCore AB <contact@arccore.com>
6 * This source code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published by the
8 * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * -------------------------------- Arctic Core ------------------------------*/
23 #ifndef COUNTER_I_H_
\r
24 #define COUNTER_I_H_
\r
28 #include <sys/queue.h>
\r
30 #define COUNTER_TYPE_HARD 0
\r
31 #define COUNTER_TYPE_SOFT 1
\r
33 #define COUNTER_UNIT_TICKS 0
\r
34 #define COUNTER_UNIT_NANO 1
\r
36 /*-----------------------------------------------------------------*/
\r
37 typedef struct counter_obj_s {
\r
38 // counter id( TODO: remove ?? I use index here )
\r
41 // hardware or software counter, SWS OS255
\r
43 // Ticks or nano, SWS OS331
\r
45 // The counter value ( if software counter )
\r
47 // Application mask, SWS OS317
\r
49 // hmm, strange to call it alarm base.... but see spec.
\r
50 AlarmBaseType alarm_base;
\r
51 /* Used only if we configure a GPT timer as os timer */
\r
53 /* List of alarms this counter is connected to
\r
54 * Overkill ??? Could have list of id's here, but easier to debug this way*/
\r
55 SLIST_HEAD(slist,alarm_obj_s) alarm_head;
\r
56 /* List of scheduletable connected to this counter */
\r
57 SLIST_HEAD(sclist,sched_table_s) sched_head;
\r
60 TickType GetCounterValue_( counter_obj_t *c_p );
\r
62 #endif /*COUNTER_I_H_*/
\r