/*
    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/

/**
 * @defgroup SPI SPI Driver
 * @brief   Generic SPI Driver.
 * @details This module implements a generic SPI (Serial Peripheral Interface)
 *          driver allowing bidirectional and monodirectional transfers,
 *          complex atomic transactions are supported as well.
 * @pre     In order to use the SPI driver the @p HAL_USE_SPI option
 *          must be enabled in @p halconf.h.
 *
 * @section spi_1 Driver State Machine
 * The driver implements a state machine internally, not all the driver
 * functionalities can be used in any moment, any transition not explicitly
 * shown in the following diagram has to be considered an error and shall
 * be captured by an assertion (if enabled).
 * @if LATEX_PDF
 * @dot
  digraph example {
    size="5, 7";
    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"];
    active [label="SPI_ACTIVE\nBus Active"];
    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"];
  }
 * @enddot
 * @else
 * @dot
  digraph example {
    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"];
    active [label="SPI_ACTIVE\nBus Active"];
    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
 *
 * The driver is not thread safe for performance reasons, if you need to access
 * the SPI bus from multiple threads then use the @p spiAcquireBus() and
 * @p spiReleaseBus() APIs in order to gain exclusive access.
 *
 * @ingroup HAL_NORMAL_DRIVERS
 */
3a444151b4fedf8ebfb36a2b5c421cc0afcb66 (<a href='/cgit.cgi/openwrt/em-br6478acv2/master-187ad058/plain/package/hotplug2/files/hotplug2.rules?id=8422957baeb090c845891c4db94c3327de2e1c06'>plain</a>)
<table summary='blob content' class='blob'>
<tr><td class='linenumbers'><pre><a id='n1' href='#n1'>1</a>
<a id='n2' href='#n2'>2</a>
<a id='n3' href='#n3'>3</a>
<a id='n4' href='#n4'>4</a>
<a id='n5' href='#n5'>5</a>
<a id='n6' href='#n6'>6</a>
<a id='n7' href='#n7'>7</a>
<a id='n8' href='#n8'>8</a>
<a id='n9' href='#n9'>9</a>
<a id='n10' href='#n10'>10</a>
</pre></td>
<td class='lines'><pre><code>