tinkerforge 2.1.22 → 2.1.23

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tinkerforge/brick_dc.rb +3 -3
  3. data/lib/tinkerforge/brick_hat.rb +11 -7
  4. data/lib/tinkerforge/brick_hat_zero.rb +2 -2
  5. data/lib/tinkerforge/brick_imu.rb +3 -3
  6. data/lib/tinkerforge/brick_imu_v2.rb +3 -3
  7. data/lib/tinkerforge/brick_master.rb +5 -5
  8. data/lib/tinkerforge/brick_red.rb +2 -2
  9. data/lib/tinkerforge/brick_servo.rb +3 -3
  10. data/lib/tinkerforge/brick_silent_stepper.rb +3 -3
  11. data/lib/tinkerforge/brick_stepper.rb +4 -4
  12. data/lib/tinkerforge/bricklet_accelerometer.rb +2 -2
  13. data/lib/tinkerforge/bricklet_accelerometer_v2.rb +81 -6
  14. data/lib/tinkerforge/bricklet_air_quality.rb +2 -2
  15. data/lib/tinkerforge/bricklet_ambient_light.rb +2 -2
  16. data/lib/tinkerforge/bricklet_ambient_light_v2.rb +2 -2
  17. data/lib/tinkerforge/bricklet_ambient_light_v3.rb +2 -2
  18. data/lib/tinkerforge/bricklet_analog_in.rb +2 -2
  19. data/lib/tinkerforge/bricklet_analog_in_v2.rb +2 -2
  20. data/lib/tinkerforge/bricklet_analog_in_v3.rb +2 -2
  21. data/lib/tinkerforge/bricklet_analog_out.rb +2 -2
  22. data/lib/tinkerforge/bricklet_analog_out_v2.rb +2 -2
  23. data/lib/tinkerforge/bricklet_analog_out_v3.rb +2 -2
  24. data/lib/tinkerforge/bricklet_barometer.rb +2 -2
  25. data/lib/tinkerforge/bricklet_barometer_v2.rb +2 -2
  26. data/lib/tinkerforge/bricklet_can.rb +2 -2
  27. data/lib/tinkerforge/bricklet_can_v2.rb +2 -2
  28. data/lib/tinkerforge/bricklet_co2.rb +2 -2
  29. data/lib/tinkerforge/bricklet_co2_v2.rb +2 -2
  30. data/lib/tinkerforge/bricklet_color.rb +4 -4
  31. data/lib/tinkerforge/bricklet_color_v2.rb +449 -0
  32. data/lib/tinkerforge/bricklet_compass.rb +356 -0
  33. data/lib/tinkerforge/bricklet_current12.rb +2 -2
  34. data/lib/tinkerforge/bricklet_current25.rb +2 -2
  35. data/lib/tinkerforge/bricklet_distance_ir.rb +2 -2
  36. data/lib/tinkerforge/bricklet_distance_ir_v2.rb +2 -2
  37. data/lib/tinkerforge/bricklet_distance_us.rb +2 -2
  38. data/lib/tinkerforge/bricklet_distance_us_v2.rb +300 -0
  39. data/lib/tinkerforge/bricklet_dmx.rb +2 -2
  40. data/lib/tinkerforge/bricklet_dual_button.rb +2 -2
  41. data/lib/tinkerforge/bricklet_dual_button_v2.rb +2 -2
  42. data/lib/tinkerforge/bricklet_dual_relay.rb +2 -2
  43. data/lib/tinkerforge/bricklet_dust_detector.rb +2 -2
  44. data/lib/tinkerforge/bricklet_e_paper_296x128.rb +2 -2
  45. data/lib/tinkerforge/bricklet_energy_monitor.rb +375 -0
  46. data/lib/tinkerforge/bricklet_gps.rb +2 -2
  47. data/lib/tinkerforge/bricklet_gps_v2.rb +2 -2
  48. data/lib/tinkerforge/bricklet_hall_effect.rb +2 -2
  49. data/lib/tinkerforge/bricklet_hall_effect_v2.rb +2 -2
  50. data/lib/tinkerforge/bricklet_humidity.rb +2 -2
  51. data/lib/tinkerforge/bricklet_humidity_v2.rb +2 -2
  52. data/lib/tinkerforge/bricklet_industrial_analog_out.rb +2 -2
  53. data/lib/tinkerforge/bricklet_industrial_analog_out_v2.rb +2 -2
  54. data/lib/tinkerforge/bricklet_industrial_counter.rb +2 -2
  55. data/lib/tinkerforge/bricklet_industrial_digital_in_4.rb +2 -2
  56. data/lib/tinkerforge/bricklet_industrial_digital_in_4_v2.rb +2 -2
  57. data/lib/tinkerforge/bricklet_industrial_digital_out_4.rb +2 -2
  58. data/lib/tinkerforge/bricklet_industrial_digital_out_4_v2.rb +2 -2
  59. data/lib/tinkerforge/bricklet_industrial_dual_0_20ma.rb +2 -2
  60. data/lib/tinkerforge/bricklet_industrial_dual_0_20ma_v2.rb +2 -2
  61. data/lib/tinkerforge/bricklet_industrial_dual_analog_in.rb +2 -2
  62. data/lib/tinkerforge/bricklet_industrial_dual_analog_in_v2.rb +2 -2
  63. data/lib/tinkerforge/bricklet_industrial_dual_relay.rb +2 -2
  64. data/lib/tinkerforge/bricklet_industrial_quad_relay.rb +2 -2
  65. data/lib/tinkerforge/bricklet_industrial_quad_relay_v2.rb +2 -2
  66. data/lib/tinkerforge/bricklet_io16.rb +2 -2
  67. data/lib/tinkerforge/bricklet_io16_v2.rb +2 -2
  68. data/lib/tinkerforge/bricklet_io4.rb +2 -2
  69. data/lib/tinkerforge/bricklet_io4_v2.rb +2 -2
  70. data/lib/tinkerforge/bricklet_isolator.rb +2 -2
  71. data/lib/tinkerforge/bricklet_joystick.rb +2 -2
  72. data/lib/tinkerforge/bricklet_joystick_v2.rb +2 -2
  73. data/lib/tinkerforge/bricklet_laser_range_finder.rb +2 -2
  74. data/lib/tinkerforge/bricklet_laser_range_finder_v2.rb +5 -5
  75. data/lib/tinkerforge/bricklet_lcd_128x64.rb +24 -2
  76. data/lib/tinkerforge/bricklet_lcd_16x2.rb +2 -2
  77. data/lib/tinkerforge/bricklet_lcd_20x4.rb +2 -2
  78. data/lib/tinkerforge/bricklet_led_strip.rb +2 -2
  79. data/lib/tinkerforge/bricklet_led_strip_v2.rb +2 -2
  80. data/lib/tinkerforge/bricklet_line.rb +2 -2
  81. data/lib/tinkerforge/bricklet_linear_poti.rb +2 -2
  82. data/lib/tinkerforge/bricklet_linear_poti_v2.rb +2 -2
  83. data/lib/tinkerforge/bricklet_load_cell.rb +2 -2
  84. data/lib/tinkerforge/bricklet_load_cell_v2.rb +2 -2
  85. data/lib/tinkerforge/bricklet_moisture.rb +2 -2
  86. data/lib/tinkerforge/bricklet_motion_detector.rb +2 -2
  87. data/lib/tinkerforge/bricklet_motion_detector_v2.rb +2 -2
  88. data/lib/tinkerforge/bricklet_motorized_linear_poti.rb +2 -2
  89. data/lib/tinkerforge/bricklet_multi_touch.rb +2 -2
  90. data/lib/tinkerforge/bricklet_multi_touch_v2.rb +334 -0
  91. data/lib/tinkerforge/bricklet_nfc.rb +2 -2
  92. data/lib/tinkerforge/bricklet_nfc_rfid.rb +2 -2
  93. data/lib/tinkerforge/bricklet_oled_128x64.rb +2 -2
  94. data/lib/tinkerforge/bricklet_oled_128x64_v2.rb +24 -2
  95. data/lib/tinkerforge/bricklet_oled_64x48.rb +2 -2
  96. data/lib/tinkerforge/bricklet_one_wire.rb +2 -2
  97. data/lib/tinkerforge/bricklet_outdoor_weather.rb +2 -2
  98. data/lib/tinkerforge/bricklet_particulate_matter.rb +2 -2
  99. data/lib/tinkerforge/bricklet_piezo_buzzer.rb +2 -2
  100. data/lib/tinkerforge/bricklet_piezo_speaker.rb +2 -2
  101. data/lib/tinkerforge/bricklet_piezo_speaker_v2.rb +2 -2
  102. data/lib/tinkerforge/bricklet_ptc.rb +2 -2
  103. data/lib/tinkerforge/bricklet_ptc_v2.rb +2 -2
  104. data/lib/tinkerforge/bricklet_real_time_clock.rb +2 -2
  105. data/lib/tinkerforge/bricklet_real_time_clock_v2.rb +2 -2
  106. data/lib/tinkerforge/bricklet_remote_switch.rb +2 -2
  107. data/lib/tinkerforge/bricklet_remote_switch_v2.rb +2 -2
  108. data/lib/tinkerforge/bricklet_rgb_led.rb +2 -2
  109. data/lib/tinkerforge/bricklet_rgb_led_button.rb +2 -2
  110. data/lib/tinkerforge/bricklet_rgb_led_matrix.rb +2 -2
  111. data/lib/tinkerforge/bricklet_rgb_led_v2.rb +2 -2
  112. data/lib/tinkerforge/bricklet_rotary_encoder.rb +2 -2
  113. data/lib/tinkerforge/bricklet_rotary_encoder_v2.rb +2 -2
  114. data/lib/tinkerforge/bricklet_rotary_poti.rb +2 -2
  115. data/lib/tinkerforge/bricklet_rotary_poti_v2.rb +259 -0
  116. data/lib/tinkerforge/bricklet_rs232.rb +2 -2
  117. data/lib/tinkerforge/bricklet_rs232_v2.rb +2 -2
  118. data/lib/tinkerforge/bricklet_rs485.rb +70 -60
  119. data/lib/tinkerforge/bricklet_segment_display_4x7.rb +2 -2
  120. data/lib/tinkerforge/bricklet_segment_display_4x7_v2.rb +2 -2
  121. data/lib/tinkerforge/bricklet_solid_state_relay.rb +2 -2
  122. data/lib/tinkerforge/bricklet_solid_state_relay_v2.rb +2 -2
  123. data/lib/tinkerforge/bricklet_sound_intensity.rb +2 -2
  124. data/lib/tinkerforge/bricklet_sound_pressure_level.rb +2 -2
  125. data/lib/tinkerforge/bricklet_temperature.rb +2 -2
  126. data/lib/tinkerforge/bricklet_temperature_ir.rb +5 -3
  127. data/lib/tinkerforge/bricklet_temperature_ir_v2.rb +3 -11
  128. data/lib/tinkerforge/bricklet_temperature_v2.rb +2 -2
  129. data/lib/tinkerforge/bricklet_thermal_imaging.rb +2 -2
  130. data/lib/tinkerforge/bricklet_thermocouple.rb +2 -2
  131. data/lib/tinkerforge/bricklet_thermocouple_v2.rb +2 -2
  132. data/lib/tinkerforge/bricklet_tilt.rb +2 -2
  133. data/lib/tinkerforge/bricklet_uv_light.rb +2 -2
  134. data/lib/tinkerforge/bricklet_uv_light_v2.rb +2 -2
  135. data/lib/tinkerforge/bricklet_voltage.rb +2 -2
  136. data/lib/tinkerforge/bricklet_voltage_current.rb +2 -2
  137. data/lib/tinkerforge/bricklet_voltage_current_v2.rb +13 -2
  138. data/lib/tinkerforge/bricklet_xmc1400_breakout.rb +365 -0
  139. data/lib/tinkerforge/ip_connection.rb +1 -1
  140. data/lib/tinkerforge/version.rb +1 -1
  141. metadata +10 -3
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-05-21. #
3
+ # This file was automatically generated on 2019-08-23. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.22 #
5
+ # Ruby Bindings Version 2.1.23 #
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 #
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-05-21. #
3
+ # This file was automatically generated on 2019-08-23. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.22 #
5
+ # Ruby Bindings Version 2.1.23 #
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 #
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-05-21. #
3
+ # This file was automatically generated on 2019-08-23. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.22 #
5
+ # Ruby Bindings Version 2.1.23 #
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 #
@@ -121,6 +121,16 @@ module Tinkerforge
121
121
  end
