summaryrefslogtreecommitdiff
path: root/cleopatre/plcdrv/arm/src/hal.c
blob: 7eda9d8c5725e09a474e64dadf4a88fe9c02927d (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
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
/* Cleopatre project {{{
 *
 * Copyright (C) 2008 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    hal.c
 * \brief   HAL Layer.
 * \ingroup Cleopatre - PlcDrv
 *
 * this layer provide all Hardware Abstraction:
 * registers, interrupts.
 */

#ifndef __UTESTS__
#include "mailbox.h"
#include "hal.h"
#include "registers.h"
#else
#include "common.h"
#include "hal.h"
#endif

/** 
 * Initialize the hal layer.
 *
 * \param  init  user information.
 * \return  hal context.
 */
struct halctx* halmbx_init(struct init_info *info)
{
}

/** 
 * UnInitialize the hal layer.
 * 
 * \param  ctx  hal context.
 */
void halmbx_uninit(struct halctx *ctx)
{
}

/** 
 * Set the Arm to Leon Interrupt.
 */
void set_A2Lt_interrupt(void)
{
}

/** 
 * Set the Arm to Leon acknowledge Interrupt.
 */
void set_L2Aa_interrupt(void)
{
}

/** 
 * Clear the Leon to Arm Interrupt.
 */
 void clr_L2At_interrupt(void)
{
}

/** 
 * Clear the Leon to Arm acknowledge Interrupt.
 */
void clr_A2La_interrupt(void)
{
}

/** 
 * Enable the Arm to Leon Acknowledge Interrupt.
 */
void A2La_it_enable(void)
{
}

/** 
 * Enable the Leon to Arm Trigger Interrupt.
 */
void L2At_it_enable(void)
{
}

/** 
 * Disable the Arm to Leon Acknowledge Interrupt.
 */
void A2La_it_disable(void)
{
}

/** 
 * Disable the Leon to Arm Trigger Interrupt.
 */
void L2At_it_disable(void)
{
}

/** 
 * Check if Leon to Arm mailbox queue is empty.
 *
 * \return  0 if the queue is empty.
 */
int halmbx_L2Amail_not_empty_queue(void)
{
    return 0;
}

/** 
 * Check Arm to Leon mailbox queue status.
 *
 * \return  queue state.
 */
int halmbx_A2Lmail_status_queue(void)
{
    return 0;
}

/** 
 * Check Leon to Arm mailbox queue status.
 *
 * \return  queue state.
 */
int halmbx_L2Amail_status_queue(void)
{
    return 0;
}

/** 
 * Copy message to the ring buffer.
 *
 * \param  message  pointer to the message align on 32bits.
 * \param  size  message size in bytes and align on 32bits.
 * \return  error code.
 */
int halmbx_copy_to_ring (uint32_t *message, int size)
{
    return 0;
}

/** 
 * Copy message from the ring buffer.
 *
 * \param  message  pointer to the message align on 32bits.
 * \param  size  max message size in bytes and align on 32bits.
 * \return  error code.
 */
int halmbx_copy_from_ring (uint32_t *message, int size)
{
    return 0;
}

/** 
 * Update the ring management for Arm to Leon mailbox (TX).
 *
 * \param  size  real size in bytes of the last proceed message.
 * \return  error code.
 */
int halmbx_A2Lmail_update (int size)
{
    return 0;
}

/** 
 * Update the ring management for Leon to Arm mailbox (RX).
 *
 * \param  size  real size in bytes of the last proceed message.
 * \return  error code.
 */
int halmbx_L2Amail_update(int size)
{
    return 0;
}