aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32/STM32F0xx/UART/mcuconf.h
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2015-09-02 08:14:28 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2015-09-02 08:14:28 +0000
commit97856f589402092759ebcc188c99f2595a9e296b (patch)
treec73ddf769da269781f94b6431ed3b4bfbb29f18b /testhal/STM32/STM32F0xx/UART/mcuconf.h
parent64689ec9b44217acd92443e88793a6e8387dd709 (diff)
downloadChibiOS-97856f589402092759ebcc188c99f2595a9e296b.tar.gz
ChibiOS-97856f589402092759ebcc188c99f2595a9e296b.tar.bz2
ChibiOS-97856f589402092759ebcc188c99f2595a9e296b.zip
Restored original dmaStreamDisable() macro.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8268 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32/STM32F0xx/UART/mcuconf.h')
0 files changed, 0 insertions, 0 deletions
href='#n136'>136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
/*
    ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
                 2011,2012 Giovanni Di Sirio.

    This file is part of ChibiOS/RT.

    ChibiOS/RT is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.

    ChibiOS/RT is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

/**
 * @file    ext.c
 * @brief   EXT Driver code.
 *
 * @addtogroup EXT
 * @{
 */

#include "ch.h"
#include "hal.h"

#if HAL_USE_EXT || defined(__DOXYGEN__)

/*===========================================================================*/
/* Driver local definitions.                                                 */
/*===========================================================================*/

/*===========================================================================*/
/* Driver exported variables.                                                */
/*===========================================================================*/

/*===========================================================================*/
/* Driver local variables.                                                   */
/*===========================================================================*/

/*===========================================================================*/
/* Driver local functions.                                                   */
/*===========================================================================*/

/*===========================================================================*/
/* Driver exported functions.                                                */
/*===========================================================================*/

/**
 * @brief   EXT Driver initialization.
 * @note    This function is implicitly invoked by @p halInit(), there is
 *          no need to explicitly initialize the driver.
 *
 * @init
 */
void extInit(void) {

  ext_lld_init();
}

/**
 * @brief   Initializes the standard part of a @p EXTDriver structure.
 *
 * @param[out] extp     pointer to the @p EXTDriver object
 *
 * @init
 */
void extObjectInit(EXTDriver *extp) {

  extp->state  = EXT_STOP;
  extp->config = NULL;
}

/**
 * @brief   Configures and activates the EXT peripheral.
 * @post    After activation all EXT channels are in the disabled state,
 *          use @p extChannelEnable() in order to activate them.
 *
 * @param[in] extp      pointer to the @p EXTDriver object
 * @param[in] config    pointer to the @p EXTConfig object
 *
 * @api
 */
void extStart(EXTDriver *extp, const EXTConfig *config) {

  chDbgCheck((extp != NULL) && (config != NULL), "extStart");

  chSysLock();
  chDbgAssert((extp->state == EXT_STOP) || (extp->state == EXT_ACTIVE),
              "extStart(), #1", "invalid state");
  extp->config = config;
  ext_lld_start(extp);
  extp->state = EXT_ACTIVE;
  chSysUnlock();
}

/**
 * @brief   Deactivates the EXT peripheral.
 *
 * @param[in] extp      pointer to the @p EXTDriver object
 *
 * @api
 */
void extStop(EXTDriver *extp) {

  chDbgCheck(extp != NULL, "extStop");

  chSysLock();
  chDbgAssert((extp->state == EXT_STOP) || (extp->state == EXT_ACTIVE),
              "extStop(), #1", "invalid state");
  ext_lld_stop(extp);
  extp->state = EXT_STOP;
  chSysUnlock();
}

/**
 * @brief   Enables an EXT channel.
 * @pre     The channel must not be in @p EXT_CH_MODE_DISABLED mode.
 *
 * @param[in] extp      pointer to the @p EXTDriver object
 * @param[in] channel   channel to be enabled
 *
 * @api
 */
void extChannelEnable(EXTDriver *extp, expchannel_t channel) {

  chDbgCheck((extp != NULL) && (channel < EXT_MAX_CHANNELS),
             "extChannelEnable");

  chSysLock();
  chDbgAssert((extp->state == EXT_ACTIVE) &&
              ((extp->config->channels[channel].mode &
                EXT_CH_MODE_EDGES_MASK) != EXT_CH_MODE_DISABLED),
              "extChannelEnable(), #1", "invalid state");