122
122
 
123
123
  # Clears the complete content of the display.
124
+ #
125
+ # If automatic draw is enabled (default) the pixels are directly cleared.
126
+ #
127
+ # If automatic draw is disabled the the internal buffer is cleared and
128
+ # the buffer is transferred to the display only after BrickletOLED128x64V2#draw_buffered_frame
129
+ # is called. This can be used to avoid flicker when drawing a complex frame in
130
+ # multiple steps.
131
+ #
132
+ # Automatic draw can be configured with the BrickletOLED128x64V2#set_display_configuration
133
+ # function.
124
134
  def clear_display
125
135
  send_request FUNCTION_CLEAR_DISPLAY, [], '', 0, ''
126
136
  end
@@ -153,6 +163,18 @@ module Tinkerforge
153
163
  #
154
164
  # The display uses a special 5x7 pixel charset. You can view the characters
155
165
  # of the charset in Brick Viewer.
166
+ #
167
+ # If automatic draw is enabled (default) the text is directly written to
168
+ # the screen. Only pixels that have actually changed are updated on the screen,
169
+ # the rest stays the same.
170
+ #
171
+ # If automatic draw is disabled the text is written to an internal buffer and
172
+ # the buffer is transferred to the display only after BrickletOLED128x64V2#draw_buffered_frame
173
+ # is called. This can be used to avoid flicker when drawing a complex frame in
174
+ # multiple steps.
175
+ #
176
+ # Automatic draw can be configured with the BrickletOLED128x64V2#set_display_configuration
177
+ # function.
156
178
  def write_line(line, position, text)
