25#ifndef PROTOCORE_PCA9685_H
26#define PROTOCORE_PCA9685_H
30#if PROTOCORE_ENABLE_PCA9685
38#define PCA9685_CHANNELS 16
40#define PCA9685_COUNT_MAX 4095
42#define PCA9685_FULL_ON 0x1000
44#define PCA9685_FULL_OFF 0x1000
46#define PCA9685_REG_MODE1 0x00
48#define PCA9685_REG_MODE2 0x01
50#define PCA9685_REG_LED0_ON_L 0x06
52#define PCA9685_REG_PRESCALE 0xFE
64} Pca9685ChannelRegArgs;
69 uint32_t microseconds;
71} Pca9685UsToCountArgs;
81} Pca9685SetPwmBytesArgs;
102 uint32_t microseconds;
103} Pca9685SetServoUsArgs;
139 Pca9685PrescaleArgs prescale_args;
140 Pca9685ChannelRegArgs channel_reg_args;
141 Pca9685UsToCountArgs us_to_count_args;
142 Pca9685SetPwmBytesArgs set_pwm_bytes_args;
143 Pca9685BeginArgs begin_args;
144 Pca9685SetPwmArgs set_pwm_args;
145 Pca9685SetServoUsArgs set_servo_us_args;
153extern Pca9685Vars Pca9685V;
158 void (*
const prescale)(uint8_t *work);
159 void (*
const channel_reg)(uint8_t *work);
160 void (*
const us_to_count)(uint8_t *work);
161 void (*
const set_pwm_bytes)(uint8_t *work);
162 void (*
const begin)(uint8_t *work);
163 void (*
const set_pwm)(uint8_t *work);
164 void (*
const set_servo_us)(uint8_t *work);
169void protocore_pca9685_prescale(uint8_t *work);
170void protocore_pca9685_channel_reg(uint8_t *work);
171void protocore_pca9685_us_to_count(uint8_t *work);
172void protocore_pca9685_set_pwm_bytes(uint8_t *work);
173void protocore_pca9685_begin(uint8_t *work);
174void protocore_pca9685_set_pwm(uint8_t *work);
175void protocore_pca9685_set_servo_us(uint8_t *work);
181static const Pca9685Ns Pca9685 __attribute__((unused)) = {
182 .prescale = protocore_pca9685_prescale,
183 .channel_reg = protocore_pca9685_channel_reg,
184 .us_to_count = protocore_pca9685_us_to_count,
185 .set_pwm_bytes = protocore_pca9685_set_pwm_bytes,
186 .begin = protocore_pca9685_begin,
187 .set_pwm = protocore_pca9685_set_pwm,
188 .set_servo_us = protocore_pca9685_set_servo_us,
200uint8_t *protocore_pca9685_span(
void);
#define PROTOCORE_BEGIN_DECLS
Give a header's declarations C linkage, so their symbol names carry no parameter types.
_Bool proto_bool
The truth value.
#define PROTOCORE_END_DECLS