tinkerforge 2.1.27 → 2.1.28

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