diff options
Diffstat (limited to 'os/hal/hal.dox')
-rw-r--r-- | os/hal/hal.dox | 160 |
1 files changed, 97 insertions, 63 deletions
diff --git a/os/hal/hal.dox b/os/hal/hal.dox index 5a6cbb7cc..45d133014 100644 --- a/os/hal/hal.dox +++ b/os/hal/hal.dox @@ -239,24 +239,23 @@ rankdir="LR";
node [shape=circle, fontname=Helvetica, fontsize=8, fixedsize="true", width="0.9", height="0.9"];
edge [fontname=Helvetica, fontsize=8];
+
stop [label="SPI_STOP\nLow Power"];
uninit [label="SPI_UNINIT", style="bold"];
ready [label="SPI_READY\nClock Enabled"];
- selected [label="SPI_SELECTED\nSlave Selected"];
active [label="SPI_ACTIVE\nBus Active"];
- sync [label="SPI_SYNC\nSynchronization"];
- uninit -> stop [label="spiInit()", constraint=false];
- stop -> ready [label="spiStart()"];
- ready -> ready [label="spiUnselect()\nspiStart()\nspiWait()"];
- ready -> stop [label="spiStop()"];
- stop -> stop [label="spiStop()"];
- ready -> selected [label="spiSelect()"];
- selected -> selected [label="spiSelect()\nspiWait()"];
- selected -> ready [label="spiUnselect()"];
- selected -> active [label="spiIgnore()\nspiExchange()\nspiSend()\nspiReceive()"];
- active -> selected [label="spiWait()\n>spc_endcb<"];
- ready -> sync [label="spiSynchronize()"];
- sync -> ready [label="spiWait()\n>spc_endcb<"];
+ complete [label="SPI_COMPLETE\nComplete"];
+
+ uninit -> stop [label="\n spiInit()", constraint=false];
+ stop -> ready [label="\nspiStart()"];
+ ready -> ready [label="\nspiSelect()\nspiUnselect()\nspiStart()"];
+ ready -> stop [label="\nspiStop()"];
+ stop -> stop [label="\nspiStop()"];
+ ready -> active [label="\nspiStartXXXI() (async)\nspiXXX() (sync)"];
+ active -> ready [label="\nsync return"];
+ active -> complete [label="\nasync callback\n>spc_endcb<"];
+ complete -> active [label="\nspiStartXXXI() (async)\nthen\ncallback return"];
+ complete -> ready [label="\ncallback return"];
}
* @else
* @dot
@@ -264,24 +263,23 @@ rankdir="LR";
node [shape=circle, fontname=Helvetica, fontsize=8, fixedsize="true", width="0.9", height="0.9"];
edge [fontname=Helvetica, fontsize=8];
+
stop [label="SPI_STOP\nLow Power"];
uninit [label="SPI_UNINIT", style="bold"];
ready [label="SPI_READY\nClock Enabled"];
- selected [label="SPI_SELECTED\nSlave Selected"];
active [label="SPI_ACTIVE\nBus Active"];
- sync [label="SPI_SYNC\nSynchronization"];
- uninit -> stop [label="spiInit()", constraint=false];
- stop -> ready [label="spiStart()"];
- ready -> ready [label="spiUnselect()\nspiStart()\nspiWait()"];
- ready -> stop [label="spiStop()"];
- stop -> stop [label="spiStop()"];
- ready -> selected [label="spiSelect()"];
- selected -> selected [label="spiSelect()\nspiWait()"];
- selected -> ready [label="spiUnselect()"];
- selected -> active [label="spiIgnore()\nspiExchange()\nspiSend()\nspiReceive()"];
- active -> selected [label="spiWait()\n>spc_endcb<"];
- ready -> sync [label="spiSynchronize()"];
- sync -> ready [label="spiWait()\n>spc_endcb<"];
+ complete [label="SPI_COMPLETE\nComplete"];
+
+ uninit -> stop [label="\n spiInit()", constraint=false];
+ stop -> ready [label="\nspiStart()"];
+ ready -> ready [label="\nspiSelect()\nspiUnselect()\nspiStart()"];
+ ready -> stop [label="\nspiStop()"];
+ stop -> stop [label="\nspiStop()"];
+ ready -> active [label="\nspiStartXXX() (async)\nspiXXX() (sync)"];
+ active -> ready [label="\nsync return"];
+ active -> complete [label="\nasync callback\n>spc_endcb<"];
+ complete -> active [label="\nspiStartXXXI() (async)\nthen\ncallback return"];
+ complete -> ready [label="\ncallback return"];
}
* @enddot
* @endif
@@ -320,59 +318,95 @@ digraph example {
size="5, 7";
rankdir="LR";
- node [shape=circle, fontname=Helvetica, fontsize=8, fixedsize="true", width="0.8", height="0.8"];
+ node [shape=circle, fontname=Helvetica, fontsize=8, fixedsize="true", width="0.9", height="0.9"];
edge [fontname=Helvetica, fontsize=8];
+
stop [label="ADC_STOP\nLow Power"];
uninit [label="ADC_UNINIT", style="bold"];
ready [label="ADC_READY\nClock Enabled"];
- running [label="ADC_RUNNING"];
- complete [label="ADC_COMPLETE"];
- uninit -> stop [label="adcInit()", constraint=false];
- stop -> ready [label="adcStart()"];
- ready -> ready [label="adcStart()"];
- ready -> ready [label="adcWaitConversion()"];
- ready -> stop [label="adcStop()"];
- stop -> stop [label="adcStop()"];
- ready -> running [label="adcStartConversion()"];
- running -> ready [label="adcStopConversion()"];
- running -> complete [label="End of Conversion"];
- complete -> running [label="adcStartConversion()"];
- complete -> ready [label="adcStopConversion()"];
- complete -> ready [label="adcWaitConversion()"];
- complete -> stop [label="adcStop()"];
+ active [label="ADC_ACTIVE\nConverting"];
+ complete [label="ADC_COMPLETE\nComplete"];
+
+ uninit -> stop [label="\n adcInit()", constraint=false];
+ stop -> ready [label="\nadcStart()"];
+ ready -> ready [label="\nadcStart()\nadcStopConversion()"];
+ ready -> stop [label="\nadcStop()"];
+ stop -> stop [label="\nadcStop()"];
+ ready -> active [label="\nadcStartConversion() (async)\nadcConvert() (sync)"];
+ active -> ready [label="\nadcStopConversion()\nsync return"];
+ active -> complete [label="\nasync callback\n>acg_endcb<"];
+ complete -> active [label="\nadcStartConversionI()\nthen\ncallback return()"];
+ complete -> ready [label="\nadcStopConversionI()\nthen\ncallback return"];
}
* @enddot
* @else
* @dot
digraph example {
rankdir="LR";
- node [shape=circle, fontname=Helvetica, fontsize=8, fixedsize="true", width="0.8", height="0.8"];
+ node [shape=circle, fontname=Helvetica, fontsize=8, fixedsize="true", width="0.9", height="0.9"];
edge [fontname=Helvetica, fontsize=8];
+
stop [label="ADC_STOP\nLow Power"];
uninit [label="ADC_UNINIT", style="bold"];
ready [label="ADC_READY\nClock Enabled"];
- running [label="ADC_RUNNING"];
- complete [label="ADC_COMPLETE"];
- uninit -> stop [label="adcInit()", constraint=false];
- stop -> ready [label="adcStart()"];
- ready -> ready [label="adcStart()"];
- ready -> ready [label="adcWaitConversion()"];
- ready -> stop [label="adcStop()"];
- stop -> stop [label="adcStop()"];
- ready -> running [label="adcStartConversion()"];
- running -> ready [label="adcStopConversion()"];
- running -> complete [label="End of Conversion"];
- complete -> running [label="adcStartConversion()"];
- complete -> ready [label="adcStopConversion()"];
- complete -> ready [label="adcWaitConversion()"];
- complete -> stop [label="adcStop()"];
+ active [label="ADC_ACTIVE\nConverting"];
+ complete [label="ADC_COMPLETE\nComplete"];
+
+ uninit -> stop [label="\n adcInit()", constraint=false];
+ stop -> ready [label="\nadcStart()"];
+ ready -> ready [label="\nadcStart()\nadcStopConversion()"];
+ ready -> stop [label="\nadcStop()"];
+ stop -> stop [label="\nadcStop()"];
+ ready -> active [label="\nadcStartConversion() (async)\nadcConvert() (sync)"];
+ active -> ready [label="\nadcStopConversion()\nsync return"];
+ active -> complete [label="\nasync callback\n>acg_endcb<"];
+ complete -> active [label="\nadcStartConversionI()\nthen\ncallback return()"];
+ complete -> ready [label="\nadcStopConversionI()\nthen\ncallback return"];
}
* @enddot
* @endif
*
- * The driver supports a continuous conversion mode with circular buffer,
- * callback functions allow to process the converted data in real time.
- * Please refer to the documentation of the function @p adcStartConversion().
+ * @section adc_2 ADC Operations
+ * The ADC driver is quite complex, an explanation of the terminology and of
+ * the operational details follows.
+ *
+ * @subsection adc_2_1 ADC Conversion Groups
+ * The ADC Conversion Group is the objects that specifies a physical
+ * conversion operation. This structure contains some standard fields and
+ * several implementation-dependent fields.<br>
+ * The standard fields define the CG mode, the number of channels belonging
+ * to the CG and the optional callbacks.<br>
+ * The implementation-dependent fields specify the physical ADC operation
+ * mode, the analog channels belonging to the group and any other
+ * implementation-specific setting. Usually the extra fields just mirror
+ * the physical ADC registers, please refer to the vendor's MCU Reference
+ * Manual for details about the available settings. Details are also available
+ * into the documentation of the ADC low level drivers and in the various
+ * sample applications.
+ *
+ * @subsection adc_2_2 ADC Conversion Modes
+ * The driver supports several conversion modes:
+ * - <b>One Shot</b>, the driver performs a single group conversion then stops.
+ * - <b>Linear Buffer</b>, the driver performs a series of group conversions
+ * then stops. This mode is like a one shot conversion repeated N times,
+ * the buffer pointer increases after each conversion. The buffer is
+ * organized as an S(CG)*N samples matrix, when S(CG) is the conversion
+ * group size (number of channels) and N is the buffer depth (number of
+ * repeated conversions).
+ * - <b>Circular Buffer</b>, much like the linear mode but the operation does
+ * not stop when the buffer is filled, it is automatically restarted
+ * with the buffer pointer wrapping back to the buffer base.
+ * .
+ * @subsection adc_2_3 ADC Callbacks
+ * The driver is able to invoke callbacks during the conversion process. A
+ * callback is invoked when the operation has been completed or, in circular
+ * mode, when the buffer has been filled and the operation is restarted. In
+ * linear and circular modes a callback is also invoked when the buffer is
+ * half filled.<br>
+ * The "half filled" and "filled" callbacks in circular mode allow to
+ * implement "streaming processing" of the sampled data, while the driver is
+ * busy filling one half of the buffer the application can process the
+ * other half, this allows for continuous interleaved operations.
*
* @ingroup IO
*/
|