|
int | pwm_init () |
| Initializes this peripheral interface, to use before any other function in this file. More...
|
|
int | pwm_isInit () |
| true if pwm_init has been called with success
|
|
int | pwm_resetChannel (int channel) |
| Resets the specified channel to: disabled, pwm mode, don't repeat last, silence=0, normal polarity, don't use fifo, don't use M/S Warning: the pwm peripheral likes to ignore the CTL_RPTL1_MASK and repeat the last word even if you say it not to. More...
|
|
int | pwm_clearFifo () |
| clears the fifo More...
|
|
int | pwm_setEnable (int channel, unsigned int value) |
| Sets the enabled status of the specified channel. After the dma completes a transfer (a chain of control blocks) and 0 gets loaded as control block this is resetted to 0. More...
|
|
int | pwm_setMode (int channel, unsigned int mode) |
| Sets the mode of the specified channel to PWM or Serializer. More...
|
|
int | pwm_setMSenable (int channel, unsigned int mode) |
| Sets the pwm mode: M/S or the algorithm (see datasheet pag 139) More...
|
|
int | pwm_setRange (int channel, uint32_t range) |
| Sets the range of the specified channel counter. More...
|
|
int | pwm_setData (int channel, uint32_t data) |
| Sets the data for the specified channel: in Serializer mode (if not using fifo) it will be sent as pulses, in PWM mode it's the number of pulses in a period. More...
|
|
int | pwm_setClock (int clkSrc, int divisorInt, int divisorFrac) |
| sets the clock divisor for the pwm (the base frequency is 19.2 MHz) More...
|
|
int | pwm_writeToFifo (unsigned int data) |
| Write the provided data word to the fifo. More...
|
|
int | pwm_setDreqThreshold (unsigned int threshold) |
| Sets the threshold under which the dreq signal is raised. More...
|
|
int | pwm_setSerializerMode (int channel, unsigned int mode) |
| Set the serialized mode to use the fifo or the data register. More...
|
|
int | pwm_setDmaEnable (unsigned int value) |
| Enables or disables the generation of the dma signals DREQ and PANIC. More...
|
|
int | pwm_setRepeatLastWord (int channel, unsigned int value) |
| Sets the repetition of the last word in the fifo on serializer mode Warning: the pwm peripheral likes to ignore this setting and repeat the last word even if you say it not to. More...
|
|
Interface to the PWM peripheral.
This peripheral is able to generate PWM signals. It has 3 modes:
- Serializer mode: it seriallly outputs the bits of 32bit words, you can set the input to the data register or the fifo
- M/S PWM: it outputs a pwm signal generated this way: it increments ciclically a counter, while it's lower to the setted threshold the output is high, while higher it's low
- not-M/S PWM: it mantains the same duty cycle as M/S but it spreads the high part in little pulses See documentation at "BCM2835 ARM peripherals" pag 138
int pwm_resetChannel |
( |
int |
channel | ) |
|
Resets the specified channel to: disabled, pwm mode, don't repeat last, silence=0, normal polarity, don't use fifo, don't use M/S Warning: the pwm peripheral likes to ignore the CTL_RPTL1_MASK and repeat the last word even if you say it not to.
- Parameters
-
- Returns
- negative in case of error