tinkerforge 2.1.27 → 2.1.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tinkerforge/brick_dc.rb +2 -2
  3. data/lib/tinkerforge/brick_esp32.rb +49 -0
  4. data/lib/tinkerforge/brick_esp32_ethernet.rb +49 -0
  5. data/lib/tinkerforge/brick_hat.rb +33 -3
  6. data/lib/tinkerforge/brick_hat_zero.rb +2 -2
  7. data/lib/tinkerforge/brick_imu.rb +2 -2
  8. data/lib/tinkerforge/brick_imu_v2.rb +2 -2
  9. data/lib/tinkerforge/brick_master.rb +4 -4
  10. data/lib/tinkerforge/brick_red.rb +2 -2
  11. data/lib/tinkerforge/brick_servo.rb +2 -2
  12. data/lib/tinkerforge/brick_silent_stepper.rb +2 -2
  13. data/lib/tinkerforge/brick_stepper.rb +2 -2
  14. data/lib/tinkerforge/bricklet_accelerometer.rb +2 -2
  15. data/lib/tinkerforge/bricklet_accelerometer_v2.rb +2 -2
  16. data/lib/tinkerforge/bricklet_air_quality.rb +2 -2
  17. data/lib/tinkerforge/bricklet_ambient_light.rb +2 -2
  18. data/lib/tinkerforge/bricklet_ambient_light_v2.rb +7 -4
  19. data/lib/tinkerforge/bricklet_ambient_light_v3.rb +7 -4
  20. data/lib/tinkerforge/bricklet_analog_in.rb +2 -2
  21. data/lib/tinkerforge/bricklet_analog_in_v2.rb +2 -2
  22. data/lib/tinkerforge/bricklet_analog_in_v3.rb +2 -2
  23. data/lib/tinkerforge/bricklet_analog_out.rb +2 -2
  24. data/lib/tinkerforge/bricklet_analog_out_v2.rb +2 -2
  25. data/lib/tinkerforge/bricklet_analog_out_v3.rb +2 -2
  26. data/lib/tinkerforge/bricklet_barometer.rb +2 -2
  27. data/lib/tinkerforge/bricklet_barometer_v2.rb +2 -2
  28. data/lib/tinkerforge/bricklet_can.rb +2 -2
  29. data/lib/tinkerforge/bricklet_can_v2.rb +2 -2
  30. data/lib/tinkerforge/bricklet_co2.rb +2 -2
  31. data/lib/tinkerforge/bricklet_co2_v2.rb +2 -2
  32. data/lib/tinkerforge/bricklet_color.rb +2 -2
  33. data/lib/tinkerforge/bricklet_color_v2.rb +2 -2
  34. data/lib/tinkerforge/bricklet_compass.rb +2 -2
  35. data/lib/tinkerforge/bricklet_current12.rb +2 -2
  36. data/lib/tinkerforge/bricklet_current25.rb +2 -2
  37. data/lib/tinkerforge/bricklet_dc_v2.rb +521 -0
  38. data/lib/tinkerforge/bricklet_distance_ir.rb +2 -2
  39. data/lib/tinkerforge/bricklet_distance_ir_v2.rb +2 -2
  40. data/lib/tinkerforge/bricklet_distance_us.rb +2 -2
  41. data/lib/tinkerforge/bricklet_distance_us_v2.rb +2 -2
  42. data/lib/tinkerforge/bricklet_dmx.rb +3 -3
  43. data/lib/tinkerforge/bricklet_dual_button.rb +2 -2
  44. data/lib/tinkerforge/bricklet_dual_button_v2.rb +2 -2
  45. data/lib/tinkerforge/bricklet_dual_relay.rb +2 -2
  46. data/lib/tinkerforge/bricklet_dust_detector.rb +2 -2
  47. data/lib/tinkerforge/bricklet_e_paper_296x128.rb +32 -3
  48. data/lib/tinkerforge/bricklet_energy_monitor.rb +2 -2
  49. data/lib/tinkerforge/bricklet_gps.rb +2 -2
  50. data/lib/tinkerforge/bricklet_gps_v2.rb +3 -3
  51. data/lib/tinkerforge/bricklet_gps_v3.rb +593 -0
  52. data/lib/tinkerforge/bricklet_hall_effect.rb +2 -2
  53. data/lib/tinkerforge/bricklet_hall_effect_v2.rb +2 -2
  54. data/lib/tinkerforge/bricklet_humidity.rb +2 -2
  55. data/lib/tinkerforge/bricklet_humidity_v2.rb +2 -2
  56. data/lib/tinkerforge/bricklet_imu_v3.rb +2 -2
  57. data/lib/tinkerforge/bricklet_industrial_analog_out.rb +2 -2
  58. data/lib/tinkerforge/bricklet_industrial_analog_out_v2.rb +2 -2
  59. data/lib/tinkerforge/bricklet_industrial_counter.rb +2 -2
  60. data/lib/tinkerforge/bricklet_industrial_digital_in_4.rb +2 -2
  61. data/lib/tinkerforge/bricklet_industrial_digital_in_4_v2.rb +2 -2
  62. data/lib/tinkerforge/bricklet_industrial_digital_out_4.rb +2 -2
  63. data/lib/tinkerforge/bricklet_industrial_digital_out_4_v2.rb +2 -2
  64. data/lib/tinkerforge/bricklet_industrial_dual_0_20ma.rb +2 -2
  65. data/lib/tinkerforge/bricklet_industrial_dual_0_20ma_v2.rb +2 -2
  66. data/lib/tinkerforge/bricklet_industrial_dual_ac_relay.rb +2 -2
  67. data/lib/tinkerforge/bricklet_industrial_dual_analog_in.rb +2 -2
  68. data/lib/tinkerforge/bricklet_industrial_dual_analog_in_v2.rb +2 -2
  69. data/lib/tinkerforge/bricklet_industrial_dual_relay.rb +2 -2
  70. data/lib/tinkerforge/bricklet_industrial_ptc.rb +475 -0
  71. data/lib/tinkerforge/bricklet_industrial_quad_relay.rb +2 -2
  72. data/lib/tinkerforge/bricklet_industrial_quad_relay_v2.rb +2 -2
  73. data/lib/tinkerforge/bricklet_io16.rb +2 -2
  74. data/lib/tinkerforge/bricklet_io16_v2.rb +2 -2
  75. data/lib/tinkerforge/bricklet_io4.rb +2 -2
  76. data/lib/tinkerforge/bricklet_io4_v2.rb +2 -2
  77. data/lib/tinkerforge/bricklet_isolator.rb +2 -2
  78. data/lib/tinkerforge/bricklet_joystick.rb +2 -2
  79. data/lib/tinkerforge/bricklet_joystick_v2.rb +2 -2
  80. data/lib/tinkerforge/bricklet_laser_range_finder.rb +2 -2
  81. data/lib/tinkerforge/bricklet_laser_range_finder_v2.rb +2 -2
  82. data/lib/tinkerforge/bricklet_lcd_128x64.rb +4 -2
  83. data/lib/tinkerforge/bricklet_lcd_16x2.rb +2 -2
  84. data/lib/tinkerforge/bricklet_lcd_20x4.rb +2 -2
  85. data/lib/tinkerforge/bricklet_led_strip.rb +2 -2
  86. data/lib/tinkerforge/bricklet_led_strip_v2.rb +2 -2
  87. data/lib/tinkerforge/bricklet_line.rb +2 -2
  88. data/lib/tinkerforge/bricklet_linear_poti.rb +3 -3
  89. data/lib/tinkerforge/bricklet_linear_poti_v2.rb +3 -3
  90. data/lib/tinkerforge/bricklet_load_cell.rb +2 -2
  91. data/lib/tinkerforge/bricklet_load_cell_v2.rb +2 -2
  92. data/lib/tinkerforge/bricklet_moisture.rb +2 -2
  93. data/lib/tinkerforge/bricklet_motion_detector.rb +2 -2
  94. data/lib/tinkerforge/bricklet_motion_detector_v2.rb +2 -5
  95. data/lib/tinkerforge/bricklet_motorized_linear_poti.rb +2 -2
  96. data/lib/tinkerforge/bricklet_multi_touch.rb +2 -2
  97. data/lib/tinkerforge/bricklet_multi_touch_v2.rb +2 -2
  98. data/lib/tinkerforge/bricklet_nfc.rb +21 -3
  99. data/lib/tinkerforge/bricklet_nfc_rfid.rb +2 -2
  100. data/lib/tinkerforge/bricklet_oled_128x64.rb +4 -2
  101. data/lib/tinkerforge/bricklet_oled_128x64_v2.rb +4 -2
  102. data/lib/tinkerforge/bricklet_oled_64x48.rb +4 -2
  103. data/lib/tinkerforge/bricklet_one_wire.rb +2 -2
  104. data/lib/tinkerforge/bricklet_outdoor_weather.rb +2 -2
  105. data/lib/tinkerforge/bricklet_particulate_matter.rb +2 -2
  106. data/lib/tinkerforge/bricklet_performance_dc.rb +682 -0
  107. data/lib/tinkerforge/bricklet_piezo_buzzer.rb +2 -2
  108. data/lib/tinkerforge/bricklet_piezo_speaker.rb +2 -2
  109. data/lib/tinkerforge/bricklet_piezo_speaker_v2.rb +2 -2
  110. data/lib/tinkerforge/bricklet_ptc.rb +2 -2
  111. data/lib/tinkerforge/bricklet_ptc_v2.rb +2 -2
  112. data/lib/tinkerforge/bricklet_real_time_clock.rb +2 -2
  113. data/lib/tinkerforge/bricklet_real_time_clock_v2.rb +2 -2
  114. data/lib/tinkerforge/bricklet_remote_switch.rb +2 -2
  115. data/lib/tinkerforge/bricklet_remote_switch_v2.rb +2 -2
  116. data/lib/tinkerforge/bricklet_rgb_led.rb +2 -2
  117. data/lib/tinkerforge/bricklet_rgb_led_button.rb +2 -2
  118. data/lib/tinkerforge/bricklet_rgb_led_matrix.rb +2 -2
  119. data/lib/tinkerforge/bricklet_rgb_led_v2.rb +2 -2
  120. data/lib/tinkerforge/bricklet_rotary_encoder.rb +2 -2
  121. data/lib/tinkerforge/bricklet_rotary_encoder_v2.rb +2 -2
  122. data/lib/tinkerforge/bricklet_rotary_poti.rb +2 -2
  123. data/lib/tinkerforge/bricklet_rotary_poti_v2.rb +2 -2
  124. data/lib/tinkerforge/bricklet_rs232.rb +2 -2
  125. data/lib/tinkerforge/bricklet_rs232_v2.rb +2 -2
  126. data/lib/tinkerforge/bricklet_rs485.rb +2 -2
  127. data/lib/tinkerforge/bricklet_segment_display_4x7.rb +2 -2
  128. data/lib/tinkerforge/bricklet_segment_display_4x7_v2.rb +2 -2
  129. data/lib/tinkerforge/bricklet_servo_v2.rb +565 -0
  130. data/lib/tinkerforge/bricklet_silent_stepper_v2.rb +1024 -0
  131. data/lib/tinkerforge/bricklet_solid_state_relay.rb +2 -2
  132. data/lib/tinkerforge/bricklet_solid_state_relay_v2.rb +2 -2
  133. data/lib/tinkerforge/bricklet_sound_intensity.rb +2 -2
  134. data/lib/tinkerforge/bricklet_sound_pressure_level.rb +2 -2
  135. data/lib/tinkerforge/bricklet_temperature.rb +2 -2
  136. data/lib/tinkerforge/bricklet_temperature_ir.rb +2 -2
  137. data/lib/tinkerforge/bricklet_temperature_ir_v2.rb +2 -2
  138. data/lib/tinkerforge/bricklet_temperature_v2.rb +2 -2
  139. data/lib/tinkerforge/bricklet_thermal_imaging.rb +2 -2
  140. data/lib/tinkerforge/bricklet_thermocouple.rb +2 -2
  141. data/lib/tinkerforge/bricklet_thermocouple_v2.rb +2 -2
  142. data/lib/tinkerforge/bricklet_tilt.rb +2 -2
  143. data/lib/tinkerforge/bricklet_uv_light.rb +2 -2
  144. data/lib/tinkerforge/bricklet_uv_light_v2.rb +2 -2
  145. data/lib/tinkerforge/bricklet_voltage.rb +2 -2
  146. data/lib/tinkerforge/bricklet_voltage_current.rb +2 -2
  147. data/lib/tinkerforge/bricklet_voltage_current_v2.rb +2 -2
  148. data/lib/tinkerforge/bricklet_xmc1400_breakout.rb +2 -2
  149. data/lib/tinkerforge/device_display_names.rb +11 -3
  150. data/lib/tinkerforge/ip_connection.rb +2 -1
  151. data/lib/tinkerforge/version.rb +1 -1
  152. metadata +10 -2
