summaryrefslogtreecommitdiff
path: root/src/detherm
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-04-13 06:16:01 -0700
committerKeith Packard <keithp@keithp.com>2016-04-13 06:20:34 -0700
commitb8a19e83b7b1b8e2a1fcbdd58e41f9f974ae28ff (patch)
tree258a7c88d6ceaa3c8b06849f44d729a3b33d0f65 /src/detherm
parentcfb91ec7ef6ef485d813af96a0f206bb7a2204dd (diff)
altos/detherm: Add servo driver
This just provides commands to test the servo with. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/detherm')
-rw-r--r--src/detherm/Makefile1
-rw-r--r--src/detherm/ao_detherm.c2
-rw-r--r--src/detherm/ao_pins.h16
3 files changed, 15 insertions, 4 deletions
diff --git a/src/detherm/Makefile b/src/detherm/Makefile
index 35df6c96..6b0e0bf8 100644
--- a/src/detherm/Makefile
+++ b/src/detherm/Makefile
@@ -42,6 +42,7 @@ ALTOS_SRC = \
ao_ms5607.c \
ao_convert_pa.c \
ao_pwm.c \
+ ao_servo.c \
ao_task.c \
ao_config.c \
ao_cmd.c \
diff --git a/src/detherm/ao_detherm.c b/src/detherm/ao_detherm.c
index 64dee586..fba9195e 100644
--- a/src/detherm/ao_detherm.c
+++ b/src/detherm/ao_detherm.c
@@ -18,6 +18,7 @@
#include <ao.h>
#include <ao_exti.h>
#include <ao_pwm.h>
+#include <ao_servo.h>
void main(void)
{
@@ -38,6 +39,7 @@ void main(void)
ao_ms5607_init();
// ao_flight_init();
ao_pwm_init();
+ ao_servo_init();
ao_log_init();
ao_report_init();
ao_config_init();
diff --git a/src/detherm/ao_pins.h b/src/detherm/ao_pins.h
index 8cd4a9c4..1c577b6e 100644
--- a/src/detherm/ao_pins.h
+++ b/src/detherm/ao_pins.h
@@ -98,10 +98,18 @@
#define AO_PWM_TIMER_ENABLE STM_RCC_APB1ENR_TIM3EN
#define AO_PWM_TIMER_SCALE 32
-/* Motor */
+/* Servo */
-#define AO_MOTOR_DIR_GPIO (&stm_gpiob)
-#define AO_MOTOR_DIR_PIN 0
-#define AO_MOTOR_SPEED_PWM 0
+#define AO_SERVO_DIR_PORT (&stm_gpiob)
+#define AO_SERVO_DIR_BIT 0
+#define AO_SERVO_SPEED_PWM 0
+
+/* limit 2 */
+#define AO_SERVO_LIMIT_FORE_PORT (&stm_gpiob)
+#define AO_SERVO_LIMIT_FORE_BIT 6
+
+/* limit 1 */
+#define AO_SERVO_LIMIT_BACK_PORT (&stm_gpiob)
+#define AO_SERVO_LIMIT_BACK_BIT 7
#endif /* _AO_PINS_H_ */