EPPL example libraries  0.1 alpha
 All Files Functions Variables Groups Pages
spwm.h File Reference

Header file for Software PWM. More...

#include <stdint.h>
#include <util/atomic.h>
#include "spwm_config.h"
#include "eppl.h"

Go to the source code of this file.

Macros

#define SPWM_OUTPUTS_ALL   (EPPL_NP, 0, 0)
 Configure PWM outputs. More...
 
#define SPWM_TOPCNT   255
 Maksimum internal counter value. More...
 
#define SPWM_PINCONFIG   EPPL_PROCESSEVERYARG(SPWM_PIN_SC_GENERATE, com, SPWM_OUTPUTS_ALL)
 SPWM pin initialization data. More...
 
#define SPWM_HOTPINS   EPPL_PROCESSEVERYARG(SPWM_PIN_HOTPINS_GENERATE, com, SPWM_OUTPUTS_ALL)
 SPWM HOTPINS. More...
 
Internal generation macros

Internal macros used for code generation

#define SPWM_PIN_SC(pin, off, on)   EPPL_SC(pin, off)
 Macro used for pin config. More...
 
#define SPWM_PIN_SC_GENERATE(n, arg)   SPWM_PIN_SC arg
 Macro used for pin config generation. More...
 
#define SPWM_PIN_HOTPIN(pin, off, on)   EPPL_SR(pin, off, on)
 Macro used for hotpin. More...
 
#define SPWM_PIN_HOTPINS_GENERATE(n, arg)   SPWM_PIN_HOTPIN arg
 Macro used for hotpins generation. More...
 
#define SPWM_PIN_ONRESET(pin, off, on)
 Macro used on counter reset. More...
 
#define SPWM_PIN_ONRESET_GENERATE(n, arg)   SPWM_PIN_ONRESET arg
 Macro used for code generation for all pins on counter reset. More...
 
#define SPWM_PIN_ONTICK(pin, off, on)
 Macro used on every tick. More...
 
#define SPWM_PIN_ONTICK_GENERATE(n, arg)   SPWM_PIN_ONTICK arg
 Macro used for code generation for all pins on timer tick. More...
 

Functions

static void spwm_set (uint8_t ch, spwm_val_T val)
 Function that sets value for selected channel. More...
 
static void spwm_set_FromISR (uint8_t ch, spwm_val_T val)
 Function that sets value for selected channel from ISR. More...
 
static void spwm_onTick (void)
 Function to be called on every tick. More...
 

Variables

spwm_val_T spwm_cnt
 Main counter. More...
 
spwm_val_T spwm_val [EPPL_COUNTARGS(SPWM_OUTPUTS_ALL)]
 Channels values. More...
 

Detailed Description

Header file for Software PWM.

file inclusion. So changing EPPL_HOTPINS file you can modify how library compiles.

Author
Radoslaw Koppel <r.koppel@k-el.com>
Date
2014 Uniwersal Software PWM driver. Uses EPPL library.
See Also
<spwm> Software Pulse Width Modulation