fome-fw/firmware/hw_layer/pwm_generator.h

38 lines
894 B
C
Raw Normal View History

2014-08-29 07:52:33 -07:00
/**
* @file pwm_generator.h
*
* @date May 28, 2013
2015-01-12 15:04:10 -08:00
* @author Andrey Belomutskiy, (c) 2012-2015
2014-08-29 07:52:33 -07:00
*/
#ifndef PWM_GENERATOR_H_
#define PWM_GENERATOR_H_
#include "global.h"
#include "pwm_generator_logic.h"
#define DEBUG_PWM FALSE
#include "gpio_helper.h"
2015-01-08 07:03:44 -08:00
void initPwmGenerator(void);
/**
* start a one-channel PWM driver
*/
2015-01-07 17:04:09 -08:00
void startSimplePwm(PwmConfig *state, const char *msg, OutputPin *output,
2014-11-30 12:03:37 -08:00
float dutyCycle, float frequency, pwm_gen_callback *stateChangeCallback);
2015-01-08 07:03:44 -08:00
/**
* initialize GPIO pin and start a one-channel PWM driver
*/
2015-01-07 17:04:09 -08:00
void startSimplePwmExt(PwmConfig *state, const char *msg, brain_pin_e brainPin, OutputPin *output,
2014-11-30 12:03:37 -08:00
float frequency, float dutyCycle, pwm_gen_callback *stateChangeCallback);
2014-08-29 07:52:33 -07:00
2015-01-08 07:03:44 -08:00
/**
* default implementation of pwm_gen_callback which simply toggles the pins
*/
void applyPinState(PwmConfig *state, int stateIndex);
2014-08-29 07:52:33 -07:00
#endif /* PWM_GENERATOR_H_ */