circuitpython/ports/esp8266/esppwm.h
Olivier Ortigues 5c83d05b49 esp8266/esppwm: Clip negative duty numbers to 0.
Prior to this patch a negative duty would lead to full PWM.
2018-02-15 11:12:41 +11:00

18 lines
497 B
C

#ifndef MICROPY_INCLUDED_ESP8266_ESPPWM_H
#define MICROPY_INCLUDED_ESP8266_ESPPWM_H
#include <stdbool.h>
#include <stdint.h>
void pwm_init(void);
void pwm_start(void);
void pwm_set_duty(int16_t duty, uint8_t channel);
uint16_t pwm_get_duty(uint8_t channel);
void pwm_set_freq(uint16_t freq, uint8_t channel);
uint16_t pwm_get_freq(uint8_t channel);
int pwm_add(uint8_t pin_id, uint32_t pin_mux, uint32_t pin_func);
bool pwm_delete(uint8_t channel);
#endif // MICROPY_INCLUDED_ESP8266_ESPPWM_H