summaryrefslogtreecommitdiff
path: root/cesar/hal/leon/maximus/inc/maximus_timer_ctx.h
blob: 0ae1b6af19b8f20146df68ad64bdd8960e468d50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef hal_leon_maximus_inc_maximus_timer_ctx_h
#define hal_leon_maximus_inc_maximus_timer_ctx_h
/* Cesar project {{{
 *
 * Copyright (C) 2008 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    hal/leon/maximus_inc/maximus_timer_ctx.h
 * \brief   Leon Timer context for Maximus. 
 * \ingroup hal_leon_maximus
 *
 */

#include "hal/leon/timer.h" // for 'leon_timer_cb_t'
#include "host/netclock.h" // for 'netclock_id_t' and 'netclock_callback_t'
#include "hal/leon/maximus/inc/maximus_trace.h"
#ifdef ECOS
#include <cyg/hal/drv_api.h>
#endif /* ECOS */

struct leon_timer_t
{
    /** Indicates the Leon timer status. false == stopped, true == launched. */
    bool status;
    /** Function callback to call. */
    leon_timer_cb_t cb;
    /** Callback user data. */
    void *user_data;

    /** Set to true to enable assertions on WARNING messages. */
    bool warning_assert;
    /** Id of netclock message sent by 'leon_timer_program()'. */
    netclock_id_t netclock_id;
    /** Callback context to insert into callback queue. */
    netclock_callback_t *netclock_cb;

#ifdef ECOS
    /** leon timer interrupt descriptor for eCos */
    cyg_interrupt it_timer;
    /** leon timer interrupt handle */
    cyg_handle_t it_handle;
#endif /* ECOS */

#if CONFIG_TRACE
    /** PHY trace. */
    trace_buffer_t trace;
#endif /* CONFIG_TRACE */
};

#endif /* hal_leon_maximus_inc_maximus_timer_ctx_h */