Appiko
simple_pwm.h
1 
30 #ifndef CODEBASE_PERIPHERAL_MODULES_SIMPLE_PWM_H_
31 #define CODEBASE_PERIPHERAL_MODULES_SIMPLE_PWM_H_
32 
33 #include "stdint.h"
34 
35 #if SYS_CFG_PRESENT == 1
36 #include "sys_config.h"
37 #endif
38 #ifndef TIMER_USED_SIMPLE_PWM
39 #define TIMER_USED_SIMPLE_PWM 1
40 #endif
41 
43 #define SIMPLE_PWM_TIMER_USED TIMER_USED_SIMPLE_PWM
44 
46 #define SIMPLE_PWM_CC_COUNT CONCAT_3(TIMER, SIMPLE_PWM_TIMER_USED, _CC_NUM)
47 
49 #define SIMPLE_PWM_GPIOTE_START_CH 0
50 
51 #define SIMPLE_PWM_PPI_CHS_USED 6
52 
57 typedef enum
58 {
70 
74 typedef enum
75 {
79  SIMPLE_PWM_MAX_CHANNEL
81 
87 void simple_pwm_init (simple_pwm_timer_freq_t freq,uint32_t max_count);
88 
95 void simple_pwm_channel_setup(simple_pwm_channel_t channel, uint32_t pwm_out_pin,
96  uint32_t value);
97 
101 void simple_pwm_start ();
102 
106 void simple_pwm_stop ();
107 
108 #endif /* CODEBASE_PERIPHERAL_MODULES_SIMPLE_PWM_H_ */
109 
PWM timer frequency of 31250 Hz.
Definition: simple_pwm.h:68
void simple_pwm_init(simple_pwm_timer_freq_t freq, uint32_t max_count)
Function to initiate PWM module with clock frequency and total time of pulse.
Definition: simple_pwm.c:38
simple_pwm_channel_t
Defines for specifying the three PWM channels.
Definition: simple_pwm.h:74
PWM timer frequency of 8 MHz.
Definition: simple_pwm.h:60
void simple_pwm_stop()
Function to stop PWM signals.
Definition: simple_pwm.c:107
PWM timer frequency of 62500 Hz.
Definition: simple_pwm.h:67
PWM timer frequency of 250 kHz.
Definition: simple_pwm.h:65
PWM timer frequency of 500 kHz.
Definition: simple_pwm.h:64
SIMPLE_PWM_CHANNEL2.
Definition: simple_pwm.h:78
PWM timer frequency of 4 MHz.
Definition: simple_pwm.h:61
PWM timer frequency of 16 MHz.
Definition: simple_pwm.h:59
PWM timer frequency of 2 MHz.
Definition: simple_pwm.h:62
void simple_pwm_start()
Function to start PWM signals.
Definition: simple_pwm.c:100
SIMPLE_PWM_CHANNEL0.
Definition: simple_pwm.h:76
PWM timer frequency of 125 kHz.
Definition: simple_pwm.h:66
SIMPLE_PWM_CHANNEL1.
Definition: simple_pwm.h:77
void simple_pwm_channel_setup(simple_pwm_channel_t channel, uint32_t pwm_out_pin, uint32_t value)
Function to setup a channel.
Definition: simple_pwm.c:58
PWM timer frequency of 1 MHz.
Definition: simple_pwm.h:63
simple_pwm_timer_freq_t
Defines for the frequency at which the timer should run for the PWM generation.
Definition: simple_pwm.h:57