summaryrefslogtreecommitdiff
path: root/cesar/hal/leon/inc/timer_ctx.h
blob: ecf22e7851fc2fd39a01287943eed93b6003ce84 (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
#ifndef hal_leon_inc_timer_ctx_h
#define hal_leon_inc_timer_ctx_h
/* Cesar project {{{
 *
 * Copyright (C) 2008 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    hal/leon/inc/timer_ctx.h
 * \brief   Leon Timer context.
 * \ingroup hal_leon
 *
 */

#include <cyg/kernel/kapi.h>
#include <cyg/hal/drv_api.h>
#include <cyg/infra/diag.h>

enum leon_timer_status_t
{
    LEON_TIMER_STATUS_STOP,
    LEON_TIMER_STATUS_RUNNING,
};
typedef enum leon_timer_status_t leon_timer_status_t;

struct leon_timer_t
{
    /** Inidicates the Leon timer status. */
    leon_timer_status_t status;
    /** Function call back to call. */
    leon_timer_cb_t cb;
    /** Callback user data. */
    void *user_data;

    /** interrupt handle for the ecos. */
    cyg_interrupt it_timer;
    cyg_handle_t it_handle;
    cyg_vector_t it_vector;
};

#endif /* hal_leon_inc_timer_ctx_h */