uMIDI
The swiss army knife for quick and easy developement of MIDI applications.
pwm.h
Go to the documentation of this file.
1 
4 /*
5  * Copyright 2012-2015 Sebastian Neuser
6  *
7  * This file is part of the uMIDI firmware.
8  *
9  * The uMIDI firmware is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * The uMIDI firmware is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with the uMIDI firmware. If not, see <http://www.gnu.org/licenses/>.
21  */
22 
23 #ifndef _PWM_H
24 #define _PWM_H
25 
26 
27 //---------------- includes ----------------//
28 #include <stdint.h>
29 
30 #include "lookup_tables.h"
31 
32 
33 //---------------- data types ----------------//
34 
35 
36 //---------------- constants ----------------//
38 #define PWM_MAX_DUTY ((1L << lookup_table_resolution) - 1)
39 
40 
41 //---------------- functions and procedures ----------------//
42 
50 void init_pwm_module(uint16_t (*conversion_function)(midi_value_t value));
51 
52 
59 
60 
61 //---------------- EOF ----------------//
62 #endif // _PWM_H
uint8_t midi_value_t
Type for valid MIDI values [0..127].
Definition: midi.h:56
void init_pwm_module(uint16_t(*conversion_function)(midi_value_t value))
Initializes the PWM.
Definition: pwm.c:46
void set_pwm_duty_cycle(midi_value_t duty)
Updates the PWM duty cycle.
Definition: pwm.c:64
Lookup tables for the uMIDI firmware.