amiro-os / modules / RT-STM32L476RG-NUCLEO64 / module.h @ f3b3fe09
History | View | Annotate | Download (6.723 KB)
1 |
/*
|
---|---|
2 |
AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
|
3 |
Copyright (C) 2016..2018 Thomas Schöpping et al.
|
4 |
|
5 |
This program is free software: you can redistribute it and/or modify
|
6 |
it under the terms of the GNU General Public License as published by
|
7 |
the Free Software Foundation, either version 3 of the License, or
|
8 |
(at your option) any later version.
|
9 |
|
10 |
This program is distributed in the hope that it will be useful,
|
11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
GNU General Public License for more details.
|
14 |
|
15 |
You should have received a copy of the GNU General Public License
|
16 |
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
17 |
*/
|
18 |
|
19 |
/**
|
20 |
* @file
|
21 |
* @brief Structures and constant for the PowerManagement module.
|
22 |
*
|
23 |
* @addtogroup powermanagement_module
|
24 |
* @{
|
25 |
*/
|
26 |
|
27 |
#ifndef _AMIROOS_MODULE_H_
|
28 |
#define _AMIROOS_MODULE_H_
|
29 |
|
30 |
/*===========================================================================*/
|
31 |
/**
|
32 |
* @name Module specific functions
|
33 |
* @{
|
34 |
*/
|
35 |
/*===========================================================================*/
|
36 |
|
37 |
/*
|
38 |
* @brief Makro to store data in the core coupled memory (ccm).
|
39 |
* Example:
|
40 |
* int compute_buffer[128] CCM_RAM;
|
41 |
*
|
42 |
* @note The ccm is not connected to any bus system.
|
43 |
*/
|
44 |
#define CCM_RAM __attribute__((section(".ram4"), aligned(4)))moduleHalCanConfig |
45 |
|
46 |
/*
|
47 |
* @brief Makro to store data in the ethernet memory (eth).
|
48 |
* Example:
|
49 |
* int dma_buffer[128] ETH_RAM;
|
50 |
*
|
51 |
* @note The eth is a dedicated memory block with its own DMA controller.
|
52 |
*/
|
53 |
#define ETH_RAM __attribute__((section(".ram2"), aligned(4))) |
54 |
|
55 |
/*
|
56 |
* @brief Makro to store data in the backup memory (bckp).
|
57 |
* Example:
|
58 |
* int backup_buffer[128] BCKP_RAM;
|
59 |
*
|
60 |
* @note The eth is a dedicated memory block with its own DMA controller.
|
61 |
*/
|
62 |
#define BCKP_RAM __attribute__((section(".ram5"), aligned(4))) |
63 |
|
64 |
/** @} */
|
65 |
|
66 |
/*===========================================================================*/
|
67 |
/**
|
68 |
* @name ChibiOS/HAL configuration
|
69 |
* @{
|
70 |
*/
|
71 |
/*===========================================================================*/
|
72 |
#include <hal.h> |
73 |
|
74 |
/**
|
75 |
* @brief CAN driver to use.
|
76 |
*/
|
77 |
#define MODULE_HAL_CAN CAND1
|
78 |
|
79 |
/**
|
80 |
* @brief Configuration for the CAN driver.
|
81 |
*/
|
82 |
extern CANConfig moduleHalCanConfig;
|
83 |
|
84 |
/**
|
85 |
* @brief Serial driver of the programmer interface.
|
86 |
*/
|
87 |
#define MODULE_HAL_PROGIF SD2
|
88 |
|
89 |
/**
|
90 |
* @brief Configuration for the programmer serial interface driver.
|
91 |
*/
|
92 |
extern SerialConfig moduleHalProgIfConfig;
|
93 |
|
94 |
/**
|
95 |
* @brief Real-Time Clock driver.
|
96 |
*/
|
97 |
#define MODULE_HAL_RTC RTCD1
|
98 |
|
99 |
/** @} */
|
100 |
|
101 |
/**
|
102 |
* @brief Periphery communication interfaces initialization hook.
|
103 |
*/
|
104 |
#define MODULE_INIT_PERIPHERY_COMM() { \
|
105 |
/* serial driver */ \
|
106 |
sdStart(&MODULE_HAL_PROGIF, &moduleHalProgIfConfig); \ |
107 |
} |
108 |
|
109 |
/*===========================================================================*/
|
110 |
/**
|
111 |
* @name GPIO definitions
|
112 |
* @{
|
113 |
*/
|
114 |
/*===========================================================================*/
|
115 |
#include <amiro-lld.h> |
116 |
|
117 |
/**
|
118 |
* @brief SYS_REG_EN output signal GPIO.
|
119 |
*/
|
120 |
extern ROMCONST apalControlGpio_t moduleGpioSysRegEn;
|
121 |
|
122 |
/**
|
123 |
* @brief IR_INT1 input signal GPIO.
|
124 |
*/
|
125 |
extern ROMCONST apalControlGpio_t moduleGpioIrInt1;
|
126 |
|
127 |
/**
|
128 |
* @brief POWER_EN output signal GPIO.
|
129 |
*/
|
130 |
extern ROMCONST apalControlGpio_t moduleGpioPowerEn;
|
131 |
|
132 |
/**
|
133 |
* @brief SYS_UART_DN bidirectional signal GPIO.
|
134 |
*/
|
135 |
extern ROMCONST apalControlGpio_t moduleGpioSysUartDn;
|
136 |
|
137 |
/**
|
138 |
* @brief LED output signal GPIO.
|
139 |
*/
|
140 |
extern ROMCONST apalControlGpio_t moduleGpioLed;
|
141 |
|
142 |
/**
|
143 |
* @brief SYS_UART_UP bidirectional signal GPIO.
|
144 |
*/
|
145 |
extern ROMCONST apalControlGpio_t moduleGpioSysUartUp;
|
146 |
|
147 |
/**
|
148 |
* @brief IR_INT2 input signal GPIO.
|
149 |
*/
|
150 |
extern ROMCONST apalControlGpio_t moduleGpioIrInt2;
|
151 |
|
152 |
/**
|
153 |
* @brief TOUCH_INT input signal GPIO.
|
154 |
*/
|
155 |
extern ROMCONST apalControlGpio_t moduleGpioTouchInt;
|
156 |
|
157 |
/**
|
158 |
* @brief SYS_DONE input signal GPIO.
|
159 |
*/
|
160 |
extern ROMCONST apalControlGpio_t moduleGpioSysDone;
|
161 |
|
162 |
/**
|
163 |
* @brief SYS_PROG output signal GPIO.
|
164 |
*/
|
165 |
extern ROMCONST apalControlGpio_t moduleGpioSysProg;
|
166 |
|
167 |
/**
|
168 |
* @brief PATH_DC input signal GPIO.
|
169 |
*/
|
170 |
extern ROMCONST apalControlGpio_t moduleGpioPathDc;
|
171 |
|
172 |
/**
|
173 |
* @brief SYS_SPI_DIR bidirectional signal GPIO.
|
174 |
*/
|
175 |
extern ROMCONST apalControlGpio_t moduleGpioSysSpiDir;
|
176 |
|
177 |
/**
|
178 |
* @brief SYS_SYNC bidirectional signal GPIO.
|
179 |
*/
|
180 |
extern ROMCONST apalControlGpio_t moduleGpioSysSync;
|
181 |
|
182 |
/**
|
183 |
* @brief SYS_PD bidirectional signal GPIO.
|
184 |
*/
|
185 |
extern ROMCONST apalControlGpio_t moduleGpioSysPd;
|
186 |
|
187 |
/**
|
188 |
* @brief SYS_WARMRST bidirectional signal GPIO.
|
189 |
*/
|
190 |
extern ROMCONST apalControlGpio_t moduleGpioSysWarmrst;
|
191 |
|
192 |
/**
|
193 |
* @brief BT_RST output signal GPIO.
|
194 |
*/
|
195 |
extern ROMCONST apalControlGpio_t moduleGpioBtRst;
|
196 |
|
197 |
|
198 |
/** @} */
|
199 |
|
200 |
/*===========================================================================*/
|
201 |
/**
|
202 |
* @name AMiRo-OS core configurations
|
203 |
* @{
|
204 |
*/
|
205 |
/*===========================================================================*/
|
206 |
|
207 |
/**
|
208 |
* @brief Event flag to be set on a IR_INT1 / CHARGE_STAT1A interrupt.
|
209 |
*/
|
210 |
#define MODULE_OS_IOEVENTFLAGS_IRINT1 ((eventflags_t)1 << GPIOB_IR_INT1_N) |
211 |
|
212 |
|
213 |
/**
|
214 |
* @brief Event flag to be set on a SYS_UART_DN interrupt.
|
215 |
*/
|
216 |
#define MODULE_OS_IOEVENTFLAGS_SYSUARTDN ((eventflags_t)1 << GPIOB_SYS_UART_DN) |
217 |
|
218 |
|
219 |
/**
|
220 |
* @brief Event flag to be set on a TOUCH_INT interrupt.
|
221 |
*/
|
222 |
#define MODULE_OS_IOEVENTFLAGS_TOUCHINT ((eventflags_t)1 << GPIOC_TOUCH_INT_N) |
223 |
|
224 |
|
225 |
/**
|
226 |
* @brief Event flag to be set on a PATH_DC interrupt.
|
227 |
*/
|
228 |
#define MODULE_OS_IOEVENTFLAGS_PATHDC ((eventflags_t)1 << GPIOC_PATH_DC) |
229 |
|
230 |
/**
|
231 |
* @brief Event flag to be set on a SYS_SPI_DIR interrupt.
|
232 |
*/
|
233 |
#define MODULE_OS_IOEVENTFLAGS_SYSSPIDIR ((eventflags_t)1 << GPIOC_SYS_SPI_DIR) |
234 |
|
235 |
/**
|
236 |
* @brief Event flag to be set on a SYS_SYNC interrupt.
|
237 |
*/
|
238 |
#define MODULE_OS_IOEVENTFLAGS_SYSSYNC ((eventflags_t)1 << GPIOC_SYS_INT_N) |
239 |
|
240 |
/**
|
241 |
* @brief Event flag to be set on a SYS_PD interrupt.
|
242 |
*/
|
243 |
#define MODULE_OS_IOEVENTFLAGS_SYSPD ((eventflags_t)1 << GPIOC_SYS_PD_N) |
244 |
|
245 |
/**
|
246 |
* @brief Event flag to be set on a SYS_WARMRST interrupt.
|
247 |
*/
|
248 |
#define MODULE_OS_IOEVENTFLAGS_SYSWARMRST ((eventflags_t)1 << GPIOC_SYS_WARMRST_N) |
249 |
|
250 |
/**
|
251 |
* @brief Event flag to be set on a SYS_UART_UP interrupt.
|
252 |
*/
|
253 |
#define MODULE_OS_IOEVENTFLAGS_SYSUARTUP ((eventflags_t)1 << GPIOB_SYS_UART_UP) |
254 |
|
255 |
#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__) |
256 |
/**
|
257 |
* @brief Shell prompt text.
|
258 |
*/
|
259 |
extern ROMCONST char* moduleShellPrompt; |
260 |
#endif
|
261 |
|
262 |
#endif /* _AMIROOS_MODULE_H_ */ |
263 |
|
264 |
/** @} */
|