diff options
author | Stephane D'Alu <sdalu@sdalu.com> | 2016-11-20 13:25:25 +0100 |
---|---|---|
committer | Stephane D'Alu <sdalu@sdalu.com> | 2016-11-20 13:25:25 +0100 |
commit | 7ea44ed39c7c25ad0b3e1ad331dcdd70ca534bae (patch) | |
tree | f65a733b142ad1873323c595e59ce7b99e8ec4a8 /os/hal/ports/NRF5/NRF51822/hal_pwm_lld.h | |
parent | 319c9f9ee259cc7ae05bbff952b149118e6dc032 (diff) | |
download | ChibiOS-Contrib-7ea44ed39c7c25ad0b3e1ad331dcdd70ca534bae.tar.gz ChibiOS-Contrib-7ea44ed39c7c25ad0b3e1ad331dcdd70ca534bae.tar.bz2 ChibiOS-Contrib-7ea44ed39c7c25ad0b3e1ad331dcdd70ca534bae.zip |
Use active wait and perform extra toggle if needed. (same as the nrf_pwm)
Diffstat (limited to 'os/hal/ports/NRF5/NRF51822/hal_pwm_lld.h')
-rw-r--r-- | os/hal/ports/NRF5/NRF51822/hal_pwm_lld.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/os/hal/ports/NRF5/NRF51822/hal_pwm_lld.h b/os/hal/ports/NRF5/NRF51822/hal_pwm_lld.h index cd64fa7..2cad6e7 100644 --- a/os/hal/ports/NRF5/NRF51822/hal_pwm_lld.h +++ b/os/hal/ports/NRF5/NRF51822/hal_pwm_lld.h @@ -34,8 +34,11 @@ /**
* @brief Number of PWM channels per PWM driver.
*/
+#if NRF5_PWM_USE_GPIOTE_PPI
+#define PWM_CHANNELS 2
+#else
#define PWM_CHANNELS 3
-
+#endif
#define PWM_FREQUENCY_16MHZ 16000000 /** @brief 16MHz */
#define PWM_FREQUENCY_8MHZ 8000000 /** @brief 8MHz */
@@ -103,7 +106,7 @@ * @brief Allow driver to use GPIOTE/PPI to control PAL line
*/
#if !defined(NRF5_PWM_USE_GPIOTE_PPI)
-#define NRF5_PWM_USE_GPIOTE_PPI FALSE
+#define NRF5_PWM_USE_GPIOTE_PPI TRUE
#endif
/** @} */
@@ -177,6 +180,7 @@ typedef struct { pwmcallback_t callback;
/* End of the mandatory fields.*/
+#if NRF5_PWM_USE_GPIOTE_PPI || defined(__DOXYGEN__)
/**
* @brief PAL line to toggle.
* @note Only used if mode is PWM_OUTPUT_HIGH or PWM_OUTPUT_LOW.
@@ -186,17 +190,14 @@ typedef struct { */
ioline_t ioline;
-#if NRF5_PWM_USE_GPIOTE_PPI || defined(__DOXYGEN__)
/**
* @brief Unique GPIOTE channel to use. (1 channel)
- * @note Only used if mode is PWM_OUTPUT_HIGH or PWM_OUTPUT_LOW.
* @note Only 4 GPIOTE channels are available on nRF51.
*/
uint8_t gpiote_channel;
/**
* @brief Unique PPI channels to use. (2 channels)
- * @note Only used if mode is PWM_OUTPUT_HIGH or PWM_OUTPUT_LOW.
* @note Only 16 PPI channels are available on nRF51
* (When Softdevice is enabled, only channels 0-7 are available)
*/
|