33 lines
836 B
C
33 lines
836 B
C
#ifndef PWM_H
|
|
#define PWM_H
|
|
|
|
#include <avr/io.h>
|
|
#include "i2c.h"
|
|
|
|
extern float pwm_frequency;
|
|
extern uint8_t pwm_duty_cycle;
|
|
|
|
extern volatile uint8_t pwm_enabled;
|
|
extern volatile uint8_t pwm_changed;
|
|
|
|
void pwm_enable();
|
|
void pwm_disable();
|
|
void setPWMFrequency(float frequency);
|
|
void setPWMDutyCycle(float duty_cycle);
|
|
void pwm_check_state();
|
|
void pwm_set_frequency(float frequency);
|
|
void pwm_set_duty_cycle(float duty_cycle);
|
|
|
|
void enablePWM();
|
|
void disablePWM();
|
|
void increaseFrequency();
|
|
void decreaseFrequency();
|
|
void increaseDutyCycle();
|
|
void decreaseDutyCycle();
|
|
void checkButton(uint8_t pin, const char* message, void (*command)());
|
|
void sendCommand(uint8_t cmd, float value);
|
|
void sendCommandOneByte(uint8_t cmd);
|
|
void sendCommandTwoBytes(uint8_t cmd, float value);
|
|
void sendCommandThreeBytes(uint8_t cmd, float value);
|
|
|
|
#endif |