git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2863 35acf78f-673a-0410-8e92-d51de3d6d3f4

This commit is contained in:
gdisirio 2011-04-01 13:21:02 +00:00
parent 01b0220ffa
commit cf15276df3
3 changed files with 30 additions and 30 deletions

View File

@ -35,6 +35,26 @@
/* Driver constants. */ /* Driver constants. */
/*===========================================================================*/ /*===========================================================================*/
/**
* @brief Standard output modes mask.
*/
#define PWM_OUTPUT_MASK 0x0F
/**
* @brief Output not driven, callback only.
*/
#define PWM_OUTPUT_DISABLED 0x00
/**
* @brief Positive PWM logic, active is logic level one.
*/
#define PWM_OUTPUT_ACTIVE_HIGH 0x01
/**
* @brief Inverse PWM logic, active is logic level zero.
*/
#define PWM_OUTPUT_ACTIVE_LOW 0x02
/*===========================================================================*/ /*===========================================================================*/
/* Driver pre-compile time settings. */ /* Driver pre-compile time settings. */
/*===========================================================================*/ /*===========================================================================*/

View File

@ -40,38 +40,21 @@
*/ */
#define PWM_CHANNELS 4 #define PWM_CHANNELS 4
/**
* @brief Standard output modes mask.
*/
#define PWM_OUTPUT_MASK 0x07
/**
* @brief Output not driven, callback only.
*/
#define PWM_OUTPUT_DISABLED 0x00
/**
* @brief Positive PWM logic, active is logic level one.
*/
#define PWM_OUTPUT_ACTIVE_HIGH 0x01
/**
* @brief Inverse PWM logic, active is logic level zero.
*/
#define PWM_OUTPUT_ACTIVE_LOW 0x02
/** /**
* @brief Complementary output modes mask. * @brief Complementary output modes mask.
* @note This is an STM32-specific setting.
*/ */
#define PWM_COMPLEMENTARY_OUTPUT_MASK 0x70 #define PWM_COMPLEMENTARY_OUTPUT_MASK 0xF0
/** /**
* @brief Complementary output not driven. * @brief Complementary output not driven.
* @note This is an STM32-specific setting.
*/ */
#define PWM_COMPLEMENTARY_OUTPUT_DISABLED 0x00 #define PWM_COMPLEMENTARY_OUTPUT_DISABLED 0x00
/** /**
* @brief Complementary output, active is logic level one. * @brief Complementary output, active is logic level one.
* @note This is an STM32-specific setting.
* @note This setting is only available if the configuration option * @note This setting is only available if the configuration option
* @p STM32_PWM_USE_ADVANCED is set to TRUE and only for advanced * @p STM32_PWM_USE_ADVANCED is set to TRUE and only for advanced
* timers TIM1 and TIM8. * timers TIM1 and TIM8.
@ -80,6 +63,7 @@
/** /**
* @brief Complementary output, active is logic level zero. * @brief Complementary output, active is logic level zero.
* @note This is an STM32-specific setting.
* @note This setting is only available if the configuration option * @note This setting is only available if the configuration option
* @p STM32_PWM_USE_ADVANCED is set to TRUE and only for advanced * @p STM32_PWM_USE_ADVANCED is set to TRUE and only for advanced
* timers TIM1 and TIM8. * timers TIM1 and TIM8.

View File

@ -54,6 +54,11 @@
/* Driver data structures and types. */ /* Driver data structures and types. */
/*===========================================================================*/ /*===========================================================================*/
/**
* @brief PWM mode type.
*/
typedef uint32_t pwmmode_t;
/** /**
* @brief PWM channel type. * @brief PWM channel type.
*/ */
@ -64,15 +69,6 @@ typedef uint8_t pwmchannel_t;
*/ */
typedef uint16_t pwmcnt_t; typedef uint16_t pwmcnt_t;
/**
* @brief PWM logic mode.
*/
typedef enum {
PWM_OUTPUT_DISABLED = 0, /**< Output not driven, callback only. */
PWM_OUTPUT_ACTIVE_HIGH = 1, /**< Idle is logic level 0. */
PWM_OUTPUT_ACTIVE_LOW = 2 /**< Idle is logic level 1. */
} pwmmode_t;
/** /**
* @brief PWM driver channel configuration structure. * @brief PWM driver channel configuration structure.
* @note Some architectures may not be able to support the channel mode * @note Some architectures may not be able to support the channel mode