1 #ifndef SERVOS_4015_HW_H
2 #define SERVOS_4015_HW_H
14 #if (PCLK == 15000000)
15 #define PWM_PRESCALER 1
18 #if (PCLK == 30000000)
19 #define PWM_PRESCALER 2
22 #if (PCLK == 60000000)
23 #define PWM_PRESCALER 4
26 #error unknown PCLK frequency
31 #define PWM_TICS_OF_USEC(us) (uint32_t)((us) *1e-6 * PCLK / PWM_PRESCALER + 0.5)
33 #define SERVOS_TICS_OF_USEC(s) PWM_TICS_OF_USEC(s)
34 #define ChopServo(x,a,b) Chop(x, a, b)
36 #define _4015_NB_CHANNELS 8
38 #define Actuator4015Set(_i, _v) { servos_values[_i] = SERVOS_TICS_OF_USEC(_v); }
41 #define Actuators4015Commit() {}
42 #define Actuators4015Init() actuators_4015_init()
44 void PWM_ISR(
void) __attribute__((naked));
void actuators_4015_init(void)
#define _4015_NB_CHANNELS
Architecture independent timing functions.
uint16_t servos_values[_4015_NB_CHANNELS]