ruuvi.drivers.c
${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
|
#include "ruuvi_driver_enabled_modules.h"
#include "ruuvi_interface_gpio_pwm.h"
#include "ruuvi_driver_error.h"
#include "ruuvi_interface_gpio.h"
#include <stdbool.h>
#include "nrf_pwm.h"
#include "nrf_drv_pwm.h"
Go to the source code of this file.
Macros | |
#define | RI_GPIO_PWM_DRIVER 0 |
#define | RI_GPIO_PWM_PLAYBACK_OK (0) |
#define | RI_GPIO_PWM_PLAYBACK_COUNT (1) |
#define | RI_GPIO_PWM_DRIVER_PIN_POINT (0) |
#define | RI_GPIO_PWM_SEQ_DELAY (0) |
#define | RI_GPIO_PWM_SEQ_REPEATS (1) |
#define | RI_GPIO_PWM_MAX_FREQ (16000000.00f) |
#define | RI_GPIO_PWM_MIN_FREQ (2.00f) |
#define | RI_GPIO_PWM_MAX_DUTY (1.00f) |
#define | RI_GPIO_PWM_MIN_DUTY (0.00f) |
#define | RI_GPIO_PWM_CHANNEL_UNUSED (0) |
#define | RI_GPIO_PWM_MIN_TOP_VALUE (1U) |
#define | RI_GPIO_PWM_MIN_REST_FOR_TOP (0.999999f) |
#define | RI_GPIO_PWM_FREQ_COUNT (8) |
#define | RI_GPIO_PWM_BASE_FREQ_16MHZ (RI_GPIO_PWM_MAX_FREQ) |
#define | RI_GPIO_PWM_BASE_FREQ_8MHZ (8000000.00f) |
#define | RI_GPIO_PWM_BASE_FREQ_4MHZ (4000000.00f) |
#define | RI_GPIO_PWM_BASE_FREQ_2MHZ (2000000.00f) |
#define | RI_GPIO_PWM_BASE_FREQ_1MHZ (1000000.00f) |
#define | RI_GPIO_PWM_BASE_FREQ_500KHZ (500000.00f) |
#define | RI_GPIO_PWM_BASE_FREQ_250KHZ (250000.00f) |
#define | RI_GPIO_PWM_BASE_FREQ_125KHZ (125000.00f) |
Enumerations | |
enum | ri_gpio_base_freq { RI_GPIO_PWM_BASE_NUM_FREQ_16MHZ = 0 , RI_GPIO_PWM_BASE_NUM_FREQ_8MHZ = 1 , RI_GPIO_PWM_BASE_NUM_FREQ_4MHZ = 2 , RI_GPIO_PWM_BASE_NUM_FREQ_2MHZ = 3 , RI_GPIO_PWM_BASE_NUM_FREQ_1MHZ = 4 , RI_GPIO_PWM_BASE_NUM_FREQ_500KHZ = 5 , RI_GPIO_PWM_BASE_NUM_FREQ_250KHZ = 6 , RI_GPIO_PWM_BASE_NUM_FREQ_125KHZ = 7 } |
Functions | |
rd_status_t | ri_gpio_pwm_init (void) |
Run any necessary initialization for PWM. More... | |
rd_status_t | ri_gpio_pwm_uninit (void) |
Uninitialize PWM. More... | |
bool | ri_gpio_pwm_is_init (void) |
Check if PWM is initialized. More... | |
rd_status_t | ri_gpio_pwm_start (const ri_gpio_id_t pin, const ri_gpio_mode_t mode, float *const frequency, float *const duty_cycle) |
Start PWM on given pin at given frequency and duty cycle. More... | |
rd_status_t | ri_gpio_pwm_stop (const ri_gpio_id_t pin) |
Stop PWM on given pin. More... | |