diff --git a/html/telemetrix/index.html b/html/telemetrix/index.html index 3ab404b..8ef72f7 100644 --- a/html/telemetrix/index.html +++ b/html/telemetrix/index.html @@ -349,13 +349,6 @@
telemetrix.telemetrix
telemetrix.telemetrix
telemetrix.telemetrix
telemetrix.telemetrix
telemetrix.telemetrix
telemetrix.telemetrix
telemetrix.telemetrix
telemetrix.telemetrix
telemetrix.telemetrix
telemetrix.telemetrix
telemetrix.telemetrix
-def i2c_read(self, address, register, number_of_bytes, callback=None, i2c_port=0)
+def i2c_read(self, address, register, number_of_bytes, callback=None, i2c_port=0, write_register=True)
Read the specified number of bytes from the specified register for -the i2c device.
+Read the specified number of bytes from the +specified register for the i2c device.
:param address: i2c device address
-:param register: i2c register (or None if no register selection is needed)
+:param register: i2c register (or None if no register +selection is needed)
:param number_of_bytes: number of bytes to be read
-:param callback: Required callback function to report i2c data as a -result of read command
+:param callback: Required callback function to report +i2c data as a result of read command
:param i2c_port: 0 = default, 1 = secondary
-callback returns a data list: -[I2C_READ_REPORT, address, register, count of data bytes, data bytes, time-stamp]
:param write_register: If True, the register is written +before read +Else, the write is suppressed
+callback returns a data list:
+[I2C_READ_REPORT, address, register, count of data bytes, +data bytes, time-stamp]
def i2c_read(self, address, register, number_of_bytes,
- callback=None, i2c_port=0):
+ callback=None, i2c_port=0,
+ write_register=True):
"""
- Read the specified number of bytes from the specified register for
- the i2c device.
+ Read the specified number of bytes from the
+ specified register for the i2c device.
:param address: i2c device address
- :param register: i2c register (or None if no register selection is needed)
+ :param register: i2c register (or None if no register
+ selection is needed)
:param number_of_bytes: number of bytes to be read
- :param callback: Required callback function to report i2c data as a
- result of read command
+ :param callback: Required callback function to report
+ i2c data as a result of read command
:param i2c_port: 0 = default, 1 = secondary
+ :param write_register: If True, the register is written
+ before read
+ Else, the write is suppressed
+
callback returns a data list:
- [I2C_READ_REPORT, address, register, count of data bytes, data bytes, time-stamp]
+
+ [I2C_READ_REPORT, address, register, count of data bytes,
+ data bytes, time-stamp]
"""
self._i2c_read_request(address, register, number_of_bytes,
- callback=callback, i2c_port=i2c_port)
+ callback=callback, i2c_port=i2c_port,
+ write_register=write_register)
-def i2c_read_restart_transmission(self, address, register, number_of_bytes, callback=None, i2c_port=0)
+def i2c_read_restart_transmission(self, address, register, number_of_bytes, callback=None, i2c_port=0, write_register=True)
Read the specified number of bytes from the specified register for -the i2c device. This restarts the transmission after the read. It is -required for some i2c devices such as the MMA8452Q accelerometer.
+Read the specified number of bytes from the specified +register for the i2c device. This restarts the transmission +after the read. It is required for some i2c devices such as the MMA8452Q +accelerometer.
:param address: i2c device address
:param register: i2c register (or None if no register selection is needed)
:param number_of_bytes: number of bytes to be read
-:param callback: Required callback function to report i2c data as a -result of read command
+:param callback: Required callback function to report i2c +data as a result of read command
:param i2c_port: 0 = default 1 = secondary
+:param write_register: If True, the register is written before read +Else, the write is suppressed
callback returns a data list:
-[I2C_READ_REPORT, address, register, count of data bytes, data bytes, time-stamp]
[I2C_READ_REPORT, address, register, count of data bytes, +data bytes, time-stamp]
def i2c_read_restart_transmission(self, address, register,
number_of_bytes,
- callback=None, i2c_port=0):
+ callback=None, i2c_port=0,
+ write_register=True):
"""
- Read the specified number of bytes from the specified register for
- the i2c device. This restarts the transmission after the read. It is
- required for some i2c devices such as the MMA8452Q accelerometer.
+ Read the specified number of bytes from the specified
+ register for the i2c device. This restarts the transmission
+ after the read. It is required for some i2c devices such as the MMA8452Q
+ accelerometer.
:param address: i2c device address
@@ -5301,21 +5381,27 @@ Methods
:param number_of_bytes: number of bytes to be read
- :param callback: Required callback function to report i2c data as a
- result of read command
+ :param callback: Required callback function to report i2c
+ data as a result of read command
:param i2c_port: 0 = default 1 = secondary
+ :param write_register: If True, the register is written before read
+ Else, the write is suppressed
+
+
callback returns a data list:
- [I2C_READ_REPORT, address, register, count of data bytes, data bytes, time-stamp]
+ [I2C_READ_REPORT, address, register, count of data bytes,
+ data bytes, time-stamp]
"""
self._i2c_read_request(address, register, number_of_bytes,
stop_transmission=False,
- callback=callback, i2c_port=i2c_port)
+ callback=callback, i2c_port=i2c_port,
+ write_register=write_register)
@@ -5956,8 +6042,8 @@ Methods
The pin_type for digital input pins with pullups enabled = 11
"""
- self._set_pin_mode(pin_number, PrivateConstants.AT_INPUT_PULLUP, callback=
- callback)
+ self._set_pin_mode(pin_number, PrivateConstants.AT_INPUT_PULLUP,
+ callback=callback)
@@ -6878,6 +6964,12 @@ Methods
position. Negative is anticlockwise from
the current position. Maximum value is 32 bits.
"""
+ if relative_position < 0:
+ polarity = 1
+ else:
+ polarity = 0
+
+ relative_position = abs(relative_position)
if not self.stepper_info_list[motor_id]['instance']:
if self.shutdown_on_exception:
self.shutdown()
@@ -6888,6 +6980,7 @@ Methods
command = [PrivateConstants.STEPPER_MOVE, motor_id]
for value in position_bytes:
command.append(value)
+ command.append(polarity)
self._send_command(command)
@@ -6925,7 +7018,11 @@