Files
RP2350_MIDI_Lighter/Firmware/PWM.h
Chris 128d42c586 - Fixed drawing of round objects (Circles, Rounded Rects) using a lookup table
- Added function to read out the display_buffer via USB-Serial
 - Added basic structure and files for later complete firmware (still in progress)
 - Added Doc folder with schematic in it
 - Added Python script and batch file to read out the display buffer and open the image in gimp
2025-09-07 08:55:39 +02:00

39 lines
1005 B
C

/*
* 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_ */