Revision 1e5f7648

View differences:

modules/DiWheelDrive_1-1/alldconf.h
27 27
#define AMIRO_LLD_CFG_VERSION_MINOR         0
28 28

  
29 29
/**
30
 * @brief   Width of the apalTime_t data type.
31
 *
32
 * @details Possible values are 8, 16, 32, and 64 bits.
33
 *          By definition time is represented ot a microsecond precision.
34
 */
35
#define AMIROLLD_CFG_TIME_SIZE          32
36

  
37
/**
30 38
 * @brief   Enable flag for the A3906 motor driver.
31 39
 */
32 40
#define AMIROLLD_CFG_USE_A3906
modules/DiWheelDrive_1-1/chconf.h
32 32
#define _CHIBIOS_RT_CONF_
33 33
#define _CHIBIOS_RT_CONF_VER_5_1_
34 34

  
35
#include <aosconf.h>
36

  
35 37
/*===========================================================================*/
36 38
/**
37 39
 * @name System timers settings
......
47 49
#define CH_CFG_ST_RESOLUTION                16
48 50
#endif
49 51

  
50
/**
51
 * @brief   System tick frequency.
52
 * @details Frequency of the system timer that drives the system ticks. This
53
 *          setting also defines the system tick time unit.
54
 */
55
#if !defined(CH_CFG_ST_FREQUENCY)
56
#define CH_CFG_ST_FREQUENCY                 1000000UL
57
#endif
58

  
59
/**
60
 * @brief   Time intervals data size.
61
 * @note    Allowed values are 16, 32 or 64 bits.
62
 */
63
#if !defined(CH_CFG_INTERVALS_SIZE)
64
#define CH_CFG_INTERVALS_SIZE               64
65
#endif
66

  
67
/**
68
 * @brief   Time types data size.
69
 * @note    Allowed values are 16 or 32 bits.
70
 */
71
#if !defined(CH_CFG_TIME_TYPES_SIZE)
72
#define CH_CFG_TIME_TYPES_SIZE              32
73
#endif
74

  
75
/**
76
 * @brief   Time delta constant for the tick-less mode.
77
 * @note    If this value is zero then the system uses the classic
78
 *          periodic tick. This value represents the minimum number
79
 *          of ticks that is safe to specify in a timeout directive.
80
 *          The value one is not valid, timeouts are rounded up to
81
 *          this value.
82
 */
83
#if !defined(CH_CFG_ST_TIMEDELTA)
84
#define CH_CFG_ST_TIMEDELTA                 10
85
#endif
52
// more common definition in aos_chconf.h
86 53

  
87 54
/** @} */
88 55

  
......
93 60
 */
94 61
/*===========================================================================*/
95 62

  
96
/**
97
 * @brief   Round robin interval.
98
 * @details This constant is the number of system ticks allowed for the
99
 *          threads before preemption occurs. Setting this value to zero
100
 *          disables the preemption for threads with equal priority and the
101
 *          round robin becomes cooperative. Note that higher priority
102
 *          threads can still preempt, the kernel is always preemptive.
103
 * @note    Disabling the round robin preemption makes the kernel more compact
104
 *          and generally faster.
105
 * @note    The round robin preemption is not supported in tickless mode and
106
 *          must be set to zero in that case.
107
 */
108
#if !defined(CH_CFG_TIME_QUANTUM)
109
#define CH_CFG_TIME_QUANTUM                 0
110
#endif
111

  
112
/**
113
 * @brief   Managed RAM size.
114
 * @details Size of the RAM area to be managed by the OS. If set to zero
115
 *          then the whole available RAM is used. The core memory is made
116
 *          available to the heap allocator and/or can be used directly through
117
 *          the simplified core memory allocator.
118
 *
119
 * @note    In order to let the OS manage the whole RAM the linker script must
120
 *          provide the @p __heap_base__ and @p __heap_end__ symbols.
121
 * @note    Requires @p CH_CFG_USE_MEMCORE.
122
 */
123
#if !defined(CH_CFG_MEMCORE_SIZE)
124
#define CH_CFG_MEMCORE_SIZE                 0
125
#endif
126

  
127
/**
128
 * @brief   Idle thread automatic spawn suppression.
129
 * @details When this option is activated the function @p chSysInit()
130
 *          does not spawn the idle thread. The application @p main()
131
 *          function becomes the idle thread and must implement an
132
 *          infinite loop.
133
 */
134
#if !defined(CH_CFG_NO_IDLE_THREAD)
135
#define CH_CFG_NO_IDLE_THREAD               FALSE
136
#endif
63
// common definitions in aos_chconf.h
137 64

  
138 65
/** @} */
139 66

  
......
144 71
 */
145 72
/*===========================================================================*/
146 73

  
147
/**
148
 * @brief   OS optimization.
149
 * @details If enabled then time efficient rather than space efficient code
150
 *          is used when two possible implementations exist.
151
 *
152
 * @note    This is not related to the compiler optimization options.
153
 * @note    The default is @p TRUE.
154
 */
155
#if !defined(CH_CFG_OPTIMIZE_SPEED)
156
#define CH_CFG_OPTIMIZE_SPEED               TRUE
157
#endif
74
// common definitions in aos_chconf.h
158 75

  
159 76
/** @} */
160 77

  
......
165 82
 */
166 83
/*===========================================================================*/
167 84

  
168
/**
169
 * @brief   Time Measurement APIs.
170
 * @details If enabled then the time measurement APIs are included in
171
 *          the kernel.
172
 *
173
 * @note    The default is @p TRUE.
174
 */
175
#if !defined(CH_CFG_USE_TM)
176
#define CH_CFG_USE_TM                       FALSE
177
#endif
178

  
179
/**
180
 * @brief   Threads registry APIs.
181
 * @details If enabled then the registry APIs are included in the kernel.
182
 *
183
 * @note    The default is @p TRUE.
184
 */
185
#if !defined(CH_CFG_USE_REGISTRY)
186
#define CH_CFG_USE_REGISTRY                 FALSE
187
#endif
188

  
189
/**
190
 * @brief   Threads synchronization APIs.
191
 * @details If enabled then the @p chThdWait() function is included in
192
 *          the kernel.
193
 *
194
 * @note    The default is @p TRUE.
195
 */
196
#if !defined(CH_CFG_USE_WAITEXIT)
197
#define CH_CFG_USE_WAITEXIT                 TRUE
198
#endif
199

  
200
/**
201
 * @brief   Semaphores APIs.
202
 * @details If enabled then the Semaphores APIs are included in the kernel.
203
 *
204
 * @note    The default is @p TRUE.
205
 */
206
#if !defined(CH_CFG_USE_SEMAPHORES)
207
#define CH_CFG_USE_SEMAPHORES               FALSE
208
#endif
209

  
210
/**
211
 * @brief   Semaphores queuing mode.
212
 * @details If enabled then the threads are enqueued on semaphores by
213
 *          priority rather than in FIFO order.
214
 *
215
 * @note    The default is @p FALSE. Enable this if you have special
216
 *          requirements.
217
 * @note    Requires @p CH_CFG_USE_SEMAPHORES.
218
 */
