brick.h
Go to the documentation of this file.
1 
2 /* brick.h was generated by yup.py (yupp) 1.0c3
3  out of brick.yu-h
4  */
11 #ifndef BRICK_H
12 #define BRICK_H
13 
14 #ifdef BRICK_IMPLEMENT
15 #define BRICK_VAR( decl ) \
16  decl
17 #define BRICK_VAR_INIT( decl, ... ) \
18  decl = __VA_ARGS__
19 
20 #define BRICK_INL
21 
22 #else /* BRICK_IMPLEMENT */
23 #define BRICK_VAR( decl ) \
24  extern decl
25 #define BRICK_VAR_INIT( decl, ... ) \
26  extern decl
27 
28 #if __GNUC__ && !__GNUC_STDC_INLINE__
29 #define BRICK_INL \
30  extern inline
31 #else
32 #define BRICK_INL \
33  inline
34 #endif
35 
36 #endif /* BRICK_IMPLEMENT */
37 
38 #include <stdint.h>
39 #include <stdbool.h>
40 #include "ev3.h"
41 #include "ev3_port.h"
42 #include "ev3_sensor.h"
43 #include "ev3_tacho.h"
44 #include "ev3_dc.h"
45 
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59 
63 typedef uint8_t POOL_T;
64 
68 enum {
69  SOCKET__NONE_ = 0,
70 
71  IN1 = 0x1L,
72  IN2 = 0x2L,
73  IN3 = 0x4L,
74  IN4 = 0x8L,
75  OUTA = 0x10L,
76  OUTB = 0x20L,
77  OUTC = 0x40L,
78  OUTD = 0x80L,
79 
80 };
81 
87 extern POOL_T port_to_socket( uint8_t port );
88 
94 extern uint8_t socket_to_port( POOL_T sock );
95 
101 extern bool brick_init( void );
102 
106 extern void brick_uninit( void );
107 
112 extern uint8_t brick_keys( void );
113 
121 extern char *sensor_get_address( POOL_T sock, char *buf, size_t sz );
122 
130 extern byte *sensor_get_bin_data( POOL_T sock, byte *buf, size_t sz );
131 
139 extern bool sensor_set_bin_data( POOL_T pool, byte *value, size_t sz );
140 
148 extern char *sensor_get_bin_data_format( POOL_T sock, char *buf, size_t sz );
149 
156 extern bool sensor_set_command( POOL_T pool, INX_T command_inx );
157 
165 extern char *sensor_get_commands( POOL_T sock, char *buf, size_t sz );
166 
174 extern char *sensor_get_direct( POOL_T sock, char *buf, size_t sz );
175 
183 extern bool sensor_set_direct( POOL_T pool, char *value );
184 
191 extern dword sensor_get_decimals( POOL_T sock, dword defval );
192 
200 extern char *sensor_get_driver_name( POOL_T sock, char *buf, size_t sz );
201 
209 extern char *sensor_get_fw_version( POOL_T sock, char *buf, size_t sz );
210 
216 extern INX_T sensor_get_mode( POOL_T sock );
217 
224 extern bool sensor_set_mode( POOL_T pool, INX_T mode_inx );
225 
233 extern char *sensor_get_modes( POOL_T sock, char *buf, size_t sz );
234 
241 extern dword sensor_get_num_values( POOL_T sock, dword defval );
242 
249 extern dword sensor_get_poll_ms( POOL_T sock, dword defval );
250 
258 extern bool sensor_set_poll_ms( POOL_T pool, dword value );
259 
267 extern char *sensor_get_units( POOL_T sock, char *buf, size_t sz );
268 
275 extern float sensor_get_value0( POOL_T sock, float defval );
276 
283 extern float sensor_get_value1( POOL_T sock, float defval );
284 
291 extern float sensor_get_value2( POOL_T sock, float defval );
292 
299 extern float sensor_get_value3( POOL_T sock, float defval );
300 
307 extern float sensor_get_value4( POOL_T sock, float defval );
308 
315 extern float sensor_get_value5( POOL_T sock, float defval );
316 
323 extern float sensor_get_value6( POOL_T sock, float defval );
324 
331 extern float sensor_get_value7( POOL_T sock, float defval );
332 
340 extern char *sensor_get_text_value( POOL_T sock, char *buf, size_t sz );
341 
350 extern int sensor_get_value( uint8_t inx, POOL_T sock, int defval );
351 
357 extern bool us_set_mode_us_dist_cm( POOL_T pool );
358 
364 extern bool us_set_mode_us_dist_in( POOL_T pool );
365 
371 extern bool us_set_mode_us_listen( POOL_T pool );
372 
378 extern bool us_set_mode_us_si_cm( POOL_T pool );
379 
385 extern bool us_set_mode_us_si_in( POOL_T pool );
386 
392 extern bool us_set_mode_us_dc_cm( POOL_T pool );
393 
399 extern bool us_set_mode_us_dc_in( POOL_T pool );
400 
406 extern bool gyro_set_mode_gyro_ang( POOL_T pool );
407 
413 extern bool gyro_set_mode_gyro_rate( POOL_T pool );
414 
420 extern bool gyro_set_mode_gyro_fas( POOL_T pool );
421 
427 extern bool gyro_set_mode_gyro_g_and_a( POOL_T pool );
428 
434 extern bool gyro_set_mode_gyro_cal( POOL_T pool );
435 
441 extern bool color_set_mode_col_reflect( POOL_T pool );
442 
448 extern bool color_set_mode_col_ambient( POOL_T pool );
449 
455 extern bool color_set_mode_col_color( POOL_T pool );
456 
462 extern bool color_set_mode_ref_raw( POOL_T pool );
463 
469 extern bool color_set_mode_rgb_raw( POOL_T pool );
470 
476 extern bool color_set_mode_col_cal( POOL_T pool );
477 
483 extern bool touch_set_mode_touch( POOL_T pool );
484 
490 extern bool ir_set_mode_ir_prox( POOL_T pool );
491 
497 extern bool ir_set_mode_ir_seek( POOL_T pool );
498 
504 extern bool ir_set_mode_ir_remote( POOL_T pool );
505 
511 extern bool ir_set_mode_ir_rem_a( POOL_T pool );
512 
518 extern bool ir_set_mode_ir_s_alt( POOL_T pool );
519 
525 extern bool ir_set_mode_ir_cal( POOL_T pool );
526 
532 extern POOL_T sensor_search( INX_T type_inx );
533 
540 extern bool sensor_is_plugged( POOL_T pool, INX_T type_inx );
541 
549 extern char *tacho_get_address( POOL_T sock, char *buf, size_t sz );
550 
557 extern bool tacho_set_command( POOL_T pool, INX_T command_inx );
558 
566 extern char *tacho_get_commands( POOL_T sock, char *buf, size_t sz );
567 
574 extern int tacho_get_count_per_rot( POOL_T sock, int defval );
575 
582 extern int tacho_get_count_per_m( POOL_T sock, int defval );
583 
590 extern int tacho_get_full_travel_count( POOL_T sock, int defval );
591 
599 extern char *tacho_get_driver_name( POOL_T sock, char *buf, size_t sz );
600 
607 extern int tacho_get_duty_cycle( POOL_T sock, int defval );
608 
615 extern int tacho_get_duty_cycle_sp( POOL_T sock, int defval );
616 
624 extern bool tacho_set_duty_cycle_sp( POOL_T pool, int value );
625 
632 extern int tacho_get_hold_pid_Kd( POOL_T sock, int defval );
633 
641 extern bool tacho_set_hold_pid_Kd( POOL_T pool, int value );
642 
649 extern int tacho_get_hold_pid_Ki( POOL_T sock, int defval );
650 
658 extern bool tacho_set_hold_pid_Ki( POOL_T pool, int value );
659 
666 extern int tacho_get_hold_pid_Kp( POOL_T sock, int defval );
667 
675 extern bool tacho_set_hold_pid_Kp( POOL_T pool, int value );
676 
683 extern int tacho_get_max_speed( POOL_T sock, int defval );
684 
690 extern INX_T tacho_get_polarity( POOL_T sock );
691 
698 extern bool tacho_set_polarity( POOL_T pool, INX_T polarity_inx );
699 
706 extern int tacho_get_position( POOL_T sock, int defval );
707 
715 extern bool tacho_set_position( POOL_T pool, int value );
716 
723 extern int tacho_get_position_sp( POOL_T sock, int defval );
724 
732 extern bool tacho_set_position_sp( POOL_T pool, int value );
733 
740 extern int tacho_get_ramp_down_sp( POOL_T sock, int defval );
741 
749 extern bool tacho_set_ramp_down_sp( POOL_T pool, int value );
750 
757 extern int tacho_get_ramp_up_sp( POOL_T sock, int defval );
758 
766 extern bool tacho_set_ramp_up_sp( POOL_T pool, int value );
767 
774 extern int tacho_get_speed( POOL_T sock, int defval );
775 
782 extern int tacho_get_speed_pid_Kd( POOL_T sock, int defval );
783 
791 extern bool tacho_set_speed_pid_Kd( POOL_T pool, int value );
792 
799 extern int tacho_get_speed_pid_Ki( POOL_T sock, int defval );
800 
808 extern bool tacho_set_speed_pid_Ki( POOL_T pool, int value );
809 
816 extern int tacho_get_speed_pid_Kp( POOL_T sock, int defval );
817 
825 extern bool tacho_set_speed_pid_Kp( POOL_T pool, int value );
826 
833 extern int tacho_get_speed_sp( POOL_T sock, int defval );
834 
842 extern bool tacho_set_speed_sp( POOL_T pool, int value );
843 
849 extern FLAGS_T tacho_get_state( POOL_T sock );
850 
856 extern INX_T tacho_get_stop_action( POOL_T sock );
857 
864 extern bool tacho_set_stop_action( POOL_T pool, INX_T stop_action_inx );
865 
873 extern char *tacho_get_stop_actions( POOL_T sock, char *buf, size_t sz );
874 
881 extern int tacho_get_time_sp( POOL_T sock, int defval );
882 
890 extern bool tacho_set_time_sp( POOL_T pool, int value );
891 
897 extern bool tacho_run_forever( POOL_T pool );
898 
904 extern bool tacho_run_to_abs_pos( POOL_T pool );
905 
911 extern bool tacho_run_to_rel_pos( POOL_T pool );
912 
918 extern bool tacho_run_timed( POOL_T pool );
919 
925 extern bool tacho_run_direct( POOL_T pool );
926 
932 extern bool tacho_stop( POOL_T pool );
933 
939 extern bool tacho_reset( POOL_T pool );
940 
946 extern bool tacho_set_polarity_normal( POOL_T pool );
947 
953 extern bool tacho_set_polarity_inversed( POOL_T pool );
954 
960 extern bool tacho_set_stop_action_coast( POOL_T pool );
961 
967 extern bool tacho_set_stop_action_brake( POOL_T pool );
968 
974 extern bool tacho_set_stop_action_hold( POOL_T pool );
975 
981 extern POOL_T tacho_search( INX_T type_inx );
982 
989 extern bool tacho_is_plugged( POOL_T pool, INX_T type_inx );
990 
996 extern bool tacho_is_running( POOL_T pool );
997 
1005 extern char *dc_get_address( POOL_T sock, char *buf, size_t sz );
1006 
1013 extern bool dc_set_command( POOL_T pool, INX_T command_inx );
1014 
1022 extern char *dc_get_commands( POOL_T sock, char *buf, size_t sz );
1023 
1031 extern char *dc_get_driver_name( POOL_T sock, char *buf, size_t sz );
1032 
1039 extern int dc_get_duty_cycle( POOL_T sock, int defval );
1040 
1047 extern int dc_get_duty_cycle_sp( POOL_T sock, int defval );
1048 
1056 extern bool dc_set_duty_cycle_sp( POOL_T pool, int value );
1057 
1063 extern INX_T dc_get_polarity( POOL_T sock );
1064 
1071 extern bool dc_set_polarity( POOL_T pool, INX_T polarity_inx );
1072 
1078 extern FLAGS_T dc_get_state( POOL_T sock );
1079 
1086 extern bool dc_set_stop_action( POOL_T pool, INX_T stop_action_inx );
1087 
1095 extern char *dc_get_stop_actions( POOL_T sock, char *buf, size_t sz );
1096 
1103 extern int dc_get_ramp_down_sp( POOL_T sock, int defval );
1104 
1112 extern bool dc_set_ramp_down_sp( POOL_T pool, int value );
1113 
1120 extern int dc_get_ramp_up_sp( POOL_T sock, int defval );
1121 
1129 extern bool dc_set_ramp_up_sp( POOL_T pool, int value );
1130 
1137 extern int dc_get_time_sp( POOL_T sock, int defval );
1138 
1146 extern bool dc_set_time_sp( POOL_T pool, int value );
1147 
1153 extern bool dc_run_forever( POOL_T pool );
1154 
1160 extern bool dc_run_timed( POOL_T pool );
1161 
1167 extern bool dc_run_direct( POOL_T pool );
1168 
1174 extern bool dc_stop( POOL_T pool );
1175 
1181 extern bool dc_set_polarity_normal( POOL_T pool );
1182 
1188 extern bool dc_set_polarity_inversed( POOL_T pool );
1189 
1195 extern bool dc_set_stop_action_coast( POOL_T pool );
1196 
1202 extern bool dc_set_stop_action_brake( POOL_T pool );
1203 
1209 extern POOL_T dc_search( INX_T type_inx );
1210 
1217 extern bool dc_is_plugged( POOL_T pool, INX_T type_inx );
1218 
1224 extern bool dc_is_running( POOL_T pool );
1225 
1230 extern void sleep_ms( uint32_t ms );
1231 
1232 #ifdef __cplusplus
1233 }
1234 #endif
1235 
1238 #undef BRICK_VAR
1239 #undef BRICK_VAR_INIT
1240 #undef BRICK_INL
1241 #endif
1242 
bool tacho_set_polarity_inversed(POOL_T pool)
Set "inversed" polarity for tachos.
Definition: brick.c:1077
bool tacho_set_stop_action_hold(POOL_T pool)
Set "hold" stop_action for tachos.
Definition: brick.c:1092
bool us_set_mode_us_si_cm(POOL_T pool)
Set "US_SI_CM" mode for lego_ev3_us sensors.
Definition: brick.c:431
bool dc_run_timed(POOL_T pool)
Set "run_timed" command for DC motors.
Definition: brick.c:1362
INX_T tacho_get_polarity(POOL_T sock)
Get value (index) of "polarity" attribute of the tacho.
Definition: brick.c:776
float sensor_get_value4(POOL_T sock, float defval)
Get value of "value4" attribute of the sensor.
Definition: brick.c:351
FLAGS_T dc_get_state(POOL_T sock)
Get value (flags) of "state" attribute of the DC motor.
Definition: brick.c:1263
float sensor_get_value0(POOL_T sock, float defval)
Get value of "value0" attribute of the sensor.
Definition: brick.c:307
POOL_T sensor_search(INX_T type_inx)
Search of the specified sensor type.
Definition: brick.c:541
bool dc_set_command(POOL_T pool, INX_T command_inx)
Set value of "command" attribute of DC motors.
Definition: brick.c:1181
bool ir_set_mode_ir_rem_a(POOL_T pool)
Set "IR_REM_A" mode for lego_ev3_ir sensors.
Definition: brick.c:526
bool tacho_set_stop_action_coast(POOL_T pool)
Set "coast" stop_action for tachos.
Definition: brick.c:1082
bool tacho_run_to_rel_pos(POOL_T pool)
Set "run_to_rel_pos" command for tachos.
Definition: brick.c:1047
int tacho_get_count_per_rot(POOL_T sock, int defval)
Get value of "count_per_rot" attribute of the tacho.
Definition: brick.c:627
bool tacho_set_time_sp(POOL_T pool, int value)
Set value of "time_sp" attribute of tachos.
Definition: brick.c:1027
bool gyro_set_mode_gyro_rate(POOL_T pool)
Set "GYRO_RATE" mode for lego_ev3_gyro sensors.
Definition: brick.c:456
float sensor_get_value1(POOL_T sock, float defval)
Get value of "value1" attribute of the sensor.
Definition: brick.c:318
POOL_T tacho_search(INX_T type_inx)
Search of the specified tacho type.
Definition: brick.c:1097
uint8_t POOL_T
Type of a pool of input or output sockets.
Definition: brick.h:63
int tacho_get_hold_pid_Kd(POOL_T sock, int defval)
Get value of "hold_pid/Kd" attribute of the tacho.
Definition: brick.c:702
int tacho_get_full_travel_count(POOL_T sock, int defval)
Get value of "full_travel_count" attribute of the tacho.
Definition: brick.c:649
bool tacho_set_stop_action_brake(POOL_T pool)
Set "brake" stop_action for tachos.
Definition: brick.c:1087
bool tacho_is_plugged(POOL_T pool, INX_T type_inx)
Check that tachos of the specified type are plugged into specified sockets.
Definition: brick.c:1108
EV3 Sensors.
FLAGS_T tacho_get_state(POOL_T sock)
Get value (flags) of "state" attribute of the tacho.
Definition: brick.c:975
bool ir_set_mode_ir_remote(POOL_T pool)
Set "IR_REMOTE" mode for lego_ev3_ir sensors.
Definition: brick.c:521
bool dc_stop(POOL_T pool)
Set "stop" command for DC motors.
Definition: brick.c:1372
bool us_set_mode_us_dist_in(POOL_T pool)
Set "US_DIST_IN" mode for lego_ev3_us sensors.
Definition: brick.c:421
EV3 Ports.
int tacho_get_position_sp(POOL_T sock, int defval)
Get value of "position_sp" attribute of the tacho.
Definition: brick.c:817
int tacho_get_hold_pid_Kp(POOL_T sock, int defval)
Get value of "hold_pid/Kp" attribute of the tacho.
Definition: brick.c:744
bool tacho_set_hold_pid_Ki(POOL_T pool, int value)
Set value of "hold_pid/Ki" attribute of tachos.
Definition: brick.c:734
bool dc_set_stop_action(POOL_T pool, INX_T stop_action_inx)
Set value of "stop_action" attribute of DC motors.
Definition: brick.c:1274
bool sensor_set_direct(POOL_T pool, char *value)
Set value of "direct" attribute of sensors.
Definition: brick.c:194
bool ir_set_mode_ir_seek(POOL_T pool)
Set "IR_SEEK" mode for lego_ev3_ir sensors.
Definition: brick.c:516
int dc_get_ramp_up_sp(POOL_T sock, int defval)
Get value of "ramp_up_sp" attribute of the DC motor.
Definition: brick.c:1315
bool sensor_set_poll_ms(POOL_T pool, dword value)
Set value of "poll_ms" attribute of sensors.
Definition: brick.c:287
bool dc_run_direct(POOL_T pool)
Set "run_direct" command for DC motors.
Definition: brick.c:1367
bool dc_set_polarity_normal(POOL_T pool)
Set "normal" polarity for DC motors.
Definition: brick.c:1377
bool tacho_set_speed_pid_Kp(POOL_T pool, int value)
Set value of "speed_pid/Kp" attribute of tachos.
Definition: brick.c:944
bool dc_set_stop_action_brake(POOL_T pool)
Set "brake" stop_action for DC motors.
Definition: brick.c:1392
char * sensor_get_fw_version(POOL_T sock, char *buf, size_t sz)
Get value of "fw_version" attribute of the sensor.
Definition: brick.c:225
bool dc_set_stop_action_coast(POOL_T pool)
Set "coast" stop_action for DC motors.
Definition: brick.c:1387
char * dc_get_address(POOL_T sock, char *buf, size_t sz)
Get value of "address" attribute of the DC motor.
Definition: brick.c:1171
bool color_set_mode_col_reflect(POOL_T pool)
Set "COL_REFLECT" mode for lego_ev3_color sensors.
Definition: brick.c:476
void brick_uninit(void)
Uninitialize the EV3 brick.
Definition: brick.c:92
uint8_t socket_to_port(POOL_T sock)
Get EV3 port of the socket.
Definition: brick.c:59
bool tacho_run_direct(POOL_T pool)
Set "run_direct" command for tachos.
Definition: brick.c:1057
bool gyro_set_mode_gyro_fas(POOL_T pool)
Set "GYRO_FAS" mode for lego_ev3_gyro sensors.
Definition: brick.c:461
void sleep_ms(uint32_t ms)
Delay in milliseconds.
Definition: brick.c:1452
dword sensor_get_poll_ms(POOL_T sock, dword defval)
Get value of "poll_ms" attribute of the sensor.
Definition: brick.c:276
char * tacho_get_commands(POOL_T sock, char *buf, size_t sz)
Get value of "commands" attribute of the tacho.
Definition: brick.c:617
bool ir_set_mode_ir_prox(POOL_T pool)
Set "IR_PROX" mode for lego_ev3_ir sensors.
Definition: brick.c:511
int tacho_get_ramp_up_sp(POOL_T sock, int defval)
Get value of "ramp_up_sp" attribute of the tacho.
Definition: brick.c:859
dword sensor_get_decimals(POOL_T sock, dword defval)
Get value of "decimals" attribute of the sensor.
Definition: brick.c:204
int tacho_get_position(POOL_T sock, int defval)
Get value of "position" attribute of the tacho.
Definition: brick.c:796
int tacho_get_max_speed(POOL_T sock, int defval)
Get value of "max_speed" attribute of the tacho.
Definition: brick.c:765
char * dc_get_commands(POOL_T sock, char *buf, size_t sz)
Get value of "commands" attribute of the DC motor.
Definition: brick.c:1191
bool tacho_run_to_abs_pos(POOL_T pool)
Set "run_to_abs_pos" command for tachos.
Definition: brick.c:1042
bool dc_is_running(POOL_T pool)
Check that DC motors are running.
Definition: brick.c:1434
dword sensor_get_num_values(POOL_T sock, dword defval)
Get value of "num_values" attribute of the sensor.
Definition: brick.c:265
bool tacho_set_polarity_normal(POOL_T pool)
Set "normal" polarity for tachos.
Definition: brick.c:1072
EV3 Tacho Motors.
INX_T tacho_get_stop_action(POOL_T sock)
Get value (index) of "stop_action" attribute of the tacho.
Definition: brick.c:986
char * sensor_get_driver_name(POOL_T sock, char *buf, size_t sz)
Get value of "driver_name" attribute of the sensor.
Definition: brick.c:215
bool color_set_mode_rgb_raw(POOL_T pool)
Set "RGB_RAW" mode for lego_ev3_color sensors.
Definition: brick.c:496
bool us_set_mode_us_si_in(POOL_T pool)
Set "US_SI_IN" mode for lego_ev3_us sensors.
Definition: brick.c:436
bool tacho_set_hold_pid_Kp(POOL_T pool, int value)
Set value of "hold_pid/Kp" attribute of tachos.
Definition: brick.c:755
int tacho_get_speed_pid_Kp(POOL_T sock, int defval)
Get value of "speed_pid/Kp" attribute of the tacho.
Definition: brick.c:933
bool tacho_set_command(POOL_T pool, INX_T command_inx)
Set value of "command" attribute of tachos.
Definition: brick.c:607
bool dc_set_duty_cycle_sp(POOL_T pool, int value)
Set value of "duty_cycle_sp" attribute of DC motors.
Definition: brick.c:1233
bool gyro_set_mode_gyro_g_and_a(POOL_T pool)
Set "GYRO_G_AND_A" mode for lego_ev3_gyro sensors.
Definition: brick.c:466
int tacho_get_speed_pid_Kd(POOL_T sock, int defval)
Get value of "speed_pid/Kd" attribute of the tacho.
Definition: brick.c:891
bool tacho_run_timed(POOL_T pool)
Set "run_timed" command for tachos.
Definition: brick.c:1052
bool gyro_set_mode_gyro_cal(POOL_T pool)
Set "GYRO_CAL" mode for lego_ev3_gyro sensors.
Definition: brick.c:471
int dc_get_ramp_down_sp(POOL_T sock, int defval)
Get value of "ramp_down_sp" attribute of the DC motor.
Definition: brick.c:1294
int tacho_get_ramp_down_sp(POOL_T sock, int defval)
Get value of "ramp_down_sp" attribute of the tacho.
Definition: brick.c:838
int tacho_get_hold_pid_Ki(POOL_T sock, int defval)
Get value of "hold_pid/Ki" attribute of the tacho.
Definition: brick.c:723
int tacho_get_count_per_m(POOL_T sock, int defval)
Get value of "count_per_m" attribute of the tacho.
Definition: brick.c:638
bool sensor_set_command(POOL_T pool, INX_T command_inx)
Set value of "command" attribute of sensors.
Definition: brick.c:164
bool touch_set_mode_touch(POOL_T pool)
Set "TOUCH" mode for lego_ev3_touch sensors.
Definition: brick.c:506
float sensor_get_value2(POOL_T sock, float defval)
Get value of "value2" attribute of the sensor.
Definition: brick.c:329
bool gyro_set_mode_gyro_ang(POOL_T pool)
Set "GYRO_ANG" mode for lego_ev3_gyro sensors.
Definition: brick.c:451
EV3 DC Motors.
bool tacho_set_ramp_down_sp(POOL_T pool, int value)
Set value of "ramp_down_sp" attribute of tachos.
Definition: brick.c:849
bool tacho_set_hold_pid_Kd(POOL_T pool, int value)
Set value of "hold_pid/Kd" attribute of tachos.
Definition: brick.c:713
bool color_set_mode_ref_raw(POOL_T pool)
Set "REF_RAW" mode for lego_ev3_color sensors.
Definition: brick.c:491
int dc_get_duty_cycle_sp(POOL_T sock, int defval)
Get value of "duty_cycle_sp" attribute of the DC motor.
Definition: brick.c:1222
bool tacho_stop(POOL_T pool)
Set "stop" command for tachos.
Definition: brick.c:1062
bool dc_set_ramp_down_sp(POOL_T pool, int value)
Set value of "ramp_down_sp" attribute of DC motors.
Definition: brick.c:1305
bool dc_is_plugged(POOL_T pool, INX_T type_inx)
Check that DC motors of the specified type are plugged into specified sockets.
Definition: brick.c:1408
int tacho_get_duty_cycle(POOL_T sock, int defval)
Get value of "duty_cycle" attribute of the tacho.
Definition: brick.c:670
bool dc_set_polarity(POOL_T pool, INX_T polarity_inx)
Set value of "polarity" attribute of DC motors.
Definition: brick.c:1253
EV3 file operations.
char * sensor_get_address(POOL_T sock, char *buf, size_t sz)
Get value of "address" attribute of the sensor.
Definition: brick.c:124
float sensor_get_value3(POOL_T sock, float defval)
Get value of "value3" attribute of the sensor.
Definition: brick.c:340
char * dc_get_stop_actions(POOL_T sock, char *buf, size_t sz)
Get value of "stop_actions" attribute of the DC motor.
Definition: brick.c:1284
bool brick_init(void)
Initialize the EV3 brick.
Definition: brick.c:83
bool tacho_set_position(POOL_T pool, int value)
Set value of "position" attribute of tachos.
Definition: brick.c:807
bool color_set_mode_col_ambient(POOL_T pool)
Set "COL_AMBIENT" mode for lego_ev3_color sensors.
Definition: brick.c:481
uint8_t brick_keys(void)
Read state of the EV3 brick&#39;s keys.
Definition: brick.c:97
char * sensor_get_modes(POOL_T sock, char *buf, size_t sz)
Get value of "modes" attribute of the sensor.
Definition: brick.c:255
int tacho_get_speed_sp(POOL_T sock, int defval)
Get value of "speed_sp" attribute of the tacho.
Definition: brick.c:954
char * tacho_get_driver_name(POOL_T sock, char *buf, size_t sz)
Get value of "driver_name" attribute of the tacho.
Definition: brick.c:660
bool tacho_run_forever(POOL_T pool)
Set "run_forever" command for tachos.
Definition: brick.c:1037
bool tacho_set_speed_pid_Kd(POOL_T pool, int value)
Set value of "speed_pid/Kd" attribute of tachos.
Definition: brick.c:902
byte * sensor_get_bin_data(POOL_T sock, byte *buf, size_t sz)
Get value of "bin_data" attribute of the sensor.
Definition: brick.c:134
bool tacho_reset(POOL_T pool)
Set "reset" command for tachos.
Definition: brick.c:1067
char * tacho_get_address(POOL_T sock, char *buf, size_t sz)
Get value of "address" attribute of the tacho.
Definition: brick.c:597
float sensor_get_value5(POOL_T sock, float defval)
Get value of "value5" attribute of the sensor.
Definition: brick.c:362
int sensor_get_value(uint8_t inx, POOL_T sock, int defval)
Get value of "value" attribute of the sensor.
Definition: brick.c:405
bool color_set_mode_col_color(POOL_T pool)
Set "COL_COLOR" mode for lego_ev3_color sensors.
Definition: brick.c:486
bool us_set_mode_us_dc_in(POOL_T pool)
Set "US_DC_IN" mode for lego_ev3_us sensors.
Definition: brick.c:446
float sensor_get_value7(POOL_T sock, float defval)
Get value of "value7" attribute of the sensor.
Definition: brick.c:384
POOL_T port_to_socket(uint8_t port)
Get socket of the EV3 port.
Definition: brick.c:35
float sensor_get_value6(POOL_T sock, float defval)
Get value of "value6" attribute of the sensor.
Definition: brick.c:373
bool dc_set_time_sp(POOL_T pool, int value)
Set value of "time_sp" attribute of DC motors.
Definition: brick.c:1347
bool tacho_set_ramp_up_sp(POOL_T pool, int value)
Set value of "ramp_up_sp" attribute of tachos.
Definition: brick.c:870
bool dc_set_polarity_inversed(POOL_T pool)
Set "inversed" polarity for DC motors.
Definition: brick.c:1382
int tacho_get_speed(POOL_T sock, int defval)
Get value of "speed" attribute of the tacho.
Definition: brick.c:880
bool sensor_set_mode(POOL_T pool, INX_T mode_inx)
Set value of "mode" attribute of sensors.
Definition: brick.c:245
bool tacho_is_running(POOL_T pool)
Check that tachos are running.
Definition: brick.c:1134
bool tacho_set_position_sp(POOL_T pool, int value)
Set value of "position_sp" attribute of tachos.
Definition: brick.c:828
bool us_set_mode_us_dc_cm(POOL_T pool)
Set "US_DC_CM" mode for lego_ev3_us sensors.
Definition: brick.c:441
INX_T dc_get_polarity(POOL_T sock)
Get value (index) of "polarity" attribute of the DC motor.
Definition: brick.c:1243
char * sensor_get_text_value(POOL_T sock, char *buf, size_t sz)
Get value of "text_value" attribute of the sensor.
Definition: brick.c:395
bool sensor_set_bin_data(POOL_T pool, byte *value, size_t sz)
Set value of "bin_data" attribute of sensors.
Definition: brick.c:144
bool tacho_set_duty_cycle_sp(POOL_T pool, int value)
Set value of "duty_cycle_sp" attribute of tachos.
Definition: brick.c:692
int tacho_get_duty_cycle_sp(POOL_T sock, int defval)
Get value of "duty_cycle_sp" attribute of the tacho.
Definition: brick.c:681
char * tacho_get_stop_actions(POOL_T sock, char *buf, size_t sz)
Get value of "stop_actions" attribute of the tacho.
Definition: brick.c:1006
int dc_get_duty_cycle(POOL_T sock, int defval)
Get value of "duty_cycle" attribute of the DC motor.
Definition: brick.c:1211
bool color_set_mode_col_cal(POOL_T pool)
Set "COL_CAL" mode for lego_ev3_color sensors.
Definition: brick.c:501
INX_T sensor_get_mode(POOL_T sock)
Get value (index) of "mode" attribute of the sensor.
Definition: brick.c:235
char * sensor_get_commands(POOL_T sock, char *buf, size_t sz)
Get value of "commands" attribute of the sensor.
Definition: brick.c:174
bool us_set_mode_us_listen(POOL_T pool)
Set "US_LISTEN" mode for lego_ev3_us sensors.
Definition: brick.c:426
char * sensor_get_direct(POOL_T sock, char *buf, size_t sz)
Get value of "direct" attribute of the sensor.
Definition: brick.c:184
POOL_T dc_search(INX_T type_inx)
Search of the specified DC motor type.
Definition: brick.c:1397
bool sensor_is_plugged(POOL_T pool, INX_T type_inx)
Check that sensors of the specified type are plugged into specified sockets.
Definition: brick.c:552
bool tacho_set_polarity(POOL_T pool, INX_T polarity_inx)
Set value of "polarity" attribute of tachos.
Definition: brick.c:786
bool tacho_set_speed_pid_Ki(POOL_T pool, int value)
Set value of "speed_pid/Ki" attribute of tachos.
Definition: brick.c:923
bool tacho_set_stop_action(POOL_T pool, INX_T stop_action_inx)
Set value of "stop_action" attribute of tachos.
Definition: brick.c:996
bool dc_set_ramp_up_sp(POOL_T pool, int value)
Set value of "ramp_up_sp" attribute of DC motors.
Definition: brick.c:1326
char * sensor_get_bin_data_format(POOL_T sock, char *buf, size_t sz)
Get value of "bin_data_format" attribute of the sensor.
Definition: brick.c:154
bool tacho_set_speed_sp(POOL_T pool, int value)
Set value of "speed_sp" attribute of tachos.
Definition: brick.c:965
int dc_get_time_sp(POOL_T sock, int defval)
Get value of "time_sp" attribute of the DC motor.
Definition: brick.c:1336
bool ir_set_mode_ir_cal(POOL_T pool)
Set "IR_CAL" mode for lego_ev3_ir sensors.
Definition: brick.c:536
char * dc_get_driver_name(POOL_T sock, char *buf, size_t sz)
Get value of "driver_name" attribute of the DC motor.
Definition: brick.c:1201
bool dc_run_forever(POOL_T pool)
Set "run_forever" command for DC motors.
Definition: brick.c:1357
bool ir_set_mode_ir_s_alt(POOL_T pool)
Set "IR_S_ALT" mode for lego_ev3_ir sensors.
Definition: brick.c:531
char * sensor_get_units(POOL_T sock, char *buf, size_t sz)
Get value of "units" attribute of the sensor.
Definition: brick.c:297
bool us_set_mode_us_dist_cm(POOL_T pool)
Set "US_DIST_CM" mode for lego_ev3_us sensors.
Definition: brick.c:416
int tacho_get_speed_pid_Ki(POOL_T sock, int defval)
Get value of "speed_pid/Ki" attribute of the tacho.
Definition: brick.c:912
int tacho_get_time_sp(POOL_T sock, int defval)
Get value of "time_sp" attribute of the tacho.
Definition: brick.c:1016