25 #include "generated/airframe.h"
31 #define PWMMR_SERV0 PWMMR5
32 #define PWMMR_SERV1 PWMMR2
33 #define PWMLER_LATCH_SERV0 PWMLER_LATCH5
34 #define PWMLER_LATCH_SERV1 PWMLER_LATCH2
35 #define PWMMCR_MRI_SERV0 PWMMCR_MR5I
36 #define PWMMCR_MRI_SERV1 PWMMCR_MR2I
37 #define PWMPCR_ENA_SERV0 PWMPCR_ENA5
38 #define PWMPCR_ENA_SERV1 PWMPCR_ENA2
39 #define PWMIR_MRI_SERV0 PWMIR_MR5I
40 #define PWMIR_MRI_SERV1 PWMIR_MR2I
43 #define PWM_VIC_SLOT 3
56 IO0DIR |= _BV(SERV0_CLOCK_PIN);
57 IO1DIR |= _BV(SERV0_DATA_PIN) | _BV(SERV0_RESET_PIN);
58 IO0DIR |= _BV(SERV1_CLOCK_PIN);
59 IO1DIR |= _BV(SERV1_DATA_PIN) | _BV(SERV1_RESET_PIN);
61 SERV0_CLOCK_PINSEL |= SERV0_CLOCK_PINSEL_VAL << SERV0_CLOCK_PINSEL_BIT;
62 SERV1_CLOCK_PINSEL |= SERV1_CLOCK_PINSEL_VAL << SERV1_CLOCK_PINSEL_BIT;
76 PWMPR = PWM_PRESCALER - 1;
94 #define SERVO_REFRESH_TICS SERVOS_TICS_OF_USEC(25000)
105 IO1CLR = _BV(SERV0_RESET_PIN);
107 IO1SET = _BV(SERV0_DATA_PIN);
120 IO1CLR = _BV(SERV0_DATA_PIN);
127 IO1SET = _BV(SERV1_RESET_PIN);
129 IO1CLR = _BV(SERV1_RESET_PIN);
131 IO1SET = _BV(SERV1_DATA_PIN);
146 IO1CLR = _BV(SERV1_DATA_PIN);
153 IO1SET = _BV(SERV1_RESET_PIN);
uint16_t servos_values[_4015_NB_CHANNELS]
#define SERVOS_TICS_OF_USEC(s)
static uint8_t servos_idx
#define SERVO_REFRESH_TICS
#define PWMLER_LATCH_SERV1
void actuators_4015_init(void)
#define PWMTCR_COUNTER_ENABLE
#define _4015_NB_CHANNELS
Hardware independent API for actuators (servos, motor controllers).
Architecture independent timing functions.
#define PWMTCR_PWM_ENABLE
static uint32_t servos_delay
#define PWMLER_LATCH_SERV0