- 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
45 lines
1.0 KiB
C
45 lines
1.0 KiB
C
/*
|
|
* PWM.c
|
|
*
|
|
* Created: Sun Mar 21 2021 10:18:09
|
|
* Author Chris
|
|
*/
|
|
#include "PWM.h"
|
|
#include "pico/stdlib.h"
|
|
|
|
|
|
// ============================================================================================
|
|
// Defines
|
|
|
|
|
|
// ============================================================================================
|
|
// Variables
|
|
|
|
|
|
// ============================================================================================
|
|
// Function Declarations
|
|
|
|
|
|
/*******************************************************************
|
|
Functions
|
|
*******************************************************************/
|
|
void PWM_Init_GPIO(uint gpio, bool enabled, float clock_divider)
|
|
{
|
|
gpio_set_function(gpio, GPIO_FUNC_PWM);
|
|
PWM_Set_Enabled(gpio, enabled);
|
|
}
|
|
|
|
void PWM_Set_Enabled(uint gpio, bool enabled)
|
|
{
|
|
pwm_set_enabled(pwm_gpio_to_slice_num(gpio), enabled);
|
|
}
|
|
|
|
void PWM_Set_Top_Value(uint gpio, uint16_t top_value)
|
|
{
|
|
pwm_set_wrap(pwm_gpio_to_slice_num(gpio), top_value);
|
|
}
|
|
|
|
void PWM_Set_Duty_Cycle(uint gpio, uint16_t duty_cycle)
|
|
{
|
|
pwm_set_gpio_level(gpio, duty_cycle);
|
|
} |