serial.h 3.98 KB
Newer Older
yoogx's avatar
yoogx committed
1
2
3
4
5
/*
 * This is a part of PolyORB-HI-C distribution, a minimal
 * middleware written for generated code from AADL models.
 * You should use it with the Ocarina toolsuite.
 *
yoogx's avatar
yoogx committed
6
 * For more informations, please visit http://taste.tuxfamily.org/wiki
yoogx's avatar
yoogx committed
7
8
9
10
 *
 * Copyright (C) 2014 ESA & ISAE.
 */

11
12
13
14
#ifndef _INC_SERIAL_H
#define _INC_SERIAL_H
/*
Code automatically generated by asn1scc tool
15
16
Date was: 2/7/2012
Time was: 15:35:35
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
*/

#include "asn1crt.h"

#ifdef  __cplusplus
extern "C" {
#endif



typedef enum {
    __po_hi_c_b9600 = 0,
    __po_hi_c_b19200 = 1,
    __po_hi_c_b38400 = 2,
    __po_hi_c_b57600 = 3,
    __po_hi_c_b115200 = 4,
    __po_hi_c_b230400 = 5
} __po_hi_c_Baudrate_T;

#define __po_hi_c_Baudrate_T_REQUIRED_BYTES_FOR_ENCODING        1
#define __po_hi_c_Baudrate_T_REQUIRED_BITS_FOR_ENCODING        3
#define __po_hi_c_Baudrate_T_REQUIRED_BYTES_FOR_ACN_ENCODING       1
#define __po_hi_c_Baudrate_T_REQUIRED_BITS_FOR_ACN_ENCODING        3
jdelange's avatar
jdelange committed
40
#define __po_hi_c_Baudrate_T_REQUIRED_BYTES_FOR_XER_ENCODING       42
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

#ifndef ERR___po_hi_c_Baudrate_T_unknown_enumeration_value 
#define ERR___po_hi_c_Baudrate_T_unknown_enumeration_value		1000 /* invalid enumeration value */
#endif

void __po_hi_c_Baudrate_T_Initialize(__po_hi_c_Baudrate_T* pVal);
flag __po_hi_c_Baudrate_T_IsConstraintValid(const __po_hi_c_Baudrate_T* val, int* pErrCode);


typedef enum {
    __po_hi_c_even = 0,
    __po_hi_c_odd = 1
} __po_hi_c_Parity_T;

#define __po_hi_c_Parity_T_REQUIRED_BYTES_FOR_ENCODING        1
#define __po_hi_c_Parity_T_REQUIRED_BITS_FOR_ENCODING        1
#define __po_hi_c_Parity_T_REQUIRED_BYTES_FOR_ACN_ENCODING       1
#define __po_hi_c_Parity_T_REQUIRED_BITS_FOR_ACN_ENCODING        1
jdelange's avatar
jdelange committed
59
#define __po_hi_c_Parity_T_REQUIRED_BYTES_FOR_XER_ENCODING       32
60
61
62
63
64
65
66
67
68
69
70
71
72
73

#ifndef ERR___po_hi_c_Parity_T_unknown_enumeration_value 
#define ERR___po_hi_c_Parity_T_unknown_enumeration_value		1001 /* invalid enumeration value */
#endif

void __po_hi_c_Parity_T_Initialize(__po_hi_c_Parity_T* pVal);
flag __po_hi_c_Parity_T_IsConstraintValid(const __po_hi_c_Parity_T* val, int* pErrCode);


typedef struct {
    char devname[21];
    __po_hi_c_Baudrate_T speed;
    __po_hi_c_Parity_T parity;
    asn1SccSint bits;
74
    asn1SccSint sending_wait;
75
76
77
78
79
    flag use_paritybit;
    struct {
        unsigned int speed:1;
        unsigned int parity:1;
        unsigned int bits:1;
80
        unsigned int sending_wait:1;
81
82
83
84
        unsigned int use_paritybit:1;
    } exist;
} __po_hi_c_serial_conf_t;

85
86
87
88
#define __po_hi_c_serial_conf_t_REQUIRED_BYTES_FOR_ENCODING        23
#define __po_hi_c_serial_conf_t_REQUIRED_BITS_FOR_ENCODING        180
#define __po_hi_c_serial_conf_t_REQUIRED_BYTES_FOR_ACN_ENCODING       25
#define __po_hi_c_serial_conf_t_REQUIRED_BITS_FOR_ACN_ENCODING        200
jdelange's avatar
jdelange committed
89
#define __po_hi_c_serial_conf_t_REQUIRED_BYTES_FOR_XER_ENCODING       256
90
91
92
93
94
95
96

#ifndef ERR___po_hi_c_serial_conf_t_devname 
#define ERR___po_hi_c_serial_conf_t_devname		1002 /* (SIZE (1..20)) */
#endif
#ifndef ERR___po_hi_c_serial_conf_t_bits 
#define ERR___po_hi_c_serial_conf_t_bits		1003 /* (7..8) */
#endif
97
#ifndef ERR___po_hi_c_serial_conf_t_sending_wait 
98
#define ERR___po_hi_c_serial_conf_t_sending_wait		1004 /* (0..9000000) */
99
#endif
100
101
102
103
104

void __po_hi_c_serial_conf_t_Initialize(__po_hi_c_serial_conf_t* pVal);
flag __po_hi_c_serial_conf_t_IsConstraintValid(const __po_hi_c_serial_conf_t* val, int* pErrCode);


105
extern  __po_hi_c_serial_conf_t linux_ttyS0;
106
107
108
extern  __po_hi_c_serial_conf_t linux_ttyUSB0;
extern  __po_hi_c_serial_conf_t linux_ttyUSB1;
extern  __po_hi_c_serial_conf_t linux_ttyUSB2;
109
extern  __po_hi_c_serial_conf_t leon_rasta_apburasta0;
110
extern  __po_hi_c_serial_conf_t leon_rasta_apburasta1;
111
112
113
114
115
116
117
118
119
120
121
122
123
124

#ifdef  __cplusplus
}
#define ENUM___po_hi_c_b9600	__po_hi_c_b9600
#define ENUM___po_hi_c_b19200	__po_hi_c_b19200
#define ENUM___po_hi_c_b38400	__po_hi_c_b38400
#define ENUM___po_hi_c_b57600	__po_hi_c_b57600
#define ENUM___po_hi_c_b115200	__po_hi_c_b115200
#define ENUM___po_hi_c_b230400	__po_hi_c_b230400
#define ENUM___po_hi_c_even	__po_hi_c_even
#define ENUM___po_hi_c_odd	__po_hi_c_odd
#endif

#endif