![]() |
RTEMS 7.0-rc1
|
PWM Support. More...
#include "bsp/raspberrypi-pwm.h"Functions | |
| rtems_status_code | rpi_pwm_set_clock (uint32_t divisor) |
| Set PWM clock divider. | |
| rtems_status_code | rpi_pwm_set_data (raspberrypi_pwm_master master, raspberrypi_pwm_channel channel, uint32_t data) |
| Update duty-cycle register. | |
| rtems_status_code | rpi_pwm_init (raspberrypi_pwm_master master, raspberrypi_pwm_channel channel, uint32_t range, uint32_t data) |
| Main PWM initialization function. This functions sets up the PWM master, channel, duty cycle and GPIO pin. | |
PWM Support.
| rtems_status_code rpi_pwm_init | ( | raspberrypi_pwm_master | master, |
| raspberrypi_pwm_channel | channel, | ||
| uint32_t | range, | ||
| uint32_t | data | ||
| ) |
Main PWM initialization function. This functions sets up the PWM master, channel, duty cycle and GPIO pin.
| master | Selects the hardware instance to be used (raspberrypi_pwm_master0 = PWM0, raspberrypi_pwm_master1 = PWM1) |
| channel | Selects the channel for master (raspberrypi_pwm0 = PWMx_0, raspberrypi_pwm1 = PWMx_1) |
| range | Period register value (> 0) |
| data | Initial duty count, 1 – range (0 rejected) |
| rtems_status_code rpi_pwm_set_clock | ( | uint32_t | divisor | ) |
Set PWM clock divider.
| divisor | 1 – 4095; PWMCLK = 19.2 MHz / divisor. |
| RTEMS_SUCCESSFUL | OK |
| RTEMS_INVALID_NUMBER | 0 or >4095 |
| rtems_status_code rpi_pwm_set_data | ( | raspberrypi_pwm_master | master, |
| raspberrypi_pwm_channel | channel, | ||
| uint32_t | data | ||
| ) |
Update duty-cycle register.
| master | Selects the hardware instance to be used (raspberrypi_pwm_master0 = PWM0, raspberrypi_pwm_master1 = PWM1) |
| channel | Selects the channel for master (raspberrypi_pwm0 = PWMx_0, raspberrypi_pwm1 = PWMx_1) |
| data | Initial duty count, 1 – current range value.(0 rejected) |