spacewire.c 4.23 KB
Newer Older
1
#if (defined (__PO_HI_NEED_DRIVER_SPACEWIRE_RASTA))\n
2
3
/*
Code automatically generated by asn1scc tool
4
5
Date was: 2/9/2011
Time was: 17:39:12
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
*/
#include <string.h>
#include <math.h>
#include "spacewire.h"


#ifndef _MSC_VER
#endif

void __po_hi_c_Core_Frequence_T_Initialize(__po_hi_c_Core_Frequence_T* pVal)
{
	*pVal = 0;
}


flag __po_hi_c_Core_Frequence_T_IsConstraintValid(const __po_hi_c_Core_Frequence_T* pVal, int* pErrCode) 
{
	if ( !(((*pVal>=0) && (*pVal<=4294967295LL))) ) {
		*pErrCode = ERR___po_hi_c_Core_Frequence_T;
		return FALSE;
	}
	(void)pVal; /*Dummy statement, just to hide potential warning*/
	(void)pErrCode; /*Dummy statement, just to hide potential warning*/
	return TRUE;
}

flag __po_hi_c_Core_Frequence_T_Equal(const __po_hi_c_Core_Frequence_T* pVal1, const __po_hi_c_Core_Frequence_T* pVal2) 
{
	if (*pVal1 != *pVal2) 
		return FALSE;
	return TRUE;
}






void __po_hi_c_Node_Addr_T_Initialize(__po_hi_c_Node_Addr_T* pVal)
{
	*pVal = 0;
}


flag __po_hi_c_Node_Addr_T_IsConstraintValid(const __po_hi_c_Node_Addr_T* pVal, int* pErrCode) 
{
	if ( !(((*pVal>=0) && (*pVal<=255))) ) {
		*pErrCode = ERR___po_hi_c_Node_Addr_T;
		return FALSE;
	}
	(void)pVal; /*Dummy statement, just to hide potential warning*/
	(void)pErrCode; /*Dummy statement, just to hide potential warning*/
	return TRUE;
}

flag __po_hi_c_Node_Addr_T_Equal(const __po_hi_c_Node_Addr_T* pVal1, const __po_hi_c_Node_Addr_T* pVal2) 
{
	if (*pVal1 != *pVal2) 
		return FALSE;
	return TRUE;
}






void __po_hi_c_Clock_Division_T_Initialize(__po_hi_c_Clock_Division_T* pVal)
{
	*pVal = 0;
}


flag __po_hi_c_Clock_Division_T_IsConstraintValid(const __po_hi_c_Clock_Division_T* pVal, int* pErrCode) 
{
	if ( !(((*pVal>=0) && (*pVal<=255))) ) {
		*pErrCode = ERR___po_hi_c_Clock_Division_T;
		return FALSE;
	}
	(void)pVal; /*Dummy statement, just to hide potential warning*/
	(void)pErrCode; /*Dummy statement, just to hide potential warning*/
	return TRUE;
}

flag __po_hi_c_Clock_Division_T_Equal(const __po_hi_c_Clock_Division_T* pVal1, const __po_hi_c_Clock_Division_T* pVal2) 
{
	if (*pVal1 != *pVal2) 
		return FALSE;
	return TRUE;
}






void __po_hi_c_spacewire_conf_t_Initialize(__po_hi_c_spacewire_conf_t* pVal)
{
	memset(pVal->devname, 0x0, 21);
	pVal->nodeaddr = 0;
	pVal->corefreq = 0;
	pVal->clockdiv = 0;
	pVal->remove_prot_id = FALSE;
	pVal->rxblock = FALSE;
	pVal->txblock = FALSE;
}


flag __po_hi_c_spacewire_conf_t_IsConstraintValid(const __po_hi_c_spacewire_conf_t* pVal, int* pErrCode) 
{
	if ( !(((strlen(pVal->devname)>=1) && (strlen(pVal->devname)<=20))) ) {
		*pErrCode = ERR___po_hi_c_spacewire_conf_t_devname;
		return FALSE;
	}
	if ( !__po_hi_c_Node_Addr_T_IsConstraintValid(&pVal->nodeaddr, pErrCode)) 
		return FALSE;

	if ( !__po_hi_c_Core_Frequence_T_IsConstraintValid(&pVal->corefreq, pErrCode)) 
		return FALSE;

	if ( !__po_hi_c_Clock_Division_T_IsConstraintValid(&pVal->clockdiv, pErrCode)) 
		return FALSE;

	if (pVal->exist.remove_prot_id) {
	}
	if (pVal->exist.rxblock) {
	}
	if (pVal->exist.txblock) {
	}
	(void)pVal; /*Dummy statement, just to hide potential warning*/
	(void)pErrCode; /*Dummy statement, just to hide potential warning*/
	return TRUE;
}

flag __po_hi_c_spacewire_conf_t_Equal(const __po_hi_c_spacewire_conf_t* pVal1, const __po_hi_c_spacewire_conf_t* pVal2) 
{
	if (strcmp(pVal1->devname, pVal2->devname) !=0)
		return FALSE;
	if (!__po_hi_c_Node_Addr_T_Equal(&pVal1->nodeaddr, &pVal2->nodeaddr))
		return FALSE;
	if (!__po_hi_c_Core_Frequence_T_Equal(&pVal1->corefreq, &pVal2->corefreq))
		return FALSE;
	if (!__po_hi_c_Clock_Division_T_Equal(&pVal1->clockdiv, &pVal2->clockdiv))
		return FALSE;
	if (pVal1->exist.remove_prot_id != pVal2->exist.remove_prot_id)
		return FALSE;
	if (pVal1->exist.remove_prot_id) {
		if ( (pVal1->remove_prot_id && !pVal2->remove_prot_id) || (!pVal1->remove_prot_id && pVal2->remove_prot_id))
			return FALSE;
	}
	if (pVal1->exist.rxblock != pVal2->exist.rxblock)
		return FALSE;
	if (pVal1->exist.rxblock) {
		if ( (pVal1->rxblock && !pVal2->rxblock) || (!pVal1->rxblock && pVal2->rxblock))
			return FALSE;
	}
	if (pVal1->exist.txblock != pVal2->exist.txblock)
		return FALSE;
	if (pVal1->exist.txblock) {
		if ( (pVal1->txblock && !pVal2->txblock) || (!pVal1->txblock && pVal2->txblock))
			return FALSE;
	}
	return TRUE;
}







177
\n#endif