EV3 Servo Motors. More...
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
Go to the source code of this file.
Data Structures | |
struct | EV3_SERVO |
Structure of a servo motor descriptor. More... | |
Macros | |
#define | EV3_SERVO_VAR(decl) extern decl |
#define | EV3_SERVO_VAR_INIT(decl, ...) extern decl |
#define | EV3_SERVO_INL inline |
#define | SERVO_DIR "/sys/class/servo-motor" |
#define | SERVO_DESC__LIMIT_ DESC_LIMIT |
#define | SERVO__NONE_ SERVO_DESC__LIMIT_ |
Enumerations | |
enum | { SERVO_TYPE__NONE_ = 0, SERVO_MOTOR, SERVO_TYPE__COUNT_, SERVO_TYPE__UNKNOWN_ = SERVO_TYPE__COUNT_ } |
Identifiers of servo motor types. More... | |
enum | { SERVO_COMMAND__NONE_ = 0, SERVO_RUN, SERVO_FLOAT, SERVO_COMMAND__COUNT_, SERVO_COMMAND__UNKNOWN_ = SERVO_COMMAND__COUNT_ } |
Common identifiers of servo motor "command" attribute. More... | |
enum | { SERVO_POLARITY__NONE_ = 0, SERVO_NORMAL, SERVO_INVERSED, SERVO_POLARITY__COUNT_, SERVO_POLARITY__UNKNOWN_ = SERVO_POLARITY__COUNT_ } |
Common identifiers of servo motor "polarity" attribute. More... | |
enum | { SERVO_STATE__NONE_ = 0, SERVO_RUNNING = 0x1L } |
Common identifiers of servo motor "state" attribute. | |
Functions | |
EV3_SERVO_VAR (EV3_SERVO ev3_servo[SERVO_DESC__LIMIT_]) | |
Vector of servo motor descriptors (filled by ev3_servo_init). | |
size_t | get_servo_address (uint8_t sn, char *buf, size_t sz) |
Read "address" attribute of the servo motor. More... | |
size_t | get_servo_command (uint8_t sn, char *buf, size_t sz) |
Read "command" attribute of the servo motor. More... | |
size_t | set_servo_command (uint8_t sn, char *value) |
Write "command" attribute of the servo motor. More... | |
size_t | multi_set_servo_command (uint8_t *sn, char *value) |
Write "command" attribute of several servo motors. More... | |
size_t | get_servo_driver_name (uint8_t sn, char *buf, size_t sz) |
Read "driver_name" attribute of the servo motor. More... | |
size_t | get_servo_max_pulse_sp (uint8_t sn, int *buf) |
Read "max_pulse_sp" attribute of the servo motor. More... | |
size_t | set_servo_max_pulse_sp (uint8_t sn, int value) |
Write "max_pulse_sp" attribute of the servo motor. More... | |
size_t | multi_set_servo_max_pulse_sp (uint8_t *sn, int value) |
Write "max_pulse_sp" attribute of several servo motors. More... | |
size_t | get_servo_mid_pulse_sp (uint8_t sn, int *buf) |
Read "mid_pulse_sp" attribute of the servo motor. More... | |
size_t | set_servo_mid_pulse_sp (uint8_t sn, int value) |
Write "mid_pulse_sp" attribute of the servo motor. More... | |
size_t | multi_set_servo_mid_pulse_sp (uint8_t *sn, int value) |
Write "mid_pulse_sp" attribute of several servo motors. More... | |
size_t | get_servo_min_pulse_sp (uint8_t sn, int *buf) |
Read "min_pulse_sp" attribute of the servo motor. More... | |
size_t | set_servo_min_pulse_sp (uint8_t sn, int value) |
Write "min_pulse_sp" attribute of the servo motor. More... | |
size_t | multi_set_servo_min_pulse_sp (uint8_t *sn, int value) |
Write "min_pulse_sp" attribute of several servo motors. More... | |
size_t | get_servo_polarity (uint8_t sn, char *buf, size_t sz) |
Read "polarity" attribute of the servo motor. More... | |
size_t | set_servo_polarity (uint8_t sn, char *value) |
Write "polarity" attribute of the servo motor. More... | |
size_t | multi_set_servo_polarity (uint8_t *sn, char *value) |
Write "polarity" attribute of several servo motors. More... | |
size_t | get_servo_position_sp (uint8_t sn, int *buf) |
Read "position_sp" attribute of the servo motor. More... | |
size_t | set_servo_position_sp (uint8_t sn, int value) |
Write "position_sp" attribute of the servo motor. More... | |
size_t | multi_set_servo_position_sp (uint8_t *sn, int value) |
Write "position_sp" attribute of several servo motors. More... | |
size_t | get_servo_rate_sp (uint8_t sn, int *buf) |
Read "rate_sp" attribute of the servo motor. More... | |
size_t | set_servo_rate_sp (uint8_t sn, int value) |
Write "rate_sp" attribute of the servo motor. More... | |
size_t | multi_set_servo_rate_sp (uint8_t *sn, int value) |
Write "rate_sp" attribute of several servo motors. More... | |
size_t | get_servo_state (uint8_t sn, char *buf, size_t sz) |
Read "state" attribute of the servo motor. More... | |
const char * | ev3_servo_type (INX_T type_inx) |
Get name of the specified servo motor type. More... | |
INX_T | get_servo_type_inx (uint8_t sn) |
Read "driver_name" attribute and get index of the servo motor type. More... | |
size_t | get_servo_desc (uint8_t sn, EV3_SERVO *desc) |
Read servo motor attributes that are required for filling the descriptor. More... | |
EV3_SERVO * | ev3_servo_desc (uint8_t sn) |
Get descriptor of the servo motor. More... | |
INX_T | ev3_servo_desc_type_inx (uint8_t sn) |
Get type from the servo motor descriptor. More... | |
uint8_t | ev3_servo_desc_port (uint8_t sn) |
Get EV3 port from the servo motor descriptor. More... | |
uint8_t | ev3_servo_desc_extport (uint8_t sn) |
Get extended port from the servo motor descriptor. More... | |
uint8_t | ev3_servo_desc_addr (uint8_t sn) |
Get I2C address from the servo motor descriptor. More... | |
char * | ev3_servo_port_name (uint8_t sn, char *buf) |
Assemble EV3 port name from the servo motor descriptor. More... | |
bool | ev3_search_servo (INX_T type_inx, uint8_t *sn, uint8_t from) |
Search of a sequence number of the specified servo motor type. More... | |
bool | ev3_search_servo_plugged_in (uint8_t port, uint8_t extport, uint8_t *sn, uint8_t from) |
Search of a sequence number the servo motor by plug-in attributes. More... | |
const char * | ev3_servo_command (INX_T command_inx) |
Get name of the specified servo motor command. More... | |
INX_T | get_servo_command_inx (uint8_t sn) |
Read "command" attribute of the servo motor and get the index. More... | |
size_t | set_servo_command_inx (uint8_t sn, INX_T command_inx) |
Write "command" attribute of the servo motor by the index. More... | |
size_t | multi_set_servo_command_inx (uint8_t *sn, INX_T command_inx) |
Write "command" attribute of several servo motors by the index. More... | |
const char * | ev3_servo_polarity (INX_T polarity_inx) |
Get name of the specified servo motor polarity. More... | |
INX_T | get_servo_polarity_inx (uint8_t sn) |
Read "polarity" attribute of the servo motor and get the index. More... | |
size_t | set_servo_polarity_inx (uint8_t sn, INX_T polarity_inx) |
Write "polarity" attribute of the servo motor by the index. More... | |
size_t | multi_set_servo_polarity_inx (uint8_t *sn, INX_T polarity_inx) |
Write "polarity" attribute of several servo motors by the index. More... | |
size_t | get_servo_state_flags (uint8_t sn, FLAGS_T *flags) |
Read "state" attribute of the servo motor and get the flags. More... | |
int | ev3_servo_init (void) |
Detect connected servo motors. More... | |
EV3 Servo Motors.
(ev3_servo.yu-h)