MiraOS  1.22
Enumerations | Functions
mira_pwm.h File Reference

MiraOS PWM driver. More...

#include <stdint.h>

Go to the source code of this file.

Enumerations

enum  MiraPwmChannel { MIRA_PWM_A = 0, MIRA_PWM_B = 1 }
 Supported PWM channels. More...
 
enum  MiraPwmMode { MIRA_PWM_NORMAL = 0, MIRA_PWM_INVERT = 1 }
 Supported PWM modes. More...
 

Functions

void mira_pwm_init (MiraPwmChannel channel, MiraPwmMode mode, uint32_t period_counts, uint32_t active_counts)
 Initialize the PWM driver. More...
 
void mira_pwm_set (MiraPwmChannel channel, uint32_t period_counts, uint32_t active_counts)
 Updates PWM for a channel. More...
 
void mira_pwm_start (MiraPwmChannel channel)
 Start the PWM channel. More...
 
void mira_pwm_stop (MiraPwmChannel channel)
 Stop the PWM channel. More...
 

Detailed Description

MiraOS PWM driver.

Author
LumenRadio AB
Date
17 Jan 2016 The MiraOS library provides functions for controlling the Mira radio module, sending/receiving messages, controlling peripherals, etc.
See also
http://docs.lumenrad.io/mira

Enumeration Type Documentation

Supported PWM channels.

Enumerator
MIRA_PWM_A 

PWM channel A

MIRA_PWM_B 

PWM channel B

Supported PWM modes.

Enumerator
MIRA_PWM_NORMAL 

Normal: pulse is at the beginning of the period

MIRA_PWM_INVERT 

Inverted: pulse is at the end of the period

Function Documentation

void mira_pwm_init ( MiraPwmChannel  channel,
MiraPwmMode  mode,
uint32_t  period_counts,
uint32_t  active_counts 
)

Initialize the PWM driver.

Parameters
channelPWM channel to set up
modePWM mode: normal/inverted
period_countsPeriod cycle in 16MHz ticks
active_countsActive period in 16MHz ticks
Returns
void
void mira_pwm_set ( MiraPwmChannel  channel,
uint32_t  period_counts,
uint32_t  active_counts 
)

Updates PWM for a channel.

Parameters
channelPWM channel to set up
period_countsPeriod cycle in 16MHz ticks
active_countsActive period in 16MHz ticks
Returns
void
void mira_pwm_start ( MiraPwmChannel  channel)

Start the PWM channel.

Parameters
channelPWM channel to start
Returns
void
void mira_pwm_stop ( MiraPwmChannel  channel)

Stop the PWM channel.

Parameters
channelPWM channel to stop
Returns
void