NavHAL 0.1.0
NAVRobotec's architecture-agnostic HAL for embedded systems.
Loading...
Searching...
No Matches
pwm.h
Go to the documentation of this file.
1
12
13#ifndef PWM_H
14#define PWM_H
15
16#include "utils/timer_types.h"
17#include <stdint.h>
18
22typedef struct {
24 uint32_t channel;
26
34void hal_pwm_init(PWM_Handle *pwm, uint32_t frequency, float dutyCycle);
35
41void hal_pwm_start(PWM_Handle *pwm);
42
48void hal_pwm_stop(PWM_Handle *pwm);
49
56void hal_pwm_set_duty_cycle(PWM_Handle *pwm, float dutyCycle);
57
64void hal_pwm_set_frequency(PWM_Handle *pwm, uint32_t frequency);
65
66#endif // PWM_H
void hal_pwm_stop(PWM_Handle *pwm)
Stop PWM signal generation.
Definition pwm.c:54
void hal_pwm_start(PWM_Handle *pwm)
Start PWM signal generation.
Definition pwm.c:43
void hal_pwm_set_frequency(PWM_Handle *pwm, uint32_t frequency)
Set the PWM frequency.
Definition pwm.c:77
void hal_pwm_set_duty_cycle(PWM_Handle *pwm, float dutyCycle)
Set the PWM duty cycle.
Definition pwm.c:65
void hal_pwm_init(PWM_Handle *pwm, uint32_t frequency, float dutyCycle)
Initialize a PWM handle with the specified frequency and duty cycle.
Definition pwm.c:21
PWM handle structure linking timer and channel.
Definition pwm.h:22
uint32_t channel
Definition pwm.h:24
hal_timer_t timer
Definition pwm.h:23
hal_timer_t
Definition timer_types.h:5