@@ -0,0 +1,682 @@
1
+ # -*- ruby encoding: utf-8 -*-
2
+ #############################################################
3
+ # This file was automatically generated on 2022-05-11. #
4
+ # #
5
+ # Ruby Bindings Version 2.1.30 #
6
+ # #
7
+ # If you have a bugfix for this file and want to commit it, #
8
+ # please fix the bug in the generator. You can find a link #
9
+ # to the generators git repository on tinkerforge.com #
10
+ #############################################################
11
+
12
+ require_relative './ip_connection'
13
+
14
+ module Tinkerforge
15
+ # Drives one brushed DC motor with up to 36V and 10A
16
+ class BrickletPerformanceDC < Device
17
+ DEVICE_IDENTIFIER = 2156 # :nodoc:
18
+ DEVICE_DISPLAY_NAME = 'Performance DC Bricklet' # :nodoc:
19
+
20
+ # This callback is triggered if either the current consumption
21
+ # is too high or the temperature of the driver chip is too high
22
+ # (above 150°C) or the user defined thermal shutdown is triggered (see BrickletPerformanceDC#set_thermal_shutdown).
23
+ # n case of a voltage below 6V (input voltage) this
24
+ # callback is triggered as well.
25
+ #
26
+ # If this callback is triggered, the driver chip gets disabled at the same time.
27
+ # That means, BrickletPerformanceDC#set_enabled has to be called to drive the motor again.
28
+ CALLBACK_EMERGENCY_SHUTDOWN = 35
29
+
30
+ # This callback is triggered whenever a set velocity is reached. For example:
31
+ # If a velocity of 0 is present, acceleration is set to 5000 and velocity
32
+ # to 10000, the CALLBACK_VELOCITY_REACHED callback will be triggered after about
33
+ # 2 seconds, when the set velocity is actually reached.
34
+ #
35
+ # .. note::
36
+ # Since we can't get any feedback from the DC motor, this only works if the
37
+ # acceleration (see BrickletPerformanceDC#set_motion) is set smaller or equal to the
38
+ # maximum acceleration of the motor. Otherwise the motor will lag behind the
39
+ # control value and the callback will be triggered too early.
40
+ CALLBACK_VELOCITY_REACHED = 36
41
+
42
+ # This callback is triggered with the period that is set by
43
+ # BrickletPerformanceDC#set_current_velocity_callback_configuration. The parameter is the *current*
44
+ # velocity used by the motor.
45
+ #
46
+ # The CALLBACK_CURRENT_VELOCITY callback is only triggered after the set period
47
+ # if there is a change in the velocity.
48
+ CALLBACK_CURRENT_VELOCITY = 37
49
+
50
+ # This callback is triggered by GPIO changes if it is activated through BrickletPerformanceDC#set_gpio_action.
51
+ #
52
+ # .. versionadded:: 2.0.1$nbsp;(Plugin)
53
+ CALLBACK_GPIO_STATE = 38
54
+
55
+ FUNCTION_SET_ENABLED = 1 # :nodoc:
56
+ FUNCTION_GET_ENABLED = 2 # :nodoc:
57
+ FUNCTION_SET_VELOCITY = 3 # :nodoc:
58
+ FUNCTION_GET_VELOCITY = 4 # :nodoc:
59
+ FUNCTION_GET_CURRENT_VELOCITY = 5 # :nodoc:
60
+ FUNCTION_SET_MOTION = 6 # :nodoc:
61
+ FUNCTION_GET_MOTION = 7 # :nodoc:
62
+ FUNCTION_FULL_BRAKE = 8 # :nodoc:
63
+ FUNCTION_SET_DRIVE_MODE = 9 # :nodoc:
64
+ FUNCTION_GET_DRIVE_MODE = 10 # :nodoc:
65
+ FUNCTION_SET_PWM_FREQUENCY = 11 # :nodoc:
66
+ FUNCTION_GET_PWM_FREQUENCY = 12 # :nodoc:
67
+ FUNCTION_GET_POWER_STATISTICS = 13 # :nodoc:
68
+ FUNCTION_SET_THERMAL_SHUTDOWN = 14 # :nodoc:
69
+ FUNCTION_GET_THERMAL_SHUTDOWN = 15 # :nodoc:
70
+ FUNCTION_SET_GPIO_CONFIGURATION = 16 # :nodoc:
71
+ FUNCTION_GET_GPIO_CONFIGURATION = 17 # :nodoc:
72
+ FUNCTION_SET_GPIO_ACTION = 18 # :nodoc:
73
+ FUNCTION_GET_GPIO_ACTION = 19 # :nodoc:
74
+ FUNCTION_GET_GPIO_STATE = 20 # :nodoc:
75
+ FUNCTION_SET_ERROR_LED_CONFIG = 21 # :nodoc:
76
+ FUNCTION_GET_ERROR_LED_CONFIG = 22 # :nodoc:
77
+ FUNCTION_SET_CW_LED_CONFIG = 23 # :nodoc:
78
+ FUNCTION_GET_CW_LED_CONFIG = 24 # :nodoc:
79
+ FUNCTION_SET_CCW_LED_CONFIG = 25 # :nodoc:
80
+ FUNCTION_GET_CCW_LED_CONFIG = 26 # :nodoc:
81
+ FUNCTION_SET_GPIO_LED_CONFIG = 27 # :nodoc:
82
+ FUNCTION_GET_GPIO_LED_CONFIG = 28 # :nodoc:
83
+ FUNCTION_SET_EMERGENCY_SHUTDOWN_CALLBACK_CONFIGURATION = 29 # :nodoc:
84
+ FUNCTION_GET_EMERGENCY_SHUTDOWN_CALLBACK_CONFIGURATION = 30 # :nodoc:
85
+ FUNCTION_SET_VELOCITY_REACHED_CALLBACK_CONFIGURATION = 31 # :nodoc:
86
+ FUNCTION_GET_VELOCITY_REACHED_CALLBACK_CONFIGURATION = 32 # :nodoc:
87
+ FUNCTION_SET_CURRENT_VELOCITY_CALLBACK_CONFIGURATION = 33 # :nodoc:
88
+ FUNCTION_GET_CURRENT_VELOCITY_CALLBACK_CONFIGURATION = 34 # :nodoc:
89
+ FUNCTION_GET_SPITFP_ERROR_COUNT = 234 # :nodoc:
90
+ FUNCTION_SET_BOOTLOADER_MODE = 235 # :nodoc:
91
+ FUNCTION_GET_BOOTLOADER_MODE = 236 # :nodoc:
92
+ FUNCTION_SET_WRITE_FIRMWARE_POINTER = 237 # :nodoc:
93
+ FUNCTION_WRITE_FIRMWARE = 238 # :nodoc:
94
+ FUNCTION_SET_STATUS_LED_CONFIG = 239 # :nodoc:
95
+ FUNCTION_GET_STATUS_LED_CONFIG = 240 # :nodoc:
96
+ FUNCTION_GET_CHIP_TEMPERATURE = 242 # :nodoc:
97
+ FUNCTION_RESET = 243 # :nodoc:
98
+ FUNCTION_WRITE_UID = 248 # :nodoc:
99
+ FUNCTION_READ_UID = 249 # :nodoc:
100
+ FUNCTION_GET_IDENTITY = 255 # :nodoc:
101
+
102
+ DRIVE_MODE_DRIVE_BRAKE = 0 # :nodoc:
103
+ DRIVE_MODE_DRIVE_COAST = 1 # :nodoc:
104
+ GPIO_ACTION_NONE = 0 # :nodoc:
105
+ GPIO_ACTION_NORMAL_STOP_RISING_EDGE = 1 # :nodoc:
106
+ GPIO_ACTION_NORMAL_STOP_FALLING_EDGE = 2 # :nodoc:
107
+ GPIO_ACTION_FULL_BRAKE_RISING_EDGE = 4 # :nodoc:
108
+ GPIO_ACTION_FULL_BRAKE_FALLING_EDGE = 8 # :nodoc:
109
+ GPIO_ACTION_CALLBACK_RISING_EDGE = 16 # :nodoc:
110
+ GPIO_ACTION_CALLBACK_FALLING_EDGE = 32 # :nodoc:
111
+ ERROR_LED_CONFIG_OFF = 0 # :nodoc:
112
+ ERROR_LED_CONFIG_ON = 1 # :nodoc:
113
+ ERROR_LED_CONFIG_SHOW_HEARTBEAT = 2 # :nodoc:
114
+ ERROR_LED_CONFIG_SHOW_ERROR = 3 # :nodoc:
115
+ CW_LED_CONFIG_OFF = 0 # :nodoc:
116
+ CW_LED_CONFIG_ON = 1 # :nodoc:
117
+ CW_LED_CONFIG_SHOW_HEARTBEAT = 2 # :nodoc:
118
+ CW_LED_CONFIG_SHOW_CW_AS_FORWARD = 3 # :nodoc:
119
+ CW_LED_CONFIG_SHOW_CW_AS_BACKWARD = 4 # :nodoc:
120
+ CCW_LED_CONFIG_OFF = 0 # :nodoc:
121
+ CCW_LED_CONFIG_ON = 1 # :nodoc:
122
+ CCW_LED_CONFIG_SHOW_HEARTBEAT = 2 # :nodoc:
123
+ CCW_LED_CONFIG_SHOW_CCW_AS_FORWARD = 3 # :nodoc:
124
+ CCW_LED_CONFIG_SHOW_CCW_AS_BACKWARD = 4 # :nodoc:
125
+ GPIO_LED_CONFIG_OFF = 0 # :nodoc:
126
+ GPIO_LED_CONFIG_ON = 1 # :nodoc:
127
+ GPIO_LED_CONFIG_SHOW_HEARTBEAT = 2 # :nodoc:
128
+ GPIO_LED_CONFIG_SHOW_GPIO_ACTIVE_HIGH = 3 # :nodoc:
129
+ GPIO_LED_CONFIG_SHOW_GPIO_ACTIVE_LOW = 4 # :nodoc:
130
+ BOOTLOADER_MODE_BOOTLOADER = 0 # :nodoc:
131
+ BOOTLOADER_MODE_FIRMWARE = 1 # :nodoc:
132
+ BOOTLOADER_MODE_BOOTLOADER_WAIT_FOR_REBOOT = 2 # :nodoc:
133
+ BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_REBOOT = 3 # :nodoc:
134
+ BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_ERASE_AND_REBOOT = 4 # :nodoc:
135
+ BOOTLOADER_STATUS_OK = 0 # :nodoc:
136
+ BOOTLOADER_STATUS_INVALID_MODE = 1 # :nodoc:
137
+ BOOTLOADER_STATUS_NO_CHANGE = 2 # :nodoc:
138
+ BOOTLOADER_STATUS_ENTRY_FUNCTION_NOT_PRESENT = 3 # :nodoc:
139
+ BOOTLOADER_STATUS_DEVICE_IDENTIFIER_INCORRECT = 4 # :nodoc:
140
+ BOOTLOADER_STATUS_CRC_MISMATCH = 5 # :nodoc:
141
+ STATUS_LED_CONFIG_OFF = 0 # :nodoc:
142
+ STATUS_LED_CONFIG_ON = 1 # :nodoc:
143
+ STATUS_LED_CONFIG_SHOW_HEARTBEAT = 2 # :nodoc:
144
+ STATUS_LED_CONFIG_SHOW_STATUS = 3 # :nodoc:
145
+
146
+ # Creates an object with the unique device ID <tt>uid</tt> and adds it to
147
+ # the IP Connection <tt>ipcon</tt>.
148
+ def initialize(uid, ipcon)
149
+ super uid, ipcon, DEVICE_IDENTIFIER, DEVICE_DISPLAY_NAME
150
+
151
+ @api_version = [2, 0, 1]
152
+
153
+ @response_expected[FUNCTION_SET_ENABLED] = RESPONSE_EXPECTED_FALSE
154
+ @response_expected[FUNCTION_GET_ENABLED] = RESPONSE_EXPECTED_ALWAYS_TRUE
155
+ @response_expected[FUNCTION_SET_VELOCITY] = RESPONSE_EXPECTED_FALSE
156
+ @response_expected[FUNCTION_GET_VELOCITY] = RESPONSE_EXPECTED_ALWAYS_TRUE
157
+ @response_expected[FUNCTION_GET_CURRENT_VELOCITY] = RESPONSE_EXPECTED_ALWAYS_TRUE
158
+ @response_expected[FUNCTION_SET_MOTION] = RESPONSE_EXPECTED_FALSE
159
+ @response_expected[FUNCTION_GET_MOTION] = RESPONSE_EXPECTED_ALWAYS_TRUE
160
+ @response_expected[FUNCTION_FULL_BRAKE] = RESPONSE_EXPECTED_FALSE
161
+ @response_expected[FUNCTION_SET_DRIVE_MODE] = RESPONSE_EXPECTED_FALSE
162
+ @response_expected[FUNCTION_GET_DRIVE_MODE] = RESPONSE_EXPECTED_ALWAYS_TRUE
163
+ @response_expected[FUNCTION_SET_PWM_FREQUENCY] = RESPONSE_EXPECTED_FALSE
164
+ @response_expected[FUNCTION_GET_PWM_FREQUENCY] = RESPONSE_EXPECTED_ALWAYS_TRUE
165
+ @response_expected[FUNCTION_GET_POWER_STATISTICS] = RESPONSE_EXPECTED_ALWAYS_TRUE
166
+ @response_expected[FUNCTION_SET_THERMAL_SHUTDOWN] = RESPONSE_EXPECTED_FALSE
167
+ @response_expected[FUNCTION_GET_THERMAL_SHUTDOWN] = RESPONSE_EXPECTED_ALWAYS_TRUE
168
+ @response_expected[FUNCTION_SET_GPIO_CONFIGURATION] = RESPONSE_EXPECTED_FALSE
169
+ @response_expected[FUNCTION_GET_GPIO_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
170
+ @response_expected[FUNCTION_SET_GPIO_ACTION] = RESPONSE_EXPECTED_FALSE
171
+ @response_expected[FUNCTION_GET_GPIO_ACTION] = RESPONSE_EXPECTED_ALWAYS_TRUE
172
+ @response_expected[FUNCTION_GET_GPIO_STATE] = RESPONSE_EXPECTED_ALWAYS_TRUE
173
+ @response_expected[FUNCTION_SET_ERROR_LED_CONFIG] = RESPONSE_EXPECTED_FALSE
174
+ @response_expected[FUNCTION_GET_ERROR_LED_CONFIG] = RESPONSE_EXPECTED_ALWAYS_TRUE
175
+ @response_expected[FUNCTION_SET_CW_LED_CONFIG] = RESPONSE_EXPECTED_FALSE
176
+ @response_expected[FUNCTION_GET_CW_LED_CONFIG] = RESPONSE_EXPECTED_ALWAYS_TRUE
177
+ @response_expected[FUNCTION_SET_CCW_LED_CONFIG] = RESPONSE_EXPECTED_FALSE
178
+ @response_expected[FUNCTION_GET_CCW_LED_CONFIG] = RESPONSE_EXPECTED_ALWAYS_TRUE
179
+ @response_expected[FUNCTION_SET_GPIO_LED_CONFIG] = RESPONSE_EXPECTED_FALSE
180
+ @response_expected[FUNCTION_GET_GPIO_LED_CONFIG] = RESPONSE_EXPECTED_ALWAYS_TRUE
181
+ @response_expected[FUNCTION_SET_EMERGENCY_SHUTDOWN_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_TRUE
182
+ @response_expected[FUNCTION_GET_EMERGENCY_SHUTDOWN_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
183
+ @response_expected[FUNCTION_SET_VELOCITY_REACHED_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_TRUE
184
+ @response_expected[FUNCTION_GET_VELOCITY_REACHED_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
185
+ @response_expected[FUNCTION_SET_CURRENT_VELOCITY_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_TRUE
186
+ @response_expected[FUNCTION_GET_CURRENT_VELOCITY_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
187
+ @response_expected[FUNCTION_GET_SPITFP_ERROR_COUNT] = RESPONSE_EXPECTED_ALWAYS_TRUE
188
+ @response_expected[FUNCTION_SET_BOOTLOADER_MODE] = RESPONSE_EXPECTED_ALWAYS_TRUE
189
+ @response_expected[FUNCTION_GET_BOOTLOADER_MODE] = RESPONSE_EXPECTED_ALWAYS_TRUE
190
+ @response_expected[FUNCTION_SET_WRITE_FIRMWARE_POINTER] = RESPONSE_EXPECTED_FALSE
191
+ @response_expected[FUNCTION_WRITE_FIRMWARE] = RESPONSE_EXPECTED_ALWAYS_TRUE
192
+ @response_expected[FUNCTION_SET_STATUS_LED_CONFIG] = RESPONSE_EXPECTED_FALSE
193
+ @response_expected[FUNCTION_GET_STATUS_LED_CONFIG] = RESPONSE_EXPECTED_ALWAYS_TRUE
194
+ @response_expected[FUNCTION_GET_CHIP_TEMPERATURE] = RESPONSE_EXPECTED_ALWAYS_TRUE
195
+ @response_expected[FUNCTION_RESET] = RESPONSE_EXPECTED_FALSE
196
+ @response_expected[FUNCTION_WRITE_UID] = RESPONSE_EXPECTED_FALSE
197
+ @response_expected[FUNCTION_READ_UID] = RESPONSE_EXPECTED_ALWAYS_TRUE
198
+ @response_expected[FUNCTION_GET_IDENTITY] = RESPONSE_EXPECTED_ALWAYS_TRUE
199
+
200
+ @callback_formats[CALLBACK_EMERGENCY_SHUTDOWN] = [8, '']
201
+ @callback_formats[CALLBACK_VELOCITY_REACHED] = [10, 's']
202
+ @callback_formats[CALLBACK_CURRENT_VELOCITY] = [10, 's']
203
+ @callback_formats[CALLBACK_GPIO_STATE] = [9, '?2']
204
+
205
+ @ipcon.add_device self
206
+ end
207
+
208
+ # Enables/Disables the driver chip. The driver parameters can be configured
209
+ # (velocity, acceleration, etc) before it is enabled.
210
+ def set_enabled(enabled)
211
+ check_validity
212
+
213
+ send_request FUNCTION_SET_ENABLED, [enabled], '?', 8, ''
214
+ end
215
+
216
+ # Returns *true* if the driver chip is enabled, *false* otherwise.
217
+ def get_enabled
218
+ check_validity
219
+
220
+ send_request FUNCTION_GET_ENABLED, [], '', 9, '?'
221
+ end
222
+
223
+ # Sets the velocity of the motor. Whereas -32767 is full speed backward,
224
+ # 0 is stop and 32767 is full speed forward. Depending on the
225
+ # acceleration (see BrickletPerformanceDC#set_motion), the motor is not immediately
226
+ # brought to the velocity but smoothly accelerated.
227
+ #
228
+ # The velocity describes the duty cycle of the PWM with which the motor is
229
+ # controlled, e.g. a velocity of 3277 sets a PWM with a 10% duty cycle.
230
+ # You can not only control the duty cycle of the PWM but also the frequency,
231
+ # see BrickletPerformanceDC#set_pwm_frequency.
232
+ def set_velocity(velocity)
233
+ check_validity
234
+
235
+ send_request FUNCTION_SET_VELOCITY, [velocity], 's', 8, ''
236
+ end
237
+
238
+ # Returns the velocity as set by BrickletPerformanceDC#set_velocity.
239
+ def get_velocity
240
+ check_validity
241
+
242
+ send_request FUNCTION_GET_VELOCITY, [], '', 10, 's'
243
+ end
244
+
245
+ # Returns the *current* velocity of the motor. This value is different
246
+ # from BrickletPerformanceDC#get_velocity whenever the motor is currently accelerating
247
+ # to a goal set by BrickletPerformanceDC#set_velocity.
248
+ def get_current_velocity
249
+ check_validity
250
+
251
+ send_request FUNCTION_GET_CURRENT_VELOCITY, [], '', 10, 's'
252
+ end
253
+
254
+ # Sets the acceleration and deceleration of the motor. It is given in *velocity/s*.
255
+ # An acceleration of 10000 means, that every second the velocity is increased
256
+ # by 10000 (or about 30% duty cycle).
257
+ #
258
+ # For example: If the current velocity is 0 and you want to accelerate to a
259
+ # velocity of 16000 (about 50% duty cycle) in 10 seconds, you should set
260
+ # an acceleration of 1600.
261
+ #
262
+ # If acceleration and deceleration is set to 0, there is no speed ramping, i.e. a
263
+ # new velocity is immediately given to the motor.
264
+ def set_motion(acceleration, deceleration)
265
+ check_validity
266
+
267
+ send_request FUNCTION_SET_MOTION, [acceleration, deceleration], 'S S', 8, ''
268
+ end
269
+
270
+ # Returns the acceleration/deceleration as set by BrickletPerformanceDC#set_motion.
271
+ def get_motion
272
+ check_validity
273
+
274
+ send_request FUNCTION_GET_MOTION, [], '', 12, 'S S'
275
+ end
276
+
277
+ # Executes an active full brake.
278
+ #
279
+ # .. warning::
280
+ # This function is for emergency purposes,
281
+ # where an immediate brake is necessary. Depending on the current velocity and
282
+ # the strength of the motor, a full brake can be quite violent.
283
+ #
284
+ # Call BrickletPerformanceDC#set_velocity with 0 if you just want to stop the motor.
285
+ def full_brake
286
+ check_validity
287
+
288
+ send_request FUNCTION_FULL_BRAKE, [], '', 8, ''
289
+ end
290
+
291
+ # Sets the drive mode. Possible modes are:
292
+ #
293
+ # * 0 = Drive/Brake
294
+ # * 1 = Drive/Coast
295
+ #
296
+ # These modes are different kinds of motor controls.
297
+ #
298
+ # In Drive/Brake mode, the motor is always either driving or braking. There
299
+ # is no freewheeling. Advantages are: A more linear correlation between
300
+ # PWM and velocity, more exact accelerations and the possibility to drive
301
+ # with slower velocities.
302
+ #
303
+ # In Drive/Coast mode, the motor is always either driving or freewheeling.
304
+ # Advantages are: Less current consumption and less demands on the motor and
305
+ # driver chip.
306
+ def set_drive_mode(mode)
307
+ check_validity
308
+
309
+ send_request FUNCTION_SET_DRIVE_MODE, [mode], 'C', 8, ''
310
+ end
311
+
312
+ # Returns the drive mode, as set by BrickletPerformanceDC#set_drive_mode.
313
+ def get_drive_mode
314
+ check_validity
315
+
316
+ send_request FUNCTION_GET_DRIVE_MODE, [], '', 9, 'C'
317
+ end
318
+
319
+ # Sets the frequency of the PWM with which the motor is driven.
320
+ # Often a high frequency
321
+ # is less noisy and the motor runs smoother. However, with a low frequency
322
+ # there are less switches and therefore fewer switching losses. Also with
323
+ # most motors lower frequencies enable higher torque.
324
+ #
325
+ # If you have no idea what all this means, just ignore this function and use
326
+ # the default frequency, it will very likely work fine.
327
+ def set_pwm_frequency(frequency)
328
+ check_validity
329
+
330
+ send_request FUNCTION_SET_PWM_FREQUENCY, [frequency], 'S', 8, ''
331
+ end
332
+
333
+ # Returns the PWM frequency as set by BrickletPerformanceDC#set_pwm_frequency.
334
+ def get_pwm_frequency
335
+ check_validity
336
+
337
+ send_request FUNCTION_GET_PWM_FREQUENCY, [], '', 10, 'S'
338
+ end
339
+
340
+ # Returns input voltage, current usage and temperature of the driver.
341
+ def get_power_statistics
342
+ check_validity
343
+
344
+ send_request FUNCTION_GET_POWER_STATISTICS, [], '', 14, 'S S s'
345
+ end
346
+
347
+ # Sets a temperature threshold that is used for thermal shutdown.
348
+ #
349
+ # Additionally to this user defined threshold the driver chip will shut down at a
350
+ # temperature of 150°C.
351
+ #
352
+ # If a thermal shutdown is triggered the driver is disabled and has to be
353
+ # explicitly re-enabled with BrickletPerformanceDC#set_enabled.
354
+ def set_thermal_shutdown(temperature)
355
+ check_validity
356
+
357
+ send_request FUNCTION_SET_THERMAL_SHUTDOWN, [temperature], 'C', 8, ''
358
+ end
359
+
360
+ # Returns the thermal shutdown temperature as set by BrickletPerformanceDC#set_thermal_shutdown.
361
+ def get_thermal_shutdown
362
+ check_validity
363
+
364
+ send_request FUNCTION_GET_THERMAL_SHUTDOWN, [], '', 9, 'C'
365
+ end
366
+
367
+ # Sets the GPIO configuration for the given channel.
368
+ # You can configure a debounce and the deceleration that is used if the action is
369
+ # configured as ``normal stop``. See BrickletPerformanceDC#set_gpio_action.
370
+ def set_gpio_configuration(channel, debounce, stop_deceleration)
371
+ check_validity
372
+
373
+ send_request FUNCTION_SET_GPIO_CONFIGURATION, [channel, debounce, stop_deceleration], 'C S S', 8, ''
374
+ end
375
+
376
+ # Returns the GPIO configuration for a channel as set by BrickletPerformanceDC#set_gpio_configuration.
377
+ def get_gpio_configuration(channel)
378
+ check_validity
379
+
380
+ send_request FUNCTION_GET_GPIO_CONFIGURATION, [channel], 'C', 12, 'S S'
381
+ end
382
+
383
+ # Sets the GPIO action for the given channel.
384
+ #
385
+ # The action can be a normal stop, a full brake or a callback. Each for a rising
386
+ # edge or falling edge. The actions are a bitmask they can be used at the same time.
387
+ # You can for example trigger a full brake and a callback at the same time or for
388
+ # rising and falling edge.
389
+ #
390
+ # The deceleration speed for the normal stop can be configured with
391
+ # BrickletPerformanceDC#set_gpio_configuration.
392
+ def set_gpio_action(channel, action)
393
+ check_validity
394
+
395
+ send_request FUNCTION_SET_GPIO_ACTION, [channel, action], 'C L', 8, ''
396
+ end
397
+
398
+ # Returns the GPIO action for a channel as set by BrickletPerformanceDC#set_gpio_action.
399
+ def get_gpio_action(channel)
400
+ check_validity
401
+
402
+ send_request FUNCTION_GET_GPIO_ACTION, [channel], 'C', 12, 'L'
403
+ end
404
+
405
+ # Returns the GPIO state for both channels. True if the state is ``high`` and
406
+ # false if the state is ``low``.
407
+ def get_gpio_state
408
+ check_validity
409
+
410
+ send_request FUNCTION_GET_GPIO_STATE, [], '', 9, '?2'
411
+ end
412
+
413
+ # Configures the error LED to be either turned off, turned on, blink in
414
+ # heartbeat mode or show an error.
415
+ #
416
+ # If the LED is configured to show errors it has three different states:
417
+ #
418
+ # * Off: No error present.
419
+ # * 1s interval blinking: Input voltage too low (below 6V).
420
+ # * 250ms interval blinking: Overtemperature or overcurrent.
421
+ def set_error_led_config(config)
422
+ check_validity
423
+
424
+ send_request FUNCTION_SET_ERROR_LED_CONFIG, [config], 'C', 8, ''
425
+ end
426
+
427
+ # Returns the LED configuration as set by BrickletPerformanceDC#set_error_led_config
428
+ def get_error_led_config
429
+ check_validity
430
+
431
+ send_request FUNCTION_GET_ERROR_LED_CONFIG, [], '', 9, 'C'
432
+ end
433
+
434
+ # Configures the CW LED to be either turned off, turned on, blink in
435
+ # heartbeat mode or if the motor turn clockwise.
436
+ def set_cw_led_config(config)
437
+ check_validity
438
+
439
+ send_request FUNCTION_SET_CW_LED_CONFIG, [config], 'C', 8, ''
440
+ end
441
+
442
+ # Returns the LED configuration as set by BrickletPerformanceDC#set_cw_led_config
443
+ def get_cw_led_config
444
+ check_validity
445
+
446
+ send_request FUNCTION_GET_CW_LED_CONFIG, [], '', 9, 'C'
447
+ end
448
+
449
+ # Configures the CCW LED to be either turned off, turned on, blink in
450
+ # heartbeat mode or if the motor turn counter-clockwise.
451
+ def set_ccw_led_config(config)
452
+ check_validity
453
+
454
+ send_request FUNCTION_SET_CCW_LED_CONFIG, [config], 'C', 8, ''
455
+ end
456
+
457
+ # Returns the LED configuration as set by BrickletPerformanceDC#set_ccw_led_config
458
+ def get_ccw_led_config
459
+ check_validity
460
+
461
+ send_request FUNCTION_GET_CCW_LED_CONFIG, [], '', 9, 'C'
462
+ end
463
+
464
+ # Configures the GPIO LED to be either turned off, turned on, blink in
465
+ # heartbeat mode or the GPIO state.
466
+ #
467
+ # The GPIO LED can be configured for both channels.
468
+ def set_gpio_led_config(channel, config)
469
+ check_validity
470
+
471
+ send_request FUNCTION_SET_GPIO_LED_CONFIG, [channel, config], 'C C', 8, ''
472
+ end
473
+
474
+ # Returns the LED configuration as set by BrickletPerformanceDC#set_gpio_led_config
475
+ def get_gpio_led_config(channel)
476
+ check_validity
477
+
478
+ send_request FUNCTION_GET_GPIO_LED_CONFIG, [channel], 'C', 9, 'C'
479
+ end
480
+
481
+ # Enable/Disable CALLBACK_EMERGENCY_SHUTDOWN callback.
482
+ def set_emergency_shutdown_callback_configuration(enabled)
483
+ check_validity
484
+
485
+ send_request FUNCTION_SET_EMERGENCY_SHUTDOWN_CALLBACK_CONFIGURATION, [enabled], '?', 8, ''
486
+ end
487
+
488
+ # Returns the callback configuration as set by
489
+ # BrickletPerformanceDC#set_emergency_shutdown_callback_configuration.
490
+ def get_emergency_shutdown_callback_configuration
491
+ check_validity
492
+
493
+ send_request FUNCTION_GET_EMERGENCY_SHUTDOWN_CALLBACK_CONFIGURATION, [], '', 9, '?'
494
+ end
495
+
496
+ # Enable/Disable CALLBACK_VELOCITY_REACHED callback.
497
+ def set_velocity_reached_callback_configuration(enabled)
498
+ check_validity
499
+
500
+ send_request FUNCTION_SET_VELOCITY_REACHED_CALLBACK_CONFIGURATION, [enabled], '?', 8, ''
501
+ end
502
+
503
+ # Returns the callback configuration as set by
504
+ # BrickletPerformanceDC#set_velocity_reached_callback_configuration.
505
+ def get_velocity_reached_callback_configuration
506
+ check_validity
507
+
508
+ send_request FUNCTION_GET_VELOCITY_REACHED_CALLBACK_CONFIGURATION, [], '', 9, '?'
509
+ end
510
+
511
+ # The period is the period with which the CALLBACK_CURRENT_VELOCITY
512
+ # callback is triggered periodically. A value of 0 turns the callback off.
513
+ #
514
+ # If the `value has to change`-parameter is set to true, the callback is only
515
+ # triggered after the value has changed. If the value didn't change within the
516
+ # period, the callback is triggered immediately on change.
517
+ #
518
+ # If it is set to false, the callback is continuously triggered with the period,
519
+ # independent of the value.
520
+ def set_current_velocity_callback_configuration(period, value_has_to_change)
521
+ check_validity
522
+
523
+ send_request FUNCTION_SET_CURRENT_VELOCITY_CALLBACK_CONFIGURATION, [period, value_has_to_change], 'L ?', 8, ''
524
+ end
525
+
526
+ # Returns the callback configuration as set by
527
+ # BrickletPerformanceDC#set_current_velocity_callback_configuration.
528
+ def get_current_velocity_callback_configuration
529
+ check_validity
530
+
531
+ send_request FUNCTION_GET_CURRENT_VELOCITY_CALLBACK_CONFIGURATION, [], '', 13, 'L ?'
532
+ end
533
+
534
+ # Returns the error count for the communication between Brick and Bricklet.
535
+ #
536
+ # The errors are divided into
537
+ #
538
+ # * ACK checksum errors,
539
+ # * message checksum errors,
540
+ # * framing errors and
541
+ # * overflow errors.
542
+ #
543
+ # The errors counts are for errors that occur on the Bricklet side. All
544
+ # Bricks have a similar function that returns the errors on the Brick side.
545
+ def get_spitfp_error_count
546
+ check_validity
547
+
548
+ send_request FUNCTION_GET_SPITFP_ERROR_COUNT, [], '', 24, 'L L L L'
549
+ end
550
+
551
+ # Sets the bootloader mode and returns the status after the requested
552
+ # mode change was instigated.
553
+ #
554
+ # You can change from bootloader mode to firmware mode and vice versa. A change
555
+ # from bootloader mode to firmware mode will only take place if the entry function,
556
+ # device identifier and CRC are present and correct.
557
+ #
558
+ # This function is used by Brick Viewer during flashing. It should not be
559
+ # necessary to call it in a normal user program.
560
+ def set_bootloader_mode(mode)
561
+ check_validity
562
+
563
+ send_request FUNCTION_SET_BOOTLOADER_MODE, [mode], 'C', 9, 'C'
564
+ end
565
+
566
+ # Returns the current bootloader mode, see BrickletPerformanceDC#set_bootloader_mode.
567
+ def get_bootloader_mode
568
+ check_validity
569
+
570
+ send_request FUNCTION_GET_BOOTLOADER_MODE, [], '', 9, 'C'
571
+ end
572
+
573
+ # Sets the firmware pointer for BrickletPerformanceDC#write_firmware. The pointer has
574
+ # to be increased by chunks of size 64. The data is written to flash
575
+ # every 4 chunks (which equals to one page of size 256).
576
+ #
577
+ # This function is used by Brick Viewer during flashing. It should not be
578
+ # necessary to call it in a normal user program.
579
+ def set_write_firmware_pointer(pointer)
580
+ check_validity
581
+
582
+ send_request FUNCTION_SET_WRITE_FIRMWARE_POINTER, [pointer], 'L', 8, ''
583
+ end
584
+
585
+ # Writes 64 Bytes of firmware at the position as written by
586
+ # BrickletPerformanceDC#set_write_firmware_pointer before. The firmware is written
587
+ # to flash every 4 chunks.
588
+ #
589
+ # You can only write firmware in bootloader mode.
590
+ #
591
+ # This function is used by Brick Viewer during flashing. It should not be
592
+ # necessary to call it in a normal user program.
593
+ def write_firmware(data)
594
+ check_validity
595
+
596
+ send_request FUNCTION_WRITE_FIRMWARE, [data], 'C64', 9, 'C'
597
+ end
598
+
599
+ # Sets the status LED configuration. By default the LED shows
600
+ # communication traffic between Brick and Bricklet, it flickers once
601
+ # for every 10 received data packets.
602
+ #
603
+ # You can also turn the LED permanently on/off or show a heartbeat.
604
+ #
605
+ # If the Bricklet is in bootloader mode, the LED is will show heartbeat by default.
606
+ def set_status_led_config(config)
607
+ check_validity
608
+
609
+ send_request FUNCTION_SET_STATUS_LED_CONFIG, [config], 'C', 8, ''
610
+ end
611
+
612
+ # Returns the configuration as set by BrickletPerformanceDC#set_status_led_config
613
+ def get_status_led_config
614
+ check_validity
615
+
616
+ send_request FUNCTION_GET_STATUS_LED_CONFIG, [], '', 9, 'C'
617
+ end
618
+
619
+ # Returns the temperature as measured inside the microcontroller. The
620
+ # value returned is not the ambient temperature!
621
+ #
622
+ # The temperature is only proportional to the real temperature and it has bad
623
+ # accuracy. Practically it is only useful as an indicator for
624
+ # temperature changes.
625
+ def get_chip_temperature
626
+ check_validity
627
+
628
+ send_request FUNCTION_GET_CHIP_TEMPERATURE, [], '', 10, 's'
629
+ end
630
+
631
+ # Calling this function will reset the Bricklet. All configurations
632
+ # will be lost.
633
+ #
634
+ # After a reset you have to create new device objects,
635
+ # calling functions on the existing ones will result in
636
+ # undefined behavior!
637
+ def reset
638
+ check_validity
639
+
640
+ send_request FUNCTION_RESET, [], '', 8, ''
641
+ end
642
+
643
+ # Writes a new UID into flash. If you want to set a new UID
644
+ # you have to decode the Base58 encoded UID string into an
645
+ # integer first.
646
+ #
647
+ # We recommend that you use Brick Viewer to change the UID.
648
+ def write_uid(uid)
649
+ check_validity
650
+
651
+ send_request FUNCTION_WRITE_UID, [uid], 'L', 8, ''
652
+ end
653
+
654
+ # Returns the current UID as an integer. Encode as
655
+ # Base58 to get the usual string version.
656
+ def read_uid
657
+ check_validity
658
+
659
+ send_request FUNCTION_READ_UID, [], '', 12, 'L'
660
+ end
661
+
662
+ # Returns the UID, the UID where the Bricklet is connected to,
663
+ # the position, the hardware and firmware version as well as the
664
+ # device identifier.
665
+ #
666
+ # The position can be 'a', 'b', 'c', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port).
667
+ # A Bricklet connected to an :ref:`Isolator Bricklet <isolator_bricklet>` is always at
668
+ # position 'z'.
669
+ #
670
+ # The device identifier numbers can be found :ref:`here <device_identifier>`.
671
+ # |device_identifier_constant|
672
+ def get_identity
673
+ send_request FUNCTION_GET_IDENTITY, [], '', 33, 'Z8 Z8 k C3 C3 S'
674
+ end
675
+
676
+ # Registers a callback with ID <tt>id</tt> to the block <tt>block</tt>.
677
+ def register_callback(id, &block)
678
+ callback = block
679
+ @registered_callbacks[id] = callback
680
+ end
681
+ end
682
+ end
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2020-11-02. #
3
+ # This file was automatically generated on 2022-05-11. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.27 #
5
+ # Ruby Bindings Version 2.1.30 #
6
6
  # #
7
7
  # If you have a bugfix for this file and want to commit it, #
8
8
  # please fix the bug in the generator. You can find a link #