rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
out_pwm_map.h
Go to the documentation of this file.
1
26
27#ifndef RCBENCH_OUT_PWM_MAP_H
28#define RCBENCH_OUT_PWM_MAP_H
29
30#include <stdbool.h>
31#include <stdint.h>
32
33#ifdef __cplusplus
34extern "C" {
35#endif
36
38#define OUT_PWM_SLICES 12u
39#define OUT_PWM_CHANNELS 2u
40
48#define OUT_PWM_GPIOS 48u
49
53#define OUT_PWM_NONE 0xFFu
54
61uint8_t out_pwm_slice_of(uint8_t pin);
62
71uint8_t out_pwm_channel_of(uint8_t pin);
72
85bool out_pwm_same_slice(uint8_t a, uint8_t b);
86
100bool out_pwm_same_compare(uint8_t a, uint8_t b);
101
107#define OUT_PWM_TICK_HZ 1000000u
108
129uint16_t out_pwm_pulse_max(uint16_t rate_hz);
130
131#ifdef __cplusplus
132}
133#endif
134
135#endif /* RCBENCH_OUT_PWM_MAP_H */
bool out_pwm_same_compare(uint8_t a, uint8_t b)
Whether two GPIOs are driven from one compare register.
Definition out_pwm_map.c:37
bool out_pwm_same_slice(uint8_t a, uint8_t b)
Whether two GPIOs count against one wrap register.
Definition out_pwm_map.c:31
uint16_t out_pwm_pulse_max(uint16_t rate_hz)
The longest pulse a frame of rate_hz carries, in microseconds: the frame's last count,...
Definition out_pwm_map.c:43
uint8_t out_pwm_slice_of(uint8_t pin)
The slice pin is wired to, or OUT_PWM_NONE.
Definition out_pwm_map.c:12
uint8_t out_pwm_channel_of(uint8_t pin)
Which of that slice's channels: 0 is A, 1 is B.
Definition out_pwm_map.c:23