summaryrefslogtreecommitdiff
path: root/cesar/cl/data_rate.h
blob: eff3ecc0dd57d4557eb437e11e304a7c4fdcda80 (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
#ifndef cl_data_rate_h
#define cl_data_rate_h
/* Cesar project {{{
 *
 * Copyright (C) 2009 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    cl/data_rate.h
 * \brief   data rate common declarations.
 * \ingroup cl
 *
 * This data rate info are shared between CP and CL.
 */

/* This value in the data_rate field of the cl_data_rate_t
 * structure indicate that the whole structure needs to be initialized.
 */
#define CL_DATA_RATE_REQ_INIT 0xFFFFFFFF

/**
 * Structure used to store data rate informations.
 * It stores the data rate value the moment when
 * this value was evaluated.
 */
struct cl_data_rate_t
{
    /** data rate value expressed in octets/sec. */
    u32 data_rate;
    /** time (in ecos clock ticks 10ms) when the value was calculated. */
    u64 time_rtc;
    /** time (in phy clock ticks 40ns) when the value was calculated. */
    u32 time_tck;
};
typedef struct cl_data_rate_t cl_data_rate_t;

/**
 * Update the data rate info with the new data data size
 * \param  p_dr  pointer to the data rate structure.
 * \param  new_data_size data quantity in octets.
 */
void
data_rate_update_info (cl_data_rate_t *p_dr, uint data_size);

#endif /* cl_data_rate_h */