157
179
  send_request FUNCTION_WRITE_LINE, [line, position, text], 'C C Z22', 0, ''
158
180
  end
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-05-21. #
3
+ # This file was automatically generated on 2019-08-23. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.22 #
5
+ # Ruby Bindings Version 2.1.23 #
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 #
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-05-21. #
3
+ # This file was automatically generated on 2019-08-23. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.22 #
5
+ # Ruby Bindings Version 2.1.23 #
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 #
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-05-21. #
3
+ # This file was automatically generated on 2019-08-23. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.22 #
5
+ # Ruby Bindings Version 2.1.23 #
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 #
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-05-21. #
3
+ # This file was automatically generated on 2019-08-23. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.22 #
5
+ # Ruby Bindings Version 2.1.23 #
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 #
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-05-21. #
3
+ # This file was automatically generated on 2019-08-23. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.22 #
5
+ # Ruby Bindings Version 2.1.23 #
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 #
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-05-21. #
3
+ # This file was automatically generated on 2019-08-23. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.22 #
5
+ # Ruby Bindings Version 2.1.23 #
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 #
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-05-21. #
3
+ # This file was automatically generated on 2019-08-23. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.22 #
5
+ # Ruby Bindings Version 2.1.23 #
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 #
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-05-21. #
3
+ # This file was automatically generated on 2019-08-23. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.22 #
5
+ # Ruby Bindings Version 2.1.23 #
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 #
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-05-21. #
3
+ # This file was automatically generated on 2019-08-23. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.22 #
5
+ # Ruby Bindings Version 2.1.23 #
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 #
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-05-21. #
3
+ # This file was automatically generated on 2019-08-23. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.22 #
5
+ # Ruby Bindings Version 2.1.23 #
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 #
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-05-21. #
3
+ # This file was automatically generated on 2019-08-23. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.22 #
5
+ # Ruby Bindings Version 2.1.23 #
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 #
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-05-21. #
3
+ # This file was automatically generated on 2019-08-23. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.22 #
5
+ # Ruby Bindings Version 2.1.23 #
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 #
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-05-21. #
3
+ # This file was automatically generated on 2019-08-23. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.22 #
5
+ # Ruby Bindings Version 2.1.23 #
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 #
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-05-21. #
3
+ # This file was automatically generated on 2019-08-23. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.22 #
5
+ # Ruby Bindings Version 2.1.23 #
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 #
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-05-21. #
3
+ # This file was automatically generated on 2019-08-23. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.22 #
5
+ # Ruby Bindings Version 2.1.23 #
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 #
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-05-21. #
3
+ # This file was automatically generated on 2019-08-23. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.22 #
5
+ # Ruby Bindings Version 2.1.23 #
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 #
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-05-21. #
3
+ # This file was automatically generated on 2019-08-23. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.22 #
5
+ # Ruby Bindings Version 2.1.23 #
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 #
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-05-21. #
3
+ # This file was automatically generated on 2019-08-23. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.22 #
5
+ # Ruby Bindings Version 2.1.23 #
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 #
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-05-21. #
3
+ # This file was automatically generated on 2019-08-23. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.22 #
5
+ # Ruby Bindings Version 2.1.23 #
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 #
@@ -1,8 +1,8 @@
1
1
  # -*- ruby encoding: utf-8 -*-
