/*
 * PWM.h
 *
 * Created: Sun Mar 21 2021 10:18:06
 *  Author Chris
 */
#ifndef PWM_H_
#define PWM_H_

// ============================================================================================
// Includes
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>

#include "pico/types.h"
#include "hardware/pwm.h"


// ============================================================================================
// Defines
#define PWM_CLOCK_DIV_1		(1.f)
#define PWM_CLOCK_DIV_2		(2.f)
#define PWM_CLOCK_DIV_4		(4.f)
#define PWM_CLOCK_DIV_8		(8.f)
#define PWM_CLOCK_DIV_16	(16.f)

#define PWM_CLOCK_DEFAULT	PWM_CLOCK_DIV_1


// ============================================================================================
// Function Declarations
void PWM_Init_GPIO		(uint gpio, bool enabled, float clock_divider);
void PWM_Set_Enabled	(uint gpio, bool enabled);
void PWM_Set_Top_Value	(uint gpio, uint16_t top_value);
void PWM_Set_Duty_Cycle	(uint gpio, uint16_t duty_cycle);


#endif /* PWM_H_ */