14 #ifdef EV3_TACHO_IMPLEMENT 15 #define EV3_TACHO_VAR( decl ) \ 17 #define EV3_TACHO_VAR_INIT( decl, ... ) \ 23 #define EV3_TACHO_VAR( decl ) \ 25 #define EV3_TACHO_VAR_INIT( decl, ... ) \ 28 #if __GNUC__ && !__GNUC_STDC_INLINE__ 29 #define EV3_TACHO_INL \ 32 #define EV3_TACHO_INL \ 54 #define TACHO_DIR "/sys/class/tacho-motor" 66 #define TACHO_DESC__LIMIT_ DESC_LIMIT 68 #define TACHO__NONE_ TACHO_DESC__LIMIT_ 73 EV3_TACHO_VAR( EV3_TACHO ev3_tacho[ TACHO_DESC__LIMIT_ ] ); 79 TACHO_TYPE__NONE_ = 0,
93 TACHO_COMMAND__NONE_ = 0,
111 TACHO_POLARITY__NONE_ = 0,
124 TACHO_STOP_ACTION__NONE_ = 0,
138 TACHO_STATE__NONE_ = 0,
140 TACHO_RUNNING = 0x1L,
141 TACHO_RAMPING = 0x2L,
142 TACHO_HOLDING = 0x4L,
143 TACHO_OVERLOADED = 0x8L,
144 TACHO_STALLED = 0x10L,
851 #undef EV3_TACHO_VAR_INIT size_t multi_set_tacho_polarity(uint8_t *sn, char *value)
Write "polarity" attribute of several tachos.
Definition: ev3_tacho.c:239
size_t multi_set_tacho_hold_pid_Kd(uint8_t *sn, int value)
Write "hold_pid/Kd" attribute of several tachos.
Definition: ev3_tacho.c:162
size_t get_tacho_speed_pid_Kp(uint8_t sn, int *buf)
Read "speed_pid/Kp" attribute of the tacho.
Definition: ev3_tacho.c:392
size_t multi_set_tacho_position(uint8_t *sn, int value)
Write "position" attribute of several tachos.
Definition: ev3_tacho.c:262
size_t set_tacho_speed_sp(uint8_t sn, int value)
Write "speed_sp" attribute of the tacho.
Definition: ev3_tacho.c:423
size_t set_tacho_hold_pid_Kd(uint8_t sn, int value)
Write "hold_pid/Kd" attribute of the tacho.
Definition: ev3_tacho.c:154
size_t get_tacho_speed_pid_Kd(uint8_t sn, int *buf)
Read "speed_pid/Kd" attribute of the tacho.
Definition: ev3_tacho.c:346
size_t set_tacho_ramp_down_sp(uint8_t sn, int value)
Write "ramp_down_sp" attribute of the tacho.
Definition: ev3_tacho.c:300
size_t get_tacho_polarity(uint8_t sn, char *buf, size_t sz)
Read "polarity" attribute of the tacho.
Definition: ev3_tacho.c:223
size_t get_tacho_driver_name(uint8_t sn, char *buf, size_t sz)
Read "driver_name" attribute of the tacho.
Definition: ev3_tacho.c:107
size_t get_tacho_commands(uint8_t sn, char *buf, size_t sz)
Read "commands" attribute of the tacho.
Definition: ev3_tacho.c:75
INX_T get_tacho_stop_action_inx(uint8_t sn)
Read "stop_action" attribute of the tacho and get the index.
Definition: ev3_tacho.c:685
size_t multi_set_tacho_command_inx(uint8_t *sn, INX_T command_inx)
Write "command" attribute of several tachos by the index.
Definition: ev3_tacho.c:632
EV3_TACHO * ev3_tacho_desc(uint8_t sn)
Get descriptor of the tacho.
Definition: ev3_tacho.c:542
size_t get_tacho_max_speed(uint8_t sn, int *buf)
Read "max_speed" attribute of the tacho.
Definition: ev3_tacho.c:215
size_t get_tacho_desc(uint8_t sn, EV3_TACHO *desc)
Read tacho attributes that are required for filling the descriptor.
Definition: ev3_tacho.c:527
size_t set_tacho_polarity_inx(uint8_t sn, INX_T polarity_inx)
Write "polarity" attribute of the tacho by the index.
Definition: ev3_tacho.c:661
size_t get_tacho_duty_cycle_sp(uint8_t sn, int *buf)
Read "duty_cycle_sp" attribute of the tacho.
Definition: ev3_tacho.c:123
size_t get_tacho_state_flags(uint8_t sn, FLAGS_T *flags)
Read "state" attribute of the tacho and get the flags.
Definition: ev3_tacho.c:708
size_t set_tacho_ramp_up_sp(uint8_t sn, int value)
Write "ramp_up_sp" attribute of the tacho.
Definition: ev3_tacho.c:323
size_t multi_set_tacho_speed_pid_Ki(uint8_t *sn, int value)
Write "speed_pid/Ki" attribute of several tachos.
Definition: ev3_tacho.c:385
size_t multi_set_tacho_ramp_down_sp(uint8_t *sn, int value)
Write "ramp_down_sp" attribute of several tachos.
Definition: ev3_tacho.c:308
uint8_t extport
Definition: ev3_tacho.h:62
size_t multi_set_tacho_speed_pid_Kp(uint8_t *sn, int value)
Write "speed_pid/Kp" attribute of several tachos.
Definition: ev3_tacho.c:408
uint8_t ev3_tacho_desc_extport(uint8_t sn)
Get extended port from the tacho descriptor.
Definition: ev3_tacho.c:558
size_t get_tacho_full_travel_count(uint8_t sn, int *buf)
Read "full_travel_count" attribute of the tacho.
Definition: ev3_tacho.c:99
Definition: ev3_tacho.h:130
bool ev3_search_tacho(INX_T type_inx, uint8_t *sn, uint8_t from)
Search of a sequence number of the specified tacho type.
Definition: ev3_tacho.c:568
Definition: ev3_tacho.h:116
size_t set_tacho_time_sp(uint8_t sn, int value)
Write "time_sp" attribute of the tacho.
Definition: ev3_tacho.c:485
size_t get_tacho_speed_sp(uint8_t sn, int *buf)
Read "speed_sp" attribute of the tacho.
Definition: ev3_tacho.c:415
size_t get_tacho_hold_pid_Kd(uint8_t sn, int *buf)
Read "hold_pid/Kd" attribute of the tacho.
Definition: ev3_tacho.c:146
size_t multi_set_tacho_speed_pid_Kd(uint8_t *sn, int value)
Write "speed_pid/Kd" attribute of several tachos.
Definition: ev3_tacho.c:362
size_t set_tacho_position_sp(uint8_t sn, int value)
Write "position_sp" attribute of the tacho.
Definition: ev3_tacho.c:277
size_t set_tacho_command(uint8_t sn, char *value)
Write "command" attribute of the tacho.
Definition: ev3_tacho.c:60
INX_T get_tacho_polarity_inx(uint8_t sn)
Read "polarity" attribute of the tacho and get the index.
Definition: ev3_tacho.c:649
size_t get_tacho_position_sp(uint8_t sn, int *buf)
Read "position_sp" attribute of the tacho.
Definition: ev3_tacho.c:269
size_t set_tacho_speed_pid_Ki(uint8_t sn, int value)
Write "speed_pid/Ki" attribute of the tacho.
Definition: ev3_tacho.c:377
size_t multi_set_tacho_stop_action_inx(uint8_t *sn, INX_T stop_action_inx)
Write "stop_action" attribute of several tachos by the index.
Definition: ev3_tacho.c:703
INX_T type_inx
Definition: ev3_tacho.h:60
size_t set_tacho_hold_pid_Kp(uint8_t sn, int value)
Write "hold_pid/Kp" attribute of the tacho.
Definition: ev3_tacho.c:200
size_t get_tacho_count_per_rot(uint8_t sn, int *buf)
Read "count_per_rot" attribute of the tacho.
Definition: ev3_tacho.c:83
size_t multi_set_tacho_time_sp(uint8_t *sn, int value)
Write "time_sp" attribute of several tachos.
Definition: ev3_tacho.c:493
size_t set_tacho_speed_pid_Kd(uint8_t sn, int value)
Write "speed_pid/Kd" attribute of the tacho.
Definition: ev3_tacho.c:354
size_t multi_set_tacho_hold_pid_Kp(uint8_t *sn, int value)
Write "hold_pid/Kp" attribute of several tachos.
Definition: ev3_tacho.c:208
size_t get_tacho_state(uint8_t sn, char *buf, size_t sz)
Read "state" attribute of the tacho.
Definition: ev3_tacho.c:438
size_t set_tacho_hold_pid_Ki(uint8_t sn, int value)
Write "hold_pid/Ki" attribute of the tacho.
Definition: ev3_tacho.c:177
size_t get_tacho_ramp_down_sp(uint8_t sn, int *buf)
Read "ramp_down_sp" attribute of the tacho.
Definition: ev3_tacho.c:292
Definition: ev3_tacho.h:85
const char * ev3_tacho_polarity(INX_T polarity_inx)
Get name of the specified tacho polarity.
Definition: ev3_tacho.c:637
size_t multi_set_tacho_hold_pid_Ki(uint8_t *sn, int value)
Write "hold_pid/Ki" attribute of several tachos.
Definition: ev3_tacho.c:185
size_t get_tacho_stop_actions(uint8_t sn, char *buf, size_t sz)
Read "stop_actions" attribute of the tacho.
Definition: ev3_tacho.c:469
size_t get_tacho_count_per_m(uint8_t sn, int *buf)
Read "count_per_m" attribute of the tacho.
Definition: ev3_tacho.c:91
size_t get_tacho_speed(uint8_t sn, int *buf)
Read "speed" attribute of the tacho.
Definition: ev3_tacho.c:338
Structure of a tacho descriptor.
Definition: ev3_tacho.h:59
size_t set_tacho_polarity(uint8_t sn, char *value)
Write "polarity" attribute of the tacho.
Definition: ev3_tacho.c:231
size_t set_tacho_stop_action_inx(uint8_t sn, INX_T stop_action_inx)
Write "stop_action" attribute of the tacho by the index.
Definition: ev3_tacho.c:698
uint8_t ev3_tacho_desc_port(uint8_t sn)
Get EV3 port from the tacho descriptor.
Definition: ev3_tacho.c:553
size_t set_tacho_duty_cycle_sp(uint8_t sn, int value)
Write "duty_cycle_sp" attribute of the tacho.
Definition: ev3_tacho.c:131
INX_T ev3_tacho_desc_type_inx(uint8_t sn)
Get type from the tacho descriptor.
Definition: ev3_tacho.c:548
const char * ev3_tacho_type(INX_T type_inx)
Get name of the specified tacho type.
Definition: ev3_tacho.c:500
size_t get_tacho_position(uint8_t sn, int *buf)
Read "position" attribute of the tacho.
Definition: ev3_tacho.c:246
size_t get_tacho_hold_pid_Kp(uint8_t sn, int *buf)
Read "hold_pid/Kp" attribute of the tacho.
Definition: ev3_tacho.c:192
size_t get_tacho_speed_pid_Ki(uint8_t sn, int *buf)
Read "speed_pid/Ki" attribute of the tacho.
Definition: ev3_tacho.c:369
size_t multi_set_tacho_ramp_up_sp(uint8_t *sn, int value)
Write "ramp_up_sp" attribute of several tachos.
Definition: ev3_tacho.c:331
const char * ev3_tacho_command(INX_T command_inx)
Get name of the specified tacho command.
Definition: ev3_tacho.c:605
char * ev3_tacho_port_name(uint8_t sn, char *buf)
Assemble EV3 port name from the tacho descriptor.
Definition: ev3_tacho.c:563
size_t multi_set_tacho_speed_sp(uint8_t *sn, int value)
Write "speed_sp" attribute of several tachos.
Definition: ev3_tacho.c:431
size_t set_tacho_position(uint8_t sn, int value)
Write "position" attribute of the tacho.
Definition: ev3_tacho.c:254
INX_T get_tacho_type_inx(uint8_t sn)
Read "driver_name" attribute and get index of the tacho type.
Definition: ev3_tacho.c:514
const char * ev3_tacho_stop_action(INX_T stop_action_inx)
Get name of the specified tacho stop_action.
Definition: ev3_tacho.c:671
size_t set_tacho_speed_pid_Kp(uint8_t sn, int value)
Write "speed_pid/Kp" attribute of the tacho.
Definition: ev3_tacho.c:400
size_t multi_set_tacho_position_sp(uint8_t *sn, int value)
Write "position_sp" attribute of several tachos.
Definition: ev3_tacho.c:285
size_t get_tacho_hold_pid_Ki(uint8_t sn, int *buf)
Read "hold_pid/Ki" attribute of the tacho.
Definition: ev3_tacho.c:169
size_t get_tacho_time_sp(uint8_t sn, int *buf)
Read "time_sp" attribute of the tacho.
Definition: ev3_tacho.c:477
size_t set_tacho_command_inx(uint8_t sn, INX_T command_inx)
Write "command" attribute of the tacho by the index.
Definition: ev3_tacho.c:627
int ev3_tacho_init(void)
Detect connected tachos.
Definition: ev3_tacho.c:728
size_t multi_set_tacho_duty_cycle_sp(uint8_t *sn, int value)
Write "duty_cycle_sp" attribute of several tachos.
Definition: ev3_tacho.c:139
uint8_t port
Definition: ev3_tacho.h:61
size_t set_tacho_stop_action(uint8_t sn, char *value)
Write "stop_action" attribute of the tacho.
Definition: ev3_tacho.c:454
size_t get_tacho_ramp_up_sp(uint8_t sn, int *buf)
Read "ramp_up_sp" attribute of the tacho.
Definition: ev3_tacho.c:315
Definition: ev3_tacho.h:103
size_t multi_set_tacho_stop_action(uint8_t *sn, char *value)
Write "stop_action" attribute of several tachos.
Definition: ev3_tacho.c:462
size_t get_tacho_duty_cycle(uint8_t sn, int *buf)
Read "duty_cycle" attribute of the tacho.
Definition: ev3_tacho.c:115
bool ev3_search_tacho_plugged_in(uint8_t port, uint8_t extport, uint8_t *sn, uint8_t from)
Search of a sequence number the tacho by plug-in attributes.
Definition: ev3_tacho.c:583
size_t multi_set_tacho_command(uint8_t *sn, char *value)
Write "command" attribute of several tachos.
Definition: ev3_tacho.c:68
size_t get_tacho_stop_action(uint8_t sn, char *buf, size_t sz)
Read "stop_action" attribute of the tacho.
Definition: ev3_tacho.c:446
size_t multi_set_tacho_polarity_inx(uint8_t *sn, INX_T polarity_inx)
Write "polarity" attribute of several tachos by the index.
Definition: ev3_tacho.c:666
size_t get_tacho_address(uint8_t sn, char *buf, size_t sz)
Read "address" attribute of the tacho.
Definition: ev3_tacho.c:52