2
2
  #############################################################
3
- # This file was automatically generated on 2019-05-21. #
3
+ # This file was automatically generated on 2019-08-23. #
4
4
  # #
5
- # Ruby Bindings Version 2.1.22 #
5
+ # Ruby Bindings Version 2.1.23 #
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 #
@@ -0,0 +1,259 @@
1
+ # -*- ruby encoding: utf-8 -*-
2
+ #############################################################
3
+ # This file was automatically generated on 2019-08-23. #
4
+ # #
5
+ # Ruby Bindings Version 2.1.23 #
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
+ module Tinkerforge
13
+ # 300° rotary potentiometer
14
+ class BrickletRotaryPotiV2 < Device
15
+ DEVICE_IDENTIFIER = 2140 # :nodoc:
16
+ DEVICE_DISPLAY_NAME = 'Rotary Poti Bricklet 2.0' # :nodoc:
17
+
18
+ # This callback is triggered periodically according to the configuration set by
19
+ # BrickletRotaryPotiV2#set_position_callback_configuration.
20
+ #
21
+ # The parameter is the same as BrickletRotaryPotiV2#get_position.
22
+ CALLBACK_POSITION = 4
23
+
24
+ FUNCTION_GET_POSITION = 1 # :nodoc:
25
+ FUNCTION_SET_POSITION_CALLBACK_CONFIGURATION = 2 # :nodoc:
26
+ FUNCTION_GET_POSITION_CALLBACK_CONFIGURATION = 3 # :nodoc:
27
+ FUNCTION_GET_SPITFP_ERROR_COUNT = 234 # :nodoc:
28
+ FUNCTION_SET_BOOTLOADER_MODE = 235 # :nodoc:
29
+ FUNCTION_GET_BOOTLOADER_MODE = 236 # :nodoc:
30
+ FUNCTION_SET_WRITE_FIRMWARE_POINTER = 237 # :nodoc:
31
+ FUNCTION_WRITE_FIRMWARE = 238 # :nodoc:
32
+ FUNCTION_SET_STATUS_LED_CONFIG = 239 # :nodoc:
33
+ FUNCTION_GET_STATUS_LED_CONFIG = 240 # :nodoc:
34
+ FUNCTION_GET_CHIP_TEMPERATURE = 242 # :nodoc:
35
+ FUNCTION_RESET = 243 # :nodoc:
36
+ FUNCTION_WRITE_UID = 248 # :nodoc:
37
+ FUNCTION_READ_UID = 249 # :nodoc:
38
+ FUNCTION_GET_IDENTITY = 255 # :nodoc:
39
+
40
+ THRESHOLD_OPTION_OFF = 'x' # :nodoc:
41
+ THRESHOLD_OPTION_OUTSIDE = 'o' # :nodoc:
42
+ THRESHOLD_OPTION_INSIDE = 'i' # :nodoc:
43
+ THRESHOLD_OPTION_SMALLER = '<' # :nodoc:
44
+ THRESHOLD_OPTION_GREATER = '>' # :nodoc:
45
+ BOOTLOADER_MODE_BOOTLOADER = 0 # :nodoc:
46
+ BOOTLOADER_MODE_FIRMWARE = 1 # :nodoc:
47
+ BOOTLOADER_MODE_BOOTLOADER_WAIT_FOR_REBOOT = 2 # :nodoc:
48
+ BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_REBOOT = 3 # :nodoc:
49
+ BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_ERASE_AND_REBOOT = 4 # :nodoc:
50
+ BOOTLOADER_STATUS_OK = 0 # :nodoc:
51
+ BOOTLOADER_STATUS_INVALID_MODE = 1 # :nodoc:
52
+ BOOTLOADER_STATUS_NO_CHANGE = 2 # :nodoc:
53
+ BOOTLOADER_STATUS_ENTRY_FUNCTION_NOT_PRESENT = 3 # :nodoc:
54
+ BOOTLOADER_STATUS_DEVICE_IDENTIFIER_INCORRECT = 4 # :nodoc:
55
+ BOOTLOADER_STATUS_CRC_MISMATCH = 5 # :nodoc:
56
+ STATUS_LED_CONFIG_OFF = 0 # :nodoc:
57
+ STATUS_LED_CONFIG_ON = 1 # :nodoc:
58
+ STATUS_LED_CONFIG_SHOW_HEARTBEAT = 2 # :nodoc:
59
+ STATUS_LED_CONFIG_SHOW_STATUS = 3 # :nodoc:
60
+
61
+ # Creates an object with the unique device ID <tt>uid</tt> and adds it to
62
+ # the IP Connection <tt>ipcon</tt>.
63
+ def initialize(uid, ipcon)
64
+ super uid, ipcon
65
+
66
+ @api_version = [2, 0, 0]
67
+
68
+ @response_expected[FUNCTION_GET_POSITION] = RESPONSE_EXPECTED_ALWAYS_TRUE
69
+ @response_expected[FUNCTION_SET_POSITION_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_TRUE
70
+ @response_expected[FUNCTION_GET_POSITION_CALLBACK_CONFIGURATION] = RESPONSE_EXPECTED_ALWAYS_TRUE
71
+ @response_expected[FUNCTION_GET_SPITFP_ERROR_COUNT] = RESPONSE_EXPECTED_ALWAYS_TRUE
72
+ @response_expected[FUNCTION_SET_BOOTLOADER_MODE] = RESPONSE_EXPECTED_ALWAYS_TRUE
73
+ @response_expected[FUNCTION_GET_BOOTLOADER_MODE] = RESPONSE_EXPECTED_ALWAYS_TRUE
74
+ @response_expected[FUNCTION_SET_WRITE_FIRMWARE_POINTER] = RESPONSE_EXPECTED_FALSE
75
+ @response_expected[FUNCTION_WRITE_FIRMWARE] = RESPONSE_EXPECTED_ALWAYS_TRUE
76
+ @response_expected[FUNCTION_SET_STATUS_LED_CONFIG] = RESPONSE_EXPECTED_FALSE
77
+ @response_expected[FUNCTION_GET_STATUS_LED_CONFIG] = RESPONSE_EXPECTED_ALWAYS_TRUE
78
+ @response_expected[FUNCTION_GET_CHIP_TEMPERATURE] = RESPONSE_EXPECTED_ALWAYS_TRUE
79
+ @response_expected[FUNCTION_RESET] = RESPONSE_EXPECTED_FALSE
80
+ @response_expected[FUNCTION_WRITE_UID] = RESPONSE_EXPECTED_FALSE
81
+ @response_expected[FUNCTION_READ_UID] = RESPONSE_EXPECTED_ALWAYS_TRUE
82
+ @response_expected[FUNCTION_GET_IDENTITY] = RESPONSE_EXPECTED_ALWAYS_TRUE
83
+
84
+ @callback_formats[CALLBACK_POSITION] = 's'
85
+
86
+ end
87
+
88
+ # Returns the position of the rotary potentiometer. The value is in degree
89
+ # and between -150° (turned left) and 150° (turned right).
90
+ #
91
+ #
92
+ # If you want to get the value periodically, it is recommended to use the
93
+ # CALLBACK_POSITION callback. You can set the callback configuration
94
+ # with BrickletRotaryPotiV2#set_position_callback_configuration.
95
+ def get_position
96
+ send_request FUNCTION_GET_POSITION, [], '', 2, 's'
97
+ end
98
+
99
+ # The period in ms is the period with which the CALLBACK_POSITION callback is triggered
100
+ # periodically. A value of 0 turns the callback off.
101
+ #
102
+ # If the `value has to change`-parameter is set to true, the callback is only
103
+ # triggered after the value has changed. If the value didn't change
104
+ # within the period, the callback is triggered immediately on change.
105
+ #
106
+ # If it is set to false, the callback is continuously triggered with the period,
107
+ # independent of the value.
108
+ #
109
+ # It is furthermore possible to constrain the callback with thresholds.
110
+ #
111
+ # The `option`-parameter together with min/max sets a threshold for the CALLBACK_POSITION callback.
112
+ #
113
+ # The following options are possible:
114
+ #
115
+ # "Option", "Description"
116
+ #
117
+ # "'x'", "Threshold is turned off"
118
+ # "'o'", "Threshold is triggered when the value is *outside* the min and max values"
119
+ # "'i'", "Threshold is triggered when the value is *inside* or equal to the min and max values"
120
+ # "'<'", "Threshold is triggered when the value is smaller than the min value (max is ignored)"
121
+ # "'>'", "Threshold is triggered when the value is greater than the min value (max is ignored)"
122
+ #
123
+ # If the option is set to 'x' (threshold turned off) the callback is triggered with the fixed period.
124
+ #
125
+ # The default value is (0, false, 'x', 0, 0).
126
+ def set_position_callback_configuration(period, value_has_to_change, option, min, max)
127
+ send_request FUNCTION_SET_POSITION_CALLBACK_CONFIGURATION, [period, value_has_to_change, option, min, max], 'L ? k s s', 0, ''
128
+ end
129
+
130
+ # Returns the callback configuration as set by BrickletRotaryPotiV2#set_position_callback_configuration.
131
+ def get_position_callback_configuration
132
+ send_request FUNCTION_GET_POSITION_CALLBACK_CONFIGURATION, [], '', 10, 'L ? k s s'
133
+ end
134
+
135
+ # Returns the error count for the communication between Brick and Bricklet.
136
+ #
137
+ # The errors are divided into
138
+ #
139
+ # * ACK checksum errors,
140
+ # * message checksum errors,
141
+ # * framing errors and
142
+ # * overflow errors.
143
+ #
144
+ # The errors counts are for errors that occur on the Bricklet side. All
145
+ # Bricks have a similar function that returns the errors on the Brick side.
146
+ def get_spitfp_error_count
147
+ send_request FUNCTION_GET_SPITFP_ERROR_COUNT, [], '', 16, 'L L L L'
148
+ end
149
+
150
+ # Sets the bootloader mode and returns the status after the requested
151
+ # mode change was instigated.
152
+ #
153
+ # You can change from bootloader mode to firmware mode and vice versa. A change
154
+ # from bootloader mode to firmware mode will only take place if the entry function,
155
+ # device identifier and CRC are present and correct.
156
+ #
157
+ # This function is used by Brick Viewer during flashing. It should not be
158
+ # necessary to call it in a normal user program.
159
+ def set_bootloader_mode(mode)
160
+ send_request FUNCTION_SET_BOOTLOADER_MODE, [mode], 'C', 1, 'C'
161
+ end
162
+
163
+ # Returns the current bootloader mode, see BrickletRotaryPotiV2#set_bootloader_mode.
164
+ def get_bootloader_mode
165
+ send_request FUNCTION_GET_BOOTLOADER_MODE, [], '', 1, 'C'
166
+ end
167
+
168
+ # Sets the firmware pointer for BrickletRotaryPotiV2#write_firmware. The pointer has
169
+ # to be increased by chunks of size 64. The data is written to flash
170
+ # every 4 chunks (which equals to one page of size 256).
171
+ #
172
+ # This function is used by Brick Viewer during flashing. It should not be
173
+ # necessary to call it in a normal user program.
174
+ def set_write_firmware_pointer(pointer)
175
+ send_request FUNCTION_SET_WRITE_FIRMWARE_POINTER, [pointer], 'L', 0, ''
176
+ end
177
+
178
+ # Writes 64 Bytes of firmware at the position as written by
179
+ # BrickletRotaryPotiV2#set_write_firmware_pointer before. The firmware is written
180
+ # to flash every 4 chunks.
181
+ #
182
+ # You can only write firmware in bootloader mode.
183
+ #
184
+ # This function is used by Brick Viewer during flashing. It should not be
185
+ # necessary to call it in a normal user program.
186
+ def write_firmware(data)
187
+ send_request FUNCTION_WRITE_FIRMWARE, [data], 'C64', 1, 'C'
188
+ end
189
+
190
+ # Sets the status LED configuration. By default the LED shows
191
+ # communication traffic between Brick and Bricklet, it flickers once
192
+ # for every 10 received data packets.
193
+ #
194
+ # You can also turn the LED permanently on/off or show a heartbeat.
195
+ #
196
+ # If the Bricklet is in bootloader mode, the LED is will show heartbeat by default.
197
+ def set_status_led_config(config)
198
+ send_request FUNCTION_SET_STATUS_LED_CONFIG, [config], 'C', 0, ''
199
+ end
200
+
201
+ # Returns the configuration as set by BrickletRotaryPotiV2#set_status_led_config
202
+ def get_status_led_config
203
+ send_request FUNCTION_GET_STATUS_LED_CONFIG, [], '', 1, 'C'
204
+ end
205
+
206
+ # Returns the temperature in °C as measured inside the microcontroller. The
207
+ # value returned is not the ambient temperature!
208
+ #
209
+ # The temperature is only proportional to the real temperature and it has bad
210
+ # accuracy. Practically it is only useful as an indicator for
211
+ # temperature changes.
212
+ def get_chip_temperature
213
+ send_request FUNCTION_GET_CHIP_TEMPERATURE, [], '', 2, 's'
214
+ end
215
+
216
+ # Calling this function will reset the Bricklet. All configurations
217
+ # will be lost.
218
+ #
219
+ # After a reset you have to create new device objects,
220
+ # calling functions on the existing ones will result in
221
+ # undefined behavior!
222
+ def reset
223
+ send_request FUNCTION_RESET, [], '', 0, ''
224
+ end
225
+
226
+ # Writes a new UID into flash. If you want to set a new UID
227
+ # you have to decode the Base58 encoded UID string into an
228
+ # integer first.
229
+ #
230
+ # We recommend that you use Brick Viewer to change the UID.
231
+ def write_uid(uid)
232
+ send_request FUNCTION_WRITE_UID, [uid], 'L', 0, ''
233
+ end
234
+
235
+ # Returns the current UID as an integer. Encode as
236
+ # Base58 to get the usual string version.
237
+ def read_uid
238
+ send_request FUNCTION_READ_UID, [], '', 4, 'L'
239
+ end
240
+
241
+ # Returns the UID, the UID where the Bricklet is connected to,
242
+ # the position, the hardware and firmware version as well as the
243
+ # device identifier.
244
+ #
245
+ # The position can be 'a', 'b', 'c' or 'd'.
246
+ #
247
+ # The device identifier numbers can be found :ref:`here <device_identifier>`.
248
+ # |device_identifier_constant|
249
+ def get_identity
250
+ send_request FUNCTION_GET_IDENTITY, [], '', 25, 'Z8 Z8 k C3 C3 S'
251
+ end
252
+
253
+ # Registers a callback with ID <tt>id</tt> to the block <tt>block</tt>.
254
+ def register_callback(id, &block)
255
+ callback = block
256
+ @registered_callbacks[id] = callback
257
+ end
258
+ end
259
+ end