Modules | |
SPWM configuration | |
SPWM library variables | |
Variable type for main counter. | |
Macros | |
#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... | |
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... | |
Internal generation macros | |
#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... | |
Driver for generating software PWM outputs. This driver needs just fast interrupts from timer. All outputs are generated in software. Becouse it is rather slow its main usage area would be a light driving.
#define SPWM_HOTPINS EPPL_PROCESSEVERYARG(SPWM_PIN_HOTPINS_GENERATE, com, SPWM_OUTPUTS_ALL) |
SPWM HOTPINS.
Use this constant for EPPL_HOTPINS constant There are listed all pins reconfigurations that may happen inside SPWM library.
#define SPWM_PIN_HOTPIN | ( | pin, | |
off, | |||
on | |||
) | EPPL_SR(pin, off, on) |
Macro used for hotpin.
Macro that takes one PWM output configuration and then changes it to EPPL reinit balue. To be used in EPPL_HOTPINS
#define SPWM_PIN_HOTPINS_GENERATE | ( | n, | |
arg | |||
) | SPWM_PIN_HOTPIN arg |
Macro used for hotpins generation.
Macro that is used by EPPL_PROCESSEVERYARG to generate posible reconfiguration of all defined outputs.
#define SPWM_PIN_ONRESET | ( | pin, | |
off, | |||
on | |||
) |
Macro used on counter reset.
Macro used for code generation for single pin when main counter is reset.
#define SPWM_PIN_ONRESET_GENERATE | ( | n, | |
arg | |||
) | SPWM_PIN_ONRESET arg |
Macro used for code generation for all pins on counter reset.
Macro is used by EPPL_REPEATONEVERYARG to generate code on main counter reset.
#define SPWM_PIN_ONTICK | ( | pin, | |
off, | |||
on | |||
) |
#define SPWM_PIN_ONTICK_GENERATE | ( | n, | |
arg | |||
) | SPWM_PIN_ONTICK arg |
Macro used for code generation for all pins on timer tick.
Macro is used by EPPL_REPEATONEVERYARG to generate code on every tick but the one when counter is reset.
#define SPWM_PIN_SC | ( | pin, | |
off, | |||
on | |||
) | EPPL_SC(pin, off) |
Macro used for pin config.
Macro that takes one PWM output configuration and then changes it to EPPL config value. To be used in eppl_init.
#define SPWM_PIN_SC_GENERATE | ( | n, | |
arg | |||
) | SPWM_PIN_SC arg |
Macro used for pin config generation.
Macro that is used by EPPL_PROCESSEVERYARG to generate configuration of all defined outputs.
#define SPWM_PINCONFIG EPPL_PROCESSEVERYARG(SPWM_PIN_SC_GENERATE, com, SPWM_OUTPUTS_ALL) |
SPWM pin initialization data.
Use this constant for eppl_init function in your main code.
Example:
|
inlinestatic |
Function to be called on every tick.
Function that has to be called on timer tick.
|
inlinestatic |
Function that sets value for selected channel.
Function sets the value on channel.
ch | Channel index to set |
val | Value to set on selected channel. |
|
inlinestatic |
Function that sets value for selected channel from ISR.
Function sets the value on channel from ISR. From ISR we do not have to worry about operation to be atomic.
ch | Channel index to set |
val | Value to set on selected channel. |