![]() |
Contiki-NG
|
Driver for a Generic Servo actuator. More...
Files | |
| file | servo.c |
| Driver for a generic Servo driver. | |
| file | servo.h |
| Header file for a Generic Servo driver. | |
Servo public funtions | |
| int | servo_position (uint16_t gptab, uint8_t port, uint8_t pin, uint16_t pos) |
| Configures and positions a servo in a given position (by degrees) The servo will lock its position as long as it is not stopped. More... | |
| int | servo_stop (uint16_t gptab, uint8_t port, uint8_t pin) |
| Fully stop a servo and reconfigures back the pin/port as GPIO. More... | |
Servo general constants | |
| #define | SERVO_SUCCESS 0 |
| #define | SERVO_ERROR (-1) |
Driver for a Generic Servo actuator.
| int servo_position | ( | uint16_t | gptab, |
| uint8_t | port, | ||
| uint8_t | pin, | ||
| uint16_t | pos | ||
| ) |
Configures and positions a servo in a given position (by degrees) The servo will lock its position as long as it is not stopped.
| gptab | Servo channel (PWM GPT from 1-7) |
| port | Port number to use as PWM |
| pin | Pin number to use as PWM |
| pos | Position to map the servo to (0-360ยบ, integer) |
SERVO_SUCCESS if successful, else SERVO_ERROR Definition at line 55 of file servo.c.
References count, SERVO_CHANNEL_1, and SERVO_CHANNEL_7.
| int servo_stop | ( | uint16_t | gptab, |
| uint8_t | port, | ||
| uint8_t | pin | ||
| ) |
Fully stop a servo and reconfigures back the pin/port as GPIO.
| gptab | Servo channel (PWM GPT from 1-7) |
| port | Port number to use as PWM |
| pin | Pin number to use as PWM |
SERVO_SUCCESS if successful, else SERVO_ERROR Definition at line 105 of file servo.c.
References SERVO_CHANNEL_1, and SERVO_CHANNEL_7.