219
#if !defined(CH_CFG_USE_SEMAPHORES_PRIORITY)
220
#define CH_CFG_USE_SEMAPHORES_PRIORITY      FALSE
221
#endif
222

  
223
/**
224
 * @brief   Mutexes APIs.
225
 * @details If enabled then the mutexes APIs are included in the kernel.
226
 *
227
 * @note    The default is @p TRUE.
228
 */
229
#if !defined(CH_CFG_USE_MUTEXES)
230
#define CH_CFG_USE_MUTEXES                  TRUE
231
#endif
232

  
233
/**
234
 * @brief   Enables recursive behavior on mutexes.
235
 * @note    Recursive mutexes are heavier and have an increased
236
 *          memory footprint.
237
 *
238
 * @note    The default is @p FALSE.
239
 * @note    Requires @p CH_CFG_USE_MUTEXES.
240
 */
241
#if !defined(CH_CFG_USE_MUTEXES_RECURSIVE)
242
#define CH_CFG_USE_MUTEXES_RECURSIVE        FALSE
243
#endif
244

  
245
/**
246
 * @brief   Conditional Variables APIs.
247
 * @details If enabled then the conditional variables APIs are included
248
 *          in the kernel.
249
 *
250
 * @note    The default is @p TRUE.
251
 * @note    Requires @p CH_CFG_USE_MUTEXES.
252
 */
253
#if !defined(CH_CFG_USE_CONDVARS)
254
#define CH_CFG_USE_CONDVARS                 FALSE
255
#endif
256

  
257
/**
258
 * @brief   Conditional Variables APIs with timeout.
259
 * @details If enabled then the conditional variables APIs with timeout
260
 *          specification are included in the kernel.
261
 *
262
 * @note    The default is @p TRUE.
263
 * @note    Requires @p CH_CFG_USE_CONDVARS.
264
 */
265
#if !defined(CH_CFG_USE_CONDVARS_TIMEOUT)
266
#define CH_CFG_USE_CONDVARS_TIMEOUT         FALSE
267
#endif
268

  
269
/**
270
 * @brief   Events Flags APIs.
271
 * @details If enabled then the event flags APIs are included in the kernel.
272
 *
273
 * @note    The default is @p TRUE.
274
 */
275
#if !defined(CH_CFG_USE_EVENTS)
276
#define CH_CFG_USE_EVENTS                   TRUE
277
#endif
278

  
279
/**
280
 * @brief   Events Flags APIs with timeout.
281
 * @details If enabled then the events APIs with timeout specification
282
 *          are included in the kernel.
283
 *
284
 * @note    The default is @p TRUE.
285
 * @note    Requires @p CH_CFG_USE_EVENTS.
286
 */
287
#if !defined(CH_CFG_USE_EVENTS_TIMEOUT)
288
#define CH_CFG_USE_EVENTS_TIMEOUT           TRUE
289
#endif
290

  
291
/**
292
 * @brief   Synchronous Messages APIs.
293
 * @details If enabled then the synchronous messages APIs are included
294
 *          in the kernel.
295
 *
296
 * @note    The default is @p TRUE.
297
 */
298
#if !defined(CH_CFG_USE_MESSAGES)
299
#define CH_CFG_USE_MESSAGES                 FALSE
300
#endif
301

  
302
/**
303
 * @brief   Synchronous Messages queuing mode.
304
 * @details If enabled then messages are served by priority rather than in
305
 *          FIFO order.
306
 *
307
 * @note    The default is @p FALSE. Enable this if you have special
308
 *          requirements.
309
 * @note    Requires @p CH_CFG_USE_MESSAGES.
310
 */
311
#if !defined(CH_CFG_USE_MESSAGES_PRIORITY)
312
#define CH_CFG_USE_MESSAGES_PRIORITY        FALSE
313
#endif
314

  
315
/**
316
 * @brief   Mailboxes APIs.
317
 * @details If enabled then the asynchronous messages (mailboxes) APIs are
318
 *          included in the kernel.
319
 *
320
 * @note    The default is @p TRUE.
321
 * @note    Requires @p CH_CFG_USE_SEMAPHORES.
322
 */
323
#if !defined(CH_CFG_USE_MAILBOXES)
324
#define CH_CFG_USE_MAILBOXES                FALSE
325
#endif
326

  
327
/**
328
 * @brief   Core Memory Manager APIs.
329
 * @details If enabled then the core memory manager APIs are included
330
 *          in the kernel.
331
 *
332
 * @note    The default is @p TRUE.
333
 */
334
#if !defined(CH_CFG_USE_MEMCORE)
335
#define CH_CFG_USE_MEMCORE                  FALSE
336
#endif
337

  
338
/**
339
 * @brief   Heap Allocator APIs.
340
 * @details If enabled then the memory heap allocator APIs are included
341
 *          in the kernel.
342
 *
343
 * @note    The default is @p TRUE.
344
 * @note    Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
345
 *          @p CH_CFG_USE_SEMAPHORES.
346
 * @note    Mutexes are recommended.
347
 */
348
#if !defined(CH_CFG_USE_HEAP)
349
#define CH_CFG_USE_HEAP                     FALSE
350
#endif
351

  
352
/**
353
 * @brief   Memory Pools Allocator APIs.
354
 * @details If enabled then the memory pools allocator APIs are included
355
 *          in the kernel.
356
 *
357
 * @note    The default is @p TRUE.
358
 */
359
#if !defined(CH_CFG_USE_MEMPOOLS)
360
#define CH_CFG_USE_MEMPOOLS                 FALSE
361
#endif
362

  
363
/**
364
 * @brief  Objects FIFOs APIs.
365
 * @details If enabled then the objects FIFOs APIs are included
366
 *          in the kernel.
367
 *
368
 * @note    The default is @p TRUE.
369
 */
370
#if !defined(CH_CFG_USE_OBJ_FIFOS)
371
#define CH_CFG_USE_OBJ_FIFOS                FALSE
372
#endif
373

  
374
/**
375
 * @brief   Dynamic Threads APIs.
376
 * @details If enabled then the dynamic threads creation APIs are included
377
 *          in the kernel.
378
 *
379
 * @note    The default is @p TRUE.
380
 * @note    Requires @p CH_CFG_USE_WAITEXIT.
381
 * @note    Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
382
 */
383
#if !defined(CH_CFG_USE_DYNAMIC)
384
#define CH_CFG_USE_DYNAMIC                  FALSE
385
#endif
85
// common definitions in aos_chconf.h
386 86

  
387 87
/** @} */
388 88

  
......
393 93
 */
394 94
/*===========================================================================*/
395 95

  
396
/**
397
 * @brief   Objects Factory APIs.
398
 * @details If enabled then the objects factory APIs are included in the
399
 *          kernel.
400
 *
401
 * @note    The default is @p FALSE.
402
 */
