BeRTOS
Functions
pwm_avr.c File Reference

Low-level PWM module for AVR (inplementation). More...

#include "pwm_avr.h"
#include <hw/hw_cpufreq.h>

Go to the source code of this file.

Functions

void pwm_hw_setPolarity (PwmDev dev, bool pol)
 Set PWM polarity to select pwm channel.
pwm_period_t pwm_hw_getPeriod (PwmDev dev)
 Get preiod from select channel.
void pwm_hw_setFrequency (PwmDev dev, uint32_t freq)
 Set pwm waveform frequecy.
void pwm_hw_setDutyUnlock (PwmDev dev, uint16_t duty)
 Set pwm duty cycle.
void pwm_hw_enable (PwmDev dev)
 Enable select pwm channel.
void pwm_hw_disable (PwmDev dev)
 Disable select pwm channel.
void pwm_hw_init (void)
 Init pwm.

Detailed Description

Low-level PWM module for AVR (inplementation).

Author:
Daniele Basile <asterix@develer.com>

Definition in file pwm_avr.c.


Function Documentation

pwm_period_t pwm_hw_getPeriod ( PwmDev  dev)

Get preiod from select channel.

dev channel

Definition at line 67 of file pwm_avr.c.

void pwm_hw_setDutyUnlock ( PwmDev  dev,
uint16_t  duty 
)

Set pwm duty cycle.

duty value 0 - 2^16

Definition at line 103 of file pwm_avr.c.

void pwm_hw_setFrequency ( PwmDev  dev,
uint32_t  freq 
)

Set pwm waveform frequecy.

freq in Hz

Definition at line 85 of file pwm_avr.c.