diff options
Diffstat (limited to 'lib/chibios/os/hal/dox/hal_can.dox')
-rw-r--r-- | lib/chibios/os/hal/dox/hal_can.dox | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/lib/chibios/os/hal/dox/hal_can.dox b/lib/chibios/os/hal/dox/hal_can.dox new file mode 100644 index 000000000..0ee4fb629 --- /dev/null +++ b/lib/chibios/os/hal/dox/hal_can.dox | |||
@@ -0,0 +1,87 @@ | |||
1 | /* | ||
2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio | ||
3 | |||
4 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | you may not use this file except in compliance with the License. | ||
6 | You may obtain a copy of the License at | ||
7 | |||
8 | http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | |||
10 | Unless required by applicable law or agreed to in writing, software | ||
11 | distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | See the License for the specific language governing permissions and | ||
14 | limitations under the License. | ||
15 | */ | ||
16 | |||
17 | /** | ||
18 | * @defgroup CAN CAN Driver | ||
19 | * @brief Generic CAN Driver. | ||
20 | * @details This module implements a generic CAN (Controller Area Network) | ||
21 | * driver allowing the exchange of information at frame level. | ||
22 | * @pre In order to use the CAN driver the @p HAL_USE_CAN option | ||
23 | * must be enabled in @p halconf.h. | ||
24 | * | ||
25 | * @section can_1 Driver State Machine | ||
26 | * The driver implements a state machine internally, not all the driver | ||
27 | * functionalities can be used in any moment, any transition not explicitly | ||
28 | * shown in the following diagram has to be considered an error and shall | ||
29 | * be captured by an assertion (if enabled). | ||
30 | * @if LATEX_PDF | ||
31 | * @dot | ||
32 | digraph example { | ||
33 | size="5, 7"; | ||
34 | rankdir="LR"; | ||
35 | node [shape=circle, fontname=Helvetica, fontsize=8, fixedsize="true", width="0.9", height="0.9"]; | ||
36 | edge [fontname=Helvetica, fontsize=8]; | ||
37 | |||
38 | stop [label="CAN_STOP\nLow Power"]; | ||
39 | uninit [label="CAN_UNINIT", style="bold"]; | ||
40 | starting [label="CAN_STARTING\nInitializing"]; | ||
41 | ready [label="CAN_READY\nClock Enabled"]; | ||
42 | sleep [label="CAN_SLEEP\nLow Power"]; | ||
43 | |||
44 | uninit -> stop [label=" canInit()", constraint=false]; | ||
45 | stop -> stop [label="\ncanStop()"]; | ||
46 | stop -> ready [label="\ncanStart()\n(fast implementation)"]; | ||
47 | stop -> starting [label="\ncanStart()\n(slow implementation)"]; | ||
48 | starting -> ready [label="\ninitialization complete\n(all threads)"]; | ||
49 | ready -> stop [label="\ncanStop()"]; | ||
50 | ready -> ready [label="\ncanReceive()\ncanTransmit()"]; | ||
51 | ready -> sleep [label="\ncanSleep()"]; | ||
52 | sleep -> sleep [label="\ncanSleep()"]; | ||
53 | sleep -> ready [label="\ncanWakeup()"]; | ||
54 | sleep -> ready [label="\nhardware\nwakeup event"]; | ||
55 | } | ||
56 | * @enddot | ||
57 | * @else | ||
58 | * @dot | ||
59 | digraph example { | ||
60 | rankdir="LR"; | ||
61 | node [shape=circle, fontname=Helvetica, fontsize=8, fixedsize="true", width="0.9", height="0.9"]; | ||
62 | edge [fontname=Helvetica, fontsize=8]; | ||
63 | |||
64 | stop [label="CAN_STOP\nLow Power"]; | ||
65 | uninit [label="CAN_UNINIT", style="bold"]; | ||
66 | starting [label="CAN_STARTING\nInitializing"]; | ||
67 | ready [label="CAN_READY\nClock Enabled"]; | ||
68 | sleep [label="CAN_SLEEP\nLow Power"]; | ||
69 | |||
70 | uninit -> stop [label=" canInit()", constraint=false]; | ||
71 | stop -> stop [label="\ncanStop()"]; | ||
72 | stop -> ready [label="\ncanStart()\n(fast implementation)"]; | ||
73 | stop -> starting [label="\ncanStart()\n(slow implementation)"]; | ||
74 | starting -> starting [label="\ncanStart()\n(other thread)"]; | ||
75 | starting -> ready [label="\ninitialization complete\n(all threads)"]; | ||
76 | ready -> stop [label="\ncanStop()"]; | ||
77 | ready -> ready [label="\ncanStart()\ncanReceive()\ncanTransmit()"]; | ||
78 | ready -> sleep [label="\ncanSleep()"]; | ||
79 | sleep -> sleep [label="\ncanSleep()"]; | ||
80 | sleep -> ready [label="\ncanWakeup()"]; | ||
81 | sleep -> ready [label="\nhardware\nwakeup event"]; | ||
82 | } | ||
83 | * @enddot | ||
84 | * @endif | ||
85 | * | ||
86 | * @ingroup HAL_NORMAL_DRIVERS | ||
87 | */ | ||