diff options
author | Fabio Utzig <utzig@utzig.org> | 2016-11-24 20:23:05 -0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-24 20:23:05 -0200 |
commit | bc6033e829604c1c97adc10f0b742a8e7229796a (patch) | |
tree | cbf0aa90b71d4b6be85e34c9ce8ef6b4cf935a1b /os/hal/ports/NRF5/NRF51822/hal_pwm_lld.h | |
parent | 32f8544bc88738f4795621d9d7a9818db5a682ee (diff) | |
parent | d2b5649b0f1699589a4153154f7f436f205bdfa4 (diff) | |
download | ChibiOS-Contrib-bc6033e829604c1c97adc10f0b742a8e7229796a.tar.gz ChibiOS-Contrib-bc6033e829604c1c97adc10f0b742a8e7229796a.tar.bz2 ChibiOS-Contrib-bc6033e829604c1c97adc10f0b742a8e7229796a.zip |
Merge pull request #104 from sdalu/pwmfix
Use active wait and perform extra toggle if needed.
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)
*/
|