2009-12-07 16:13:01 +00:00
|
|
|
/*
|
2010-02-21 07:24:53 +00:00
|
|
|
ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio.
|
2009-12-07 16:13:01 +00:00
|
|
|
|
|
|
|
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/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2010-02-07 11:11:45 +00:00
|
|
|
* @file templates/pwm_lld.c
|
|
|
|
* @brief PWM Driver subsystem low level driver source template.
|
|
|
|
*
|
2010-10-25 18:48:13 +00:00
|
|
|
* @addtogroup PWM
|
2009-12-07 16:13:01 +00:00
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ch.h"
|
|
|
|
#include "hal.h"
|
|
|
|
|
|
|
|
/*===========================================================================*/
|
2009-12-29 11:12:05 +00:00
|
|
|
/* Driver exported variables. */
|
2009-12-07 16:13:01 +00:00
|
|
|
/*===========================================================================*/
|
|
|
|
|
|
|
|
/*===========================================================================*/
|
2009-12-29 11:12:05 +00:00
|
|
|
/* Driver local variables. */
|
2009-12-07 16:13:01 +00:00
|
|
|
/*===========================================================================*/
|
|
|
|
|
|
|
|
/*===========================================================================*/
|
2009-12-29 11:12:05 +00:00
|
|
|
/* Driver local functions. */
|
2009-12-07 16:13:01 +00:00
|
|
|
/*===========================================================================*/
|
|
|
|
|
|
|
|
/*===========================================================================*/
|
2009-12-29 11:12:05 +00:00
|
|
|
/* Driver interrupt handlers. */
|
2009-12-07 16:13:01 +00:00
|
|
|
/*===========================================================================*/
|
|
|
|
|
|
|
|
/*===========================================================================*/
|
2009-12-29 11:12:05 +00:00
|
|
|
/* Driver exported functions. */
|
2009-12-07 16:13:01 +00:00
|
|
|
/*===========================================================================*/
|
|
|
|
|
|
|
|
/**
|
2010-02-07 11:11:45 +00:00
|
|
|
* @brief Low level PWM driver initialization.
|
2010-10-04 17:16:18 +00:00
|
|
|
*
|
|
|
|
* @notapi
|
2009-12-07 16:13:01 +00:00
|
|
|
*/
|
|
|
|
void pwm_lld_init(void) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2010-02-07 11:11:45 +00:00
|
|
|
* @brief Configures and activates the PWM peripheral.
|
2009-12-07 16:13:01 +00:00
|
|
|
*
|
2010-02-07 11:11:45 +00:00
|
|
|
* @param[in] pwmp pointer to the @p PWMDriver object
|
2010-10-04 17:16:18 +00:00
|
|
|
*
|
|
|
|
* @notapi
|
2009-12-07 16:13:01 +00:00
|
|
|
*/
|
|
|
|
void pwm_lld_start(PWMDriver *pwmp) {
|
|
|
|
|
2009-12-08 07:42:49 +00:00
|
|
|
if (pwmp->pd_state == PWM_STOP) {
|
2009-12-07 16:13:01 +00:00
|
|
|
/* Clock activation.*/
|
|
|
|
}
|
|
|
|
/* Configuration.*/
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2010-02-07 11:11:45 +00:00
|
|
|
* @brief Deactivates the PWM peripheral.
|
2009-12-07 16:13:01 +00:00
|
|
|
*
|
2010-02-07 11:11:45 +00:00
|
|
|
* @param[in] pwmp pointer to the @p PWMDriver object
|
2010-10-04 17:16:18 +00:00
|
|
|
*
|
|
|
|
* @notapi
|
2009-12-07 16:13:01 +00:00
|
|
|
*/
|
|
|
|
void pwm_lld_stop(PWMDriver *pwmp) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2009-12-08 07:42:49 +00:00
|
|
|
/**
|
2010-02-07 11:11:45 +00:00
|
|
|
* @brief Determines whatever the PWM channel is already enabled.
|
2009-12-08 07:42:49 +00:00
|
|
|
*
|
|
|
|
* @param[in] pwmp pointer to the @p PWMDriver object
|
|
|
|
* @param[in] channel PWM channel identifier
|
2010-02-07 11:11:45 +00:00
|
|
|
* @return The PWM channel status.
|
|
|
|
* @retval FALSE the channel is not enabled.
|
|
|
|
* @retval TRUE the channel is enabled.
|
2010-10-04 17:16:18 +00:00
|
|
|
*
|
|
|
|
* @notapi
|
2009-12-08 07:42:49 +00:00
|
|
|
*/
|
|
|
|
bool_t pwm_lld_is_enabled(PWMDriver *pwmp, pwmchannel_t channel) {
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2010-02-07 11:11:45 +00:00
|
|
|
* @brief Enables a callback mode for the specified PWM channel.
|
2009-12-08 07:42:49 +00:00
|
|
|
* @details The callback mode must be set before starting a PWM channel.
|
|
|
|
*
|
|
|
|
* @param[in] pwmp pointer to the @p PWMDriver object
|
|
|
|
* @param[in] channel PWM channel identifier
|
|
|
|
* @param[in] edge output edge mode
|
2010-02-07 11:11:45 +00:00
|
|
|
* @param[in] callback callback function
|
2010-10-04 17:16:18 +00:00
|
|
|
*
|
|
|
|
* @notapi
|
2009-12-08 07:42:49 +00:00
|
|
|
*/
|
|
|
|
void pwm_lld_set_callback(PWMDriver *pwmp, pwmchannel_t channel,
|
|
|
|
pwmedge_t edge, pwmcallback_t callback) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2010-02-07 11:11:45 +00:00
|
|
|
* @brief Enables a PWM channel.
|
2009-12-08 07:42:49 +00:00
|
|
|
*
|
|
|
|
* @param[in] pwmp pointer to the @p PWMDriver object
|
|
|
|
* @param[in] channel PWM channel identifier
|
|
|
|
* @param[in] width PWM pulse width as clock pulses number
|
2010-10-04 17:16:18 +00:00
|
|
|
*
|
|
|
|
* @notapi
|
2009-12-08 07:42:49 +00:00
|
|
|
*/
|
|
|
|
void pwm_lld_enable_channel(PWMDriver *pwmp,
|
|
|
|
pwmchannel_t channel,
|
|
|
|
pwmcnt_t width) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2010-02-07 11:11:45 +00:00
|
|
|
* @brief Disables a PWM channel.
|
2009-12-08 07:42:49 +00:00
|
|
|
* @details The channel is disabled and its output line returned to the
|
|
|
|
* idle state.
|
|
|
|
*
|
|
|
|
* @param[in] pwmp pointer to the @p PWMDriver object
|
|
|
|
* @param[in] channel PWM channel identifier
|
2010-10-04 17:16:18 +00:00
|
|
|
*
|
|
|
|
* @notapi
|
2009-12-08 07:42:49 +00:00
|
|
|
*/
|
|
|
|
void pwm_lld_disable_channel(PWMDriver *pwmp, pwmchannel_t channel) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2009-12-07 16:13:01 +00:00
|
|
|
/** @} */
|