403
#if !defined(CH_CFG_USE_FACTORY)
404
#define CH_CFG_USE_FACTORY                  FALSE
405
#endif
406

  
407
/**
408
 * @brief   Maximum length for object names.
409
 * @details If the specified length is zero then the name is stored by
410
 *          pointer but this could have unintended side effects.
411
 */
412
#if !defined(CH_CFG_FACTORY_MAX_NAMES_LENGTH)
413
#define CH_CFG_FACTORY_MAX_NAMES_LENGTH     8
414
#endif
415

  
416
/**
417
 * @brief   Enables the registry of generic objects.
418
 */
419
#if !defined(CH_CFG_FACTORY_OBJECTS_REGISTRY)
420
#define CH_CFG_FACTORY_OBJECTS_REGISTRY     TRUE
421
#endif
422

  
423
/**
424
 * @brief   Enables factory for generic buffers.
425
 */
426
#if !defined(CH_CFG_FACTORY_GENERIC_BUFFERS)
427
#define CH_CFG_FACTORY_GENERIC_BUFFERS      TRUE
428
#endif
429

  
430
/**
431
 * @brief   Enables factory for semaphores.
432
 */
433
#if !defined(CH_CFG_FACTORY_SEMAPHORES)
434
#define CH_CFG_FACTORY_SEMAPHORES           TRUE
435
#endif
436

  
437
/**
438
 * @brief   Enables factory for mailboxes.
439
 */
440
#if !defined(CH_CFG_FACTORY_MAILBOXES)
441
#define CH_CFG_FACTORY_MAILBOXES            TRUE
442
#endif
443

  
444
/**
445
 * @brief   Enables factory for objects FIFOs.
446
 */
447
#if !defined(CH_CFG_FACTORY_OBJ_FIFOS)
448
#define CH_CFG_FACTORY_OBJ_FIFOS            TRUE
449
#endif
96
// common definitions in aos_chconf.h
450 97

  
451 98
/** @} */
452 99

  
......
457 104
 */
458 105
/*===========================================================================*/
459 106

  
460
/**
461
 * @brief   Debug option, kernel statistics.
462
 *
463
 * @note    The default is @p FALSE.
464
 */
465
#if !defined(CH_DBG_STATISTICS)
466
#define CH_DBG_STATISTICS                   FALSE
467
#endif
468

  
469
/**
470
 * @brief   Debug option, system state check.
471
 * @details If enabled the correct call protocol for system APIs is checked
472
 *          at runtime.
473
 *
474
 * @note    The default is @p FALSE.
475
 */
476
#if !defined(CH_DBG_SYSTEM_STATE_CHECK)
477
#define CH_DBG_SYSTEM_STATE_CHECK           FALSE
478
#endif
479

  
480
/**
481
 * @brief   Debug option, parameters checks.
482
 * @details If enabled then the checks on the API functions input
483
 *          parameters are activated.
484
 *
485
 * @note    The default is @p FALSE.
486
 */
487
#if !defined(CH_DBG_ENABLE_CHECKS)
488
#define CH_DBG_ENABLE_CHECKS                FALSE
489
#endif
490

  
491
/**
492
 * @brief   Debug option, consistency checks.
493
 * @details If enabled then all the assertions in the kernel code are
494
 *          activated. This includes consistency checks inside the kernel,
495
 *          runtime anomalies and port-defined checks.
496
 *
497
 * @note    The default is @p FALSE.
498
 */
499
#if !defined(CH_DBG_ENABLE_ASSERTS)
500
#define CH_DBG_ENABLE_ASSERTS               TRUE
501
#endif
502

  
503
/**
504
 * @brief   Debug option, trace buffer.
505
 * @details If enabled then the trace buffer is activated.
506
 *
507
 * @note    The default is @p CH_DBG_TRACE_MASK_DISABLED.
508
 */
509
#if !defined(CH_DBG_TRACE_MASK)
510
#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_DISABLED
511
#endif
512

  
513
/**
514
 * @brief   Trace buffer entries.
515
 * @note    The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
516
 *          different from @p CH_DBG_TRACE_MASK_DISABLED.
517
 */
518
#if !defined(CH_DBG_TRACE_BUFFER_SIZE)
519
#define CH_DBG_TRACE_BUFFER_SIZE            128
520
#endif
521

  
522
/**
523
 * @brief   Debug option, stack checks.
524
 * @details If enabled then a runtime stack check is performed.
525
 *
526
 * @note    The default is @p FALSE.
527
 * @note    The stack check is performed in a architecture/port dependent way.
528
 *          It may not be implemented or some ports.
529
 * @note    The default failure mode is to halt the system with the global
530
 *          @p panic_msg variable set to @p NULL.
531
 */
532
#if !defined(CH_DBG_ENABLE_STACK_CHECK)
533
#define CH_DBG_ENABLE_STACK_CHECK           TRUE
534
#endif
535

  
536
/**
537
 * @brief   Debug option, stacks initialization.
538
 * @details If enabled then the threads working area is filled with a byte
539
 *          value when a thread is created. This can be useful for the
540
 *          runtime measurement of the used stack.
541
 *
542
 * @note    The default is @p FALSE.
543
 */
544
#if !defined(CH_DBG_FILL_THREADS)
545
#define CH_DBG_FILL_THREADS                 TRUE
546
#endif
547

  
548
/**
549
 * @brief   Debug option, threads profiling.
550
 * @details If enabled then a field is added to the @p thread_t structure that
551
 *          counts the system ticks occurred while executing the thread.
552
 *
553
 * @note    The default is @p FALSE.
554
 * @note    This debug option is not currently compatible with the
555
 *          tickless mode.
556
 */
557
#if !defined(CH_DBG_THREADS_PROFILING)
558
#define CH_DBG_THREADS_PROFILING            FALSE
559
#endif
107
// common definitions in aos_chconf.h
560 108

  
561 109
/** @} */
562 110

  
......
567 115
 */
568 116
/*===========================================================================*/
569 117

  
570
/**
571
 * @brief   System structure extension.
572
 * @details User fields added to the end of the @p ch_system_t structure.
573
 */
574
#define CH_CFG_SYSTEM_EXTRA_FIELDS                                          \
575
  /* Add threads custom fields here.*/
118
// common definitions in aos_chconf.h
576 119

  
577
/**
578
 * @brief   System initialization hook.
579
 * @details User initialization code added to the @p chSysInit() function
580
 *          just before interrupts are enabled globally.
581
 */
582
#define CH_CFG_SYSTEM_INIT_HOOK(tp) {                                       \
583
  /* Add threads initialization code here.*/                                \
584
}
585

  
586
/**
587
 * @brief   Threads descriptor structure extension.
588
 * @details User fields added to the end of the @p thread_t structure.
589
 */
590
#define CH_CFG_THREAD_EXTRA_FIELDS                                          \
591
  /* Add threads custom fields here.*/
592

  
593
/**
594
 * @brief   Threads initialization hook.
595
 * @details User initialization code added to the @p _thread_init() function.
596
 *
597
 * @note    It is invoked from within @p _thread_init() and implicitly from all
598
 *          the threads creation APIs.
599
 */
600
#define CH_CFG_THREAD_INIT_HOOK(tp) {                                       \
601
  /* Add threads initialization code here.*/                                \
602
}
603

  
604
/**
605
 * @brief   Threads finalization hook.
606
 * @details User finalization code added to the @p chThdExit() API.
607
 */
608
#define CH_CFG_THREAD_EXIT_HOOK(tp) {                                       \
609
  /* Add threads finalization code here.*/                                  \
610
}
611

  
612
/**
613
 * @brief   Context switch hook.
614
 * @details This hook is invoked just before switching between threads.
615
 */
616
#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) {                              \
617
  /* Context switch code here.*/                                            \
618
}
619

  
620
/**
621
 * @brief   ISR enter hook.
622
 */
623
#define CH_CFG_IRQ_PROLOGUE_HOOK() {                                        \
624
  /* IRQ prologue code here.*/                                              \
625
}
626

  
627
/**
628
 * @brief   ISR exit hook.
629
 */
630
#define CH_CFG_IRQ_EPILOGUE_HOOK() {                                        \
631
  /* IRQ epilogue code here.*/                                              \
632
}
633

  
634
/**
635
 * @brief   Idle thread enter hook.
636
 * @note    This hook is invoked within a critical zone, no OS functions
637
 *          should be invoked from here.
638
 * @note    This macro can be used to activate a power saving mode.
639
 */
640
#define CH_CFG_IDLE_ENTER_HOOK() {                                          \
641
  /* Idle-enter code here.*/                                                \
642
}
120
/** @} */
643 121

  
122
/*===========================================================================*/
644 123
/**
645
 * @brief   Idle thread leave hook.
646
 * @note    This hook is invoked within a critical zone, no OS functions
647
 *          should be invoked from here.
648
 * @note    This macro can be used to deactivate a power saving mode.
124
 * @name Port-specific settings (override port settings defaulted in chcore.h).
125
 * @{
649 126
 */
650
#define CH_CFG_IDLE_LEAVE_HOOK() {                                          \
651
  /* Idle-leave code here.*/                                                \
652
}
127
/*===========================================================================*/
653 128

  
654 129
/**
655
 * @brief   Idle Loop hook.
656
 * @details This hook is continuously invoked by the idle thread loop.
130
 * @brief   NVIC VTOR initialization offset.
131
 * @details On initialization, the code at this address in the flash memory will be executed.
657 132
 */
658
#define CH_CFG_IDLE_LOOP_HOOK() {                                           \
659
  /* Idle loop code here.*/                                                 \
660
}
133
#define CORTEX_VTOR_INIT 0x00006000U
661 134

  
662
/**
663
 * @brief   System tick event hook.
664
 * @details This hook is invoked in the system tick handler immediately
665
 *          after processing the virtual timers queue.
666
 */
667
#define CH_CFG_SYSTEM_TICK_HOOK() {                                         \
668
  /* System tick event code here.*/                                         \
669
}
135
/** @} */
670 136

  
137
/*===========================================================================*/
671 138
/**
672
 * @brief   System halt hook.
673
 * @details This hook is invoked in case to a system halting error before
674
 *          the system is halted.
139
 * @name other
140
 * @{
675 141
 */
676
#define CH_CFG_SYSTEM_HALT_HOOK(reason) {                                   \
677
  /* System halt code here.*/                                               \
678
}
142
/*===========================================================================*/
679 143

  
680
/**
681
 * @brief   Trace hook.
682
 * @details This hook is invoked each time a new record is written in the
683
 *          trace buffer.
684
 */
685
#define CH_CFG_TRACE_HOOK(tep) {                                            \
686
  /* Trace code here.*/                                                     \
687
}
144
// common definitions in aos_chconf.h
688 145

  
689 146
/** @} */
690 147

  
691
/*===========================================================================*/
692
/* Port-specific settings (override port settings defaulted in chcore.h).    */
693
/*===========================================================================*/
148
#include <aos_chconf.h>
694 149

  
695 150
#endif  /* CHCONF_H */
696 151

  
modules/DiWheelDrive_1-1/halconf.h
1 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    os/modules/DiWheelDrive/chconf.h
21
 * @brief   ChibiOS Configuration file for the DiWheelDrive v1.1 module.
22
 * @details Contains the application specific kernel settings.
23
 *
24
 * @addtogroup config
25
 * @details Kernel related settings and hooks.
26
 * @{
27
 */
28
/*
29 2
AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
30 3
Copyright (C) 2016..2018  Thomas Schöpping et al.
31 4

  
......
57 30
#ifndef _HALCONF_H_
58 31
#define _HALCONF_H_
59 32

  
33
#define _CHIBIOS_HAL_CONF_
34
#define _CHIBIOS_HAL_CONF_VER_6_0_
35

  
36
#include "mcuconf.h"
37

  
60 38
/**
61 39
 * @brief   Enables the PAL subsystem.
62 40
 */
63 41
#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
64
#define HAL_USE_PAL                 TRUE
42
#define HAL_USE_PAL                         TRUE
65 43
#endif
66 44

  
67 45
/**
68 46
 * @brief   Enables the ADC subsystem.
69 47
 */
70 48
#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
71
#define HAL_USE_ADC                 FALSE
49
#define HAL_USE_ADC                         FALSE
72 50
#endif
73 51

  
74 52
/**
75 53
 * @brief   Enables the CAN subsystem.
76 54
 */
77 55
#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
78
#define HAL_USE_CAN                 TRUE
56
#define HAL_USE_CAN                         TRUE
57
#endif
58

  
59
/**
60
 * @brief   Enables the cryptographic subsystem.
61
 */
62
#if !defined(HAL_USE_CRY) || defined(__DOXYGEN__)
63
#define HAL_USE_CRY                         FALSE
79 64
#endif
80 65

  
81 66
/**
82 67
 * @brief   Enables the DAC subsystem.
83 68
 */
84 69
#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
85
#define HAL_USE_DAC                 FALSE
70
#define HAL_USE_DAC                         FALSE
86 71
#endif
87 72

  
88 73
/**
89 74
 * @brief   Enables the EXT subsystem.
90 75
 */
91 76
#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__)
92
#define HAL_USE_EXT                 FALSE
77
#define HAL_USE_EXT                         FALSE
93 78
#endif
94 79

  
95 80
/**
96 81
 * @brief   Enables the GPT subsystem.
97 82
 */
98 83
#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
99
#define HAL_USE_GPT                 FALSE
84
#define HAL_USE_GPT                         FALSE
100 85
#endif
101 86

  
102 87
/**
103 88
 * @brief   Enables the I2C subsystem.
104 89
 */
105 90
#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
106
#define HAL_USE_I2C                 TRUE
91
#define HAL_USE_I2C                         TRUE
107 92
#endif
108 93

  
109 94
/**
110 95
 * @brief   Enables the I2S subsystem.
111 96
 */
112 97
#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)
113
#define HAL_USE_I2S                 FALSE
98
#define HAL_USE_I2S                         FALSE
114 99
#endif
115 100

  
116 101
/**
117 102
 * @brief   Enables the ICU subsystem.
118 103
 */
119 104
#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
120
#define HAL_USE_ICU                 FALSE
105
#define HAL_USE_ICU                         FALSE
121 106
#endif
122 107

  
123 108
/**
124 109
 * @brief   Enables the MAC subsystem.
125 110
 */
126 111
#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)
127
#define HAL_USE_MAC                 FALSE
112
#define HAL_USE_MAC                         FALSE
128 113
#endif
129 114

  
130 115
/**
131 116
 * @brief   Enables the MMC_SPI subsystem.
132 117
 */
133 118
#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)
134
#define HAL_USE_MMC_SPI             FALSE
119
#define HAL_USE_MMC_SPI                     FALSE
135 120
#endif
136 121

  
137 122
/**
138 123
 * @brief   Enables the PWM subsystem.
139 124
 */
140 125
#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
141
#define HAL_USE_PWM                 TRUE
126
#define HAL_USE_PWM                         TRUE
127
#endif
128

  
129
/**
130
 * @brief   Enables the QSPI subsystem.
131
 */
132
#if !defined(HAL_USE_QSPI) || defined(__DOXYGEN__)
133
#define HAL_USE_QSPI                        FALSE
142 134
#endif
143 135

  
144 136
/**
145 137
 * @brief   Enables the RTC subsystem.
146 138
 */
147 139
#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
148
#define HAL_USE_RTC                 TRUE
140
#define HAL_USE_RTC                         TRUE
149 141
#endif
150 142

  
151 143
/**
152 144
 * @brief   Enables the SDC subsystem.
153 145
 */
154 146
#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)
155
#define HAL_USE_SDC                 FALSE
147
#define HAL_USE_SDC                         FALSE
156 148
#endif
157 149

  
158 150
/**
159 151
 * @brief   Enables the SERIAL subsystem.
160 152
 */
161 153
#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
162
#define HAL_USE_SERIAL              TRUE
154
#define HAL_USE_SERIAL                      TRUE
163 155
#endif
164 156

  
165 157
/**
166 158
 * @brief   Enables the SERIAL over USB subsystem.
167 159
 */
168 160
#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
169
#define HAL_USE_SERIAL_USB          FALSE
161
#define HAL_USE_SERIAL_USB                  FALSE
170 162
#endif
171 163

  
172 164
/**
173 165
 * @brief   Enables the SPI subsystem.
174 166
 */
175 167
#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
176
#define HAL_USE_SPI                 TRUE
168
#define HAL_USE_SPI                         TRUE
177 169
#endif
178 170

  
179 171
/**
180 172
 * @brief   Enables the UART subsystem.
181 173
 */
182 174
#if !defined(HAL_USE_UART) || defined(__DOXYGEN__)
183
#define HAL_USE_UART                FALSE
175
#define HAL_USE_UART                        FALSE
184 176
#endif
185 177

  
186 178
/**
187 179
 * @brief   Enables the USB subsystem.
188 180
 */
189 181
#if !defined(HAL_USE_USB) || defined(__DOXYGEN__)
190
#define HAL_USE_USB                 FALSE
182
#define HAL_USE_USB                         FALSE
191 183
#endif
192 184

  
193 185
/**
194 186
 * @brief   Enables the WDG subsystem.
195 187
 */
196 188
#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)
197
#define HAL_USE_WDG                 FALSE
189
#define HAL_USE_WDG                         FALSE
198 190
#endif
199 191

  
200 192
/**
201 193
 * @brief   Enables the QEI subsystem.
202 194
 */
203 195
#if !defined(HAL_USE_QEI) || defined(__DOXYGEN__)
204
#define HAL_USE_QEI                 TRUE
196
#define HAL_USE_QEI                         TRUE
197
#endif
198

  
199
/*===========================================================================*/
200
/* PAL driver related settings.                                              */
201
/*===========================================================================*/
202

  
203
/**
204
 * @brief   Enables synchronous APIs.
205
 * @note    Disabling this option saves both code and data space.
206
 */
207
#if !defined(PAL_USE_CALLBACKS) || defined(__DOXYGEN__)
208
#define PAL_USE_CALLBACKS                   TRUE
209
#endif
210

  
211
/**
212
 * @brief   Enables synchronous APIs.
213
 * @note    Disabling this option saves both code and data space.
214
 */
215
#if !defined(PAL_USE_WAIT) || defined(__DOXYGEN__)
216
#define PAL_USE_WAIT                        FALSE
205 217
#endif
206 218

  
207 219
/*===========================================================================*/
......
213 225
 * @note    Disabling this option saves both code and data space.
214 226
 */
215 227
#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__)
216
#define ADC_USE_WAIT                FALSE
228
#define ADC_USE_WAIT                        FALSE
217 229
#endif
218 230

  
219 231
/**
......
221 233
 * @note    Disabling this option saves both code and data space.
222 234
 */
223 235
#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
224
#define ADC_USE_MUTUAL_EXCLUSION    FALSE
236
#define ADC_USE_MUTUAL_EXCLUSION            FALSE
225 237
#endif
226 238

  
227 239
/*===========================================================================*/
......
232 244
 * @brief   Sleep mode related APIs inclusion switch.
233 245
 */
234 246
#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
235
#define CAN_USE_SLEEP_MODE          FALSE
247
#define CAN_USE_SLEEP_MODE                  FALSE
248
#endif
249

  
250
/**
251
 * @brief   Enforces the driver to use direct callbacks rather than OSAL events.
252
 */
253
#if !defined(CAN_ENFORCE_USE_CALLBACKS) || defined(__DOXYGEN__)
254
#define CAN_ENFORCE_USE_CALLBACKS           FALSE
255
#endif
256

  
257
/*===========================================================================*/
258
/* CRY driver related settings.                                              */
259
/*===========================================================================*/
260

  
261
/**
262
 * @brief   Enables the SW fall-back of the cryptographic driver.
263
 * @details When enabled, this option, activates a fall-back software
264
 *          implementation for algorithms not supported by the underlying
265
 *          hardware.
266
 * @note    Fall-back implementations may not be present for all algorithms.
267
 */
268
#if !defined(HAL_CRY_USE_FALLBACK) || defined(__DOXYGEN__)
269
#define HAL_CRY_USE_FALLBACK                FALSE
270
#endif
271

  
272
/**
273
 * @brief   Makes the driver forcibly use the fall-back implementations.
274
 */
275
#if !defined(HAL_CRY_ENFORCE_FALLBACK) || defined(__DOXYGEN__)
276
#define HAL_CRY_ENFORCE_FALLBACK            FALSE
277
#endif
278

  
279
/*===========================================================================*/
280
/* DAC driver related settings.                                              */
281
/*===========================================================================*/
282

  
283
/**
284
 * @brief   Enables synchronous APIs.
285
 * @note    Disabling this option saves both code and data space.
286
 */
287
#if !defined(DAC_USE_WAIT) || defined(__DOXYGEN__)
288
#define DAC_USE_WAIT                        TRUE
289
#endif
290

  
291
/**
292
 * @brief   Enables the @p dacAcquireBus() and @p dacReleaseBus() APIs.
293
 * @note    Disabling this option saves both code and data space.
294
 */
295
#if !defined(DAC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
296
#define DAC_USE_MUTUAL_EXCLUSION            TRUE
236 297
#endif
237 298

  
238 299
/*===========================================================================*/
......
243 304
 * @brief   Enables the mutual exclusion APIs on the I2C bus.
244 305
 */
245 306
#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
246
#define I2C_USE_MUTUAL_EXCLUSION    TRUE
307
#define I2C_USE_MUTUAL_EXCLUSION            TRUE
247 308
#endif
248 309

  
249 310
/*===========================================================================*/
......
251 312
/*===========================================================================*/
252 313

  
253 314
/**
254
 * @brief   Enables an event sources for incoming packets.
315
 * @brief   Enables the zero-copy API.
255 316
 */
256 317
#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__)
257
#define MAC_USE_ZERO_COPY           FALSE
318
#define MAC_USE_ZERO_COPY                   FALSE
258 319
#endif
259 320

  
260 321
/**
261 322
 * @brief   Enables an event sources for incoming packets.
262 323
 */
263 324
#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__)
264
#define MAC_USE_EVENTS              FALSE
325
#define MAC_USE_EVENTS                      FALSE
265 326
#endif
266 327

  
267 328
/*===========================================================================*/
......
277 338
 *          use a DMA channel and heavily loads the CPU.
278 339
 */
279 340
#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__)
280
#define MMC_NICE_WAITING            FALSE
341
#define MMC_NICE_WAITING                    FALSE
342
#endif
343

  
344
/*===========================================================================*/
345
/* QSPI driver related settings.                                             */
346
/*===========================================================================*/
347

  
348
/**
349
 * @brief   Enables synchronous APIs.
350
 * @note    Disabling this option saves both code and data space.
351
 */
352
#if !defined(QSPI_USE_WAIT) || defined(__DOXYGEN__)
353
#define QSPI_USE_WAIT                       TRUE
354
#endif
355

  
356
/**
357
 * @brief   Enables the @p qspiAcquireBus() and @p qspiReleaseBus() APIs.
358
 * @note    Disabling this option saves both code and data space.
359
 */
360
#if !defined(QSPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
361
#define QSPI_USE_MUTUAL_EXCLUSION           TRUE
281 362
#endif
282 363

  
283 364
/*===========================================================================*/
......
289 370
 * @note    Attempts are performed at 10mS intervals.
290 371
 */
291 372
#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__)
292
#define SDC_INIT_RETRY              100
373
#define SDC_INIT_RETRY                      100
293 374
#endif
294 375

  
295 376
/**
......
298 379
 *          at @p FALSE.
299 380
 */
300 381
#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__)
301
#define SDC_MMC_SUPPORT             FALSE
382
#define SDC_MMC_SUPPORT                     FALSE
302 383
#endif
303 384

  
304 385
/**
......
308 389
 *          lower priority, this may slow down the driver a bit however.
309 390
 */
310 391
#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__)
311
#define SDC_NICE_WAITING            FALSE
392
#define SDC_NICE_WAITING                    FALSE
393
#endif
394

  
395
/**
396
 * @brief   OCR initialization constant for V20 cards.
397
 */
398
#if !defined(SDC_INIT_OCR_V20) || defined(__DOXYGEN__)
399
#define SDC_INIT_OCR_V20                    0x50FF8000U
400
#endif
401

  
402
/**
403
 * @brief   OCR initialization constant for non-V20 cards.
404
 */
405
#if !defined(SDC_INIT_OCR) || defined(__DOXYGEN__)
406
#define SDC_INIT_OCR                        0x80100000U
312 407
#endif
313 408

  
314 409
/*===========================================================================*/
......
321 416
 *          default configuration.
322 417
 */
323 418
#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__)
324
#define SERIAL_DEFAULT_BITRATE      115200
419
#define SERIAL_DEFAULT_BITRATE              115200
325 420
#endif
326 421

  
327 422
/**
......
332 427
 *          buffers.
333 428
 */
334 429
#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__)
335
#define SERIAL_BUFFERS_SIZE         16
430
#define SERIAL_BUFFERS_SIZE                 16
336 431
#endif
337 432

  
338 433
/*===========================================================================*/
......
347 442
 *          buffers.
348 443
 */
349 444
#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__)
350
#define SERIAL_USB_BUFFERS_SIZE     256
445
#define SERIAL_USB_BUFFERS_SIZE             256
351 446
#endif
352 447

  
353 448
/**
......
355 450
 * @note    The default is 2 buffers.
356 451
 */
357 452
#if !defined(SERIAL_USB_BUFFERS_NUMBER) || defined(__DOXYGEN__)
358
#define SERIAL_USB_BUFFERS_NUMBER   2
453
#define SERIAL_USB_BUFFERS_NUMBER           2
359 454
#endif
360 455

  
361 456
/*===========================================================================*/
......
367 462
 * @note    Disabling this option saves both code and data space.
368 463
 */
369 464
#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__)
370
#define SPI_USE_WAIT                TRUE
465
#define SPI_USE_WAIT                        TRUE
466
#endif
467

  
468
/**
469
 * @brief   Enables circular transfers APIs.
470
 * @note    Disabling this option saves both code and data space.
471
 */
472
#if !defined(SPI_USE_CIRCULAR) || defined(__DOXYGEN__)
473
#define SPI_USE_CIRCULAR                    FALSE
371 474
#endif
372 475

  
476

  
373 477
/**
374 478
 * @brief   Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs.
375 479
 * @note    Disabling this option saves both code and data space.
376 480
 */
377 481
#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
378
#define SPI_USE_MUTUAL_EXCLUSION    TRUE
482
#define SPI_USE_MUTUAL_EXCLUSION            TRUE
483
#endif
484

  
485
/**
486
 * @brief   Handling method for SPI CS line.
487
 * @note    Disabling this option saves both code and data space.
488
 */
489
#if !defined(SPI_SELECT_MODE) || defined(__DOXYGEN__)
490
#define SPI_SELECT_MODE                     SPI_SELECT_MODE_PAD
379 491
#endif
380 492

  
381 493
/*===========================================================================*/
......
387 499
 * @note    Disabling this option saves both code and data space.
388 500
 */
389 501
#if !defined(UART_USE_WAIT) || defined(__DOXYGEN__)
390
#define UART_USE_WAIT               FALSE
502
#define UART_USE_WAIT                       FALSE
391 503
#endif
392 504

  
393 505
/**
......
395 507
 * @note    Disabling this option saves both code and data space.
396 508
 */
397 509
#if !defined(UART_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
398
#define UART_USE_MUTUAL_EXCLUSION   FALSE
510
#define UART_USE_MUTUAL_EXCLUSION           FALSE
399 511
#endif
400 512

  
401 513
/*===========================================================================*/
......
407 519
 * @note    Disabling this option saves both code and data space.
408 520
 */
409 521
#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
410
#define USB_USE_WAIT                FALSE
522
#define USB_USE_WAIT                        FALSE
411 523
#endif
412 524

  
413 525
#endif /* _HALCONF_H_ */
modules/DiWheelDrive_1-1/mcuconf.h
59 59
#define STM32_PLS                           STM32_PLS_LEV0
60 60

  
61 61
/*
62
 * IRQ system settings.
63
 */
64
#define STM32_IRQ_EXTI0_PRIORITY            6
65
#define STM32_IRQ_EXTI1_PRIORITY            6
66
#define STM32_IRQ_EXTI2_PRIORITY            6
67
#define STM32_IRQ_EXTI3_PRIORITY            6
68
#define STM32_IRQ_EXTI4_PRIORITY            6
69
#define STM32_IRQ_EXTI5_9_PRIORITY          6
70
#define STM32_IRQ_EXTI10_15_PRIORITY        6
71
#define STM32_IRQ_EXTI16_PRIORITY           6
72
#define STM32_IRQ_EXTI17_PRIORITY           6
73
#define STM32_IRQ_EXTI18_PRIORITY           6
74
#define STM32_IRQ_EXTI19_PRIORITY           6
75

  
76
/*
62 77
 * ADC driver system settings.
63 78
 */
64 79
#define STM32_ADC_USE_ADC1                  FALSE
......
72 87
#define STM32_CAN_CAN1_IRQ_PRIORITY         11
73 88

  
74 89
/*
75
 * EXT driver system settings.
76
 */
77
#define STM32_EXT_EXTI0_IRQ_PRIORITY        6
78
#define STM32_EXT_EXTI1_IRQ_PRIORITY        6
79
#define STM32_EXT_EXTI2_IRQ_PRIORITY        6
80
#define STM32_EXT_EXTI3_IRQ_PRIORITY        6
81
#define STM32_EXT_EXTI4_IRQ_PRIORITY        6
82
#define STM32_EXT_EXTI5_9_IRQ_PRIORITY      6
83
#define STM32_EXT_EXTI10_15_IRQ_PRIORITY    6
84
#define STM32_EXT_EXTI16_IRQ_PRIORITY       6
85
#define STM32_EXT_EXTI17_IRQ_PRIORITY       6
86
#define STM32_EXT_EXTI18_IRQ_PRIORITY       6
87
#define STM32_EXT_EXTI19_IRQ_PRIORITY       6
88

  
89
/*
90 90
 * GPT driver system settings.
91 91
 */
92 92
#define STM32_GPT_USE_TIM1                  FALSE
......
113 113
#define STM32_I2C_I2C1_DMA_PRIORITY         3
114 114
#define STM32_I2C_I2C2_DMA_PRIORITY         3
115 115
#define STM32_I2C_DMA_ERROR_HOOK(i2cp)      osalSysHalt("DMA failure")
116
#define STM32_I2C_USE_DMA                   FALSE
117 116

  
118 117
/*
119 118
 * ICU driver system settings.
modules/DiWheelDrive_1-1/module.c
18 18

  
19 19
#include "module.h"
20 20

  
21
#include <amiroos.h>
22

  
21 23
/*===========================================================================*/
22 24
/**
23 25
 * @name Module specific functions
24 26
 * @{
25 27
 */
26 28
/*===========================================================================*/
27
#include <amiroos.h>
28

  
29
/**
30
 * @brief   Interrupt service routine callback for I/O interrupt signals.
31
 *
32
 * @param   args      Channel on which the interrupt was encountered.
33
 */
34
static void _modulePalIsrCallback(void *args) {
35
  chSysLockFromISR();
36
  chEvtBroadcastFlagsI(&aos.events.io, (1 << (*(uint16_t*)args)));
37
  chSysUnlockFromISR();
38

  
39
  return;
40
}
41 29

  
42 30
/** @} */
43 31

  
......
53 41
  /* btr  */ CAN_BTR_SJW(1) | CAN_BTR_TS2(2) | CAN_BTR_TS1(13) | CAN_BTR_BRP(1),
54 42
};
55 43

  
56
aos_interrupt_cfg_t moduleIntConfig[10] = {
57
    /* channel  1 */ { // SYS_INT_N/SYS_SYNC_N: automatic interrupt on event
58
      /* port     */ GPIOC,
59
      /* pad      */ GPIOC_SYS_INT_N,
60
      /* flags    */ AOS_INTERRUPT_AUTOSTART,
61
      /* mode     */ PAL_EVENT_MODE_BOTH_EDGES,
62
      /* callback */ _modulePalIsrCallback,
63
      /* cb arg   */ 1,
64
    },
65
    /* channel  2 */ { // SYS_WARMRST_N: automatic interrupt when activated
66
      /* port     */ GPIOD,
67
      /* pad      */ GPIOD_SYS_WARMRST_N,
68
      /* flags    */ AOS_INTERRUPT_AUTOSTART,
69
      /* mode     */ PAL_EVENT_MODE_FALLING_EDGE,
70
      /* callback */ _modulePalIsrCallback,
71
      /* cb arg   */ 2,
72
    },
73
    /* channel  3 */ { // PATH_DCSTAT: must be enabled explicitely when charging is in progress to detect unexpected voltage drop
74
      /* port     */ GPIOC,
75
      /* pad      */ GPIOC_PATH_DCSTAT,
76
      /* flags    */ 0,
77
      /* mode     */ PAL_EVENT_MODE_FALLING_EDGE,
78
      /* callback */ _modulePalIsrCallback,
79
      /* cb arg   */ 3,
80
    },
81
    /* channel  5 */ { // COMPASS_DRDY: must be enabled explicitely
82
      /* port     */ GPIOB,
83
      /* pad      */ GPIOB_COMPASS_DRDY,
84
      /* flags    */ 0,
85
      /* mode     */ APAL2CH_EDGE(HMC5883L_LLD_INT_EDGE),
86
      /* callback */ _modulePalIsrCallback,
87
      /* cb arg   */ 4,
88
    },
89
    /* channel  8 */ { // SYS_PD_N: automatic interrupt when activated
90
      /* port     */ GPIOC,
91
      /* pad      */ GPIOC_SYS_PD_N,
92
      /* flags    */ AOS_INTERRUPT_AUTOSTART,
93
      /* mode     */ PAL_EVENT_MODE_FALLING_EDGE,
94
      /* callback */ _modulePalIsrCallback,
95
      /* cb arg   */ 5,
96
    },
97
    /* channel  9 */ { // SYS_REG_EN: automatic interrupt when activated
98
      /* port     */ GPIOC,
99
      /* pad      */ GPIOC_SYS_REG_EN,
100
      /* flags    */ AOS_INTERRUPT_AUTOSTART,
101
      /* mode     */ PAL_EVENT_MODE_FALLING_EDGE,
102
      /* callback */ _modulePalIsrCallback,
103
      /* cb arg   */ 6,
104
    },
105
    /* channel 12 */ { // IR_INT: must be enabled explicitely
106
      /* port     */ GPIOB,
107
      /* pad      */ GPIOB_IR_INT,
108
      /* flags    */ 0,
109
      /* mode     */ APAL2CH_EDGE(VCNL4020_LLD_INT_EDGE),
110
      /* callback */ _modulePalIsrCallback,
111
      /* cb arg   */ 7,
112
    },
113
    /* channel 13 */ { // GYRO_DRDY: must be enabled explicitely
114
      /* port     */ GPIOB,
115
      /* pad      */ GPIOB_GYRO_DRDY,
116
      /* flags    */ 0,
117
      /* mode     */ APAL2CH_EDGE(L3G4200D_LLD_INT_EDGE),
118
      /* callback */ _modulePalIsrCallback,
119
      /* cb arg   */ 8,
120
    },
121
    /* channel 14 */ { // SYS_UART_UP: automatic interrupt on event
122
      /* port     */ GPIOB,
123
      /* pad      */ GPIOB_SYS_UART_UP,
124
      /* flags    */ AOS_INTERRUPT_AUTOSTART,
125
      /* mode     */ PAL_EVENT_MODE_BOTH_EDGES,
126
      /* callback */ _modulePalIsrCallback,
127
      /* cb arg   */ 9,
128
    },
129
    /* channel 15 */ { // ACCEL_INT_N: must be enabled explicitely
130
      /* port     */ GPIOB,
131
      /* pad      */ GPIOB_ACCEL_INT_N,
132
      /* flags    */ 0,
133
      /* mode     */ APAL2CH_EDGE(LIS331DLH_LLD_INT_EDGE),
134
      /* callback */ _modulePalIsrCallback,
135
      /* cb arg   */ 10,
136
    },
137
};
138

  
139
aos_interrupt_driver_t moduleIntDriver = {
140
  /* config     */ NULL,
141
  /* interrupts */ 10,
142
};
143

  
144 44
I2CConfig moduleHalI2cCompassConfig = {
145 45
  /* I²C mode   */ OPMODE_I2C,
146 46
  /* frequency  */ 400000,
......
229 129
 */
230 130
/*===========================================================================*/
231 131

  
232
apalGpio_t moduleGpioLed = {
132
/**
133
 * @brief   LED output signal GPIO.
134
 */
135
static apalGpio_t _gpioLed = {
233 136
  /* port */ GPIOA,
234 137
  /* pad  */ GPIOA_LED,
235 138
};
139
apalControlGpio_t moduleGpioLed = {
140
  /* GPIO */ &_gpioLed,
141
  /* meta */ {
142
    /* direction      */ APAL_GPIO_DIRECTION_OUTPUT,
143
    /* active state   */ LED_LLD_GPIO_ACTIVE_STATE,
144
    /* interrupt edge */ APAL_GPIO_EDGE_NONE,
145
  },
146
};
236 147

  
237
apalGpio_t moduleGpioPowerEn = {
238
  /* port */GPIOB,
148
/**
149
 * @brief   POWER_EN output signal GPIO.
150
 */
151
static apalGpio_t _gpioPowerEn = {
152
  /* port */ GPIOB,
239 153
  /* pad  */  GPIOB_POWER_EN,
240 154
};
155
apalControlGpio_t moduleGpioPowerEn = {
156
  /* GPIO */ &_gpioPowerEn,
157
  /* meta */ {
158
    /* direction      */ APAL_GPIO_DIRECTION_OUTPUT,
159
    /* active state   */ APAL_GPIO_ACTIVE_HIGH,
160
    /* interrupt edge */ APAL_GPIO_EDGE_NONE,
161
  },
162
};
241 163

  
242
apalGpio_t moduleGpioCompassDrdy = {
164
/**
165
 * @brief   COMPASS_DRDY output signal GPIO.
166
 */
167
static apalGpio_t _gpioCompassDrdy = {
243 168
  /* port */ GPIOB,
244 169
  /* pad  */ GPIOB_COMPASS_DRDY,
245 170
};
171
apalControlGpio_t moduleGpioCompassDrdy = {
172
  /* GPIO */ &_gpioCompassDrdy,
173
  /* meta */ {
174
    /* direction      */ APAL_GPIO_DIRECTION_INPUT,
175
    /* active state   */ (L3G4200D_LLD_INT_EDGE == APAL_GPIO_EDGE_RISING) ? APAL_GPIO_ACTIVE_HIGH : APAL_GPIO_ACTIVE_LOW,
176
    /* interrupt edge */ L3G4200D_LLD_INT_EDGE,
177
  },
178
};
246 179

  
247
 apalGpio_t moduleGpioIrInt = {
180
/**
181
 * @brief   IR_INT input signal GPIO.
182
 */
183
static apalGpio_t _gpioIrInt = {
248 184
  /* port */ GPIOB,
249 185
  /* pad  */ GPIOB_IR_INT,
250 186
};
187
apalControlGpio_t moduleGpioIrInt = {
188
  /* GPIO */ &_gpioIrInt,
189
  /* meta */ {
190
    /* direction      */ APAL_GPIO_DIRECTION_INPUT,
191
    /* active state   */ (VCNL4020_LLD_INT_EDGE == APAL_GPIO_EDGE_RISING) ? APAL_GPIO_ACTIVE_HIGH : APAL_GPIO_ACTIVE_LOW,
192
    /* interrupt edge */ VCNL4020_LLD_INT_EDGE,
193
  },
194
};
251 195

  
252
apalGpio_t moduleGpioGyroDrdy = {
196
/**
197
 * @brief   GYRO_DRDY input signal GPIO.
198
 */
199
static apalGpio_t _gpioGyroDrdy = {
253 200
  /* port */ GPIOB,
254 201
  /* pad  */ GPIOB_GYRO_DRDY,
255 202
};
203
apalControlGpio_t moduleGpioGyroDrdy = {
204
  /* GPIO */ &_gpioGyroDrdy,
205
  /* meta */ {
206
    /* direction      */ APAL_GPIO_DIRECTION_INPUT,
207
    /* active state   */ (L3G4200D_LLD_INT_EDGE == APAL_GPIO_EDGE_RISING) ? APAL_GPIO_ACTIVE_HIGH : APAL_GPIO_ACTIVE_LOW,
208
    /* interrupt edge */ L3G4200D_LLD_INT_EDGE,
209
  },
210
};
256 211

  
257
apalGpio_t moduleGpioSysUartUp = {
212
/**
213
 * @brief   SYS_UART_UP bidirectional signal GPIO.
214
 */
215
static apalGpio_t _gpioSysUartUp = {
258 216
  /* port */ GPIOB,
259 217
  /* pad  */ GPIOB_SYS_UART_UP,
260 218
};
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff