You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: ioio/README.md
+7-7
Original file line number
Diff line number
Diff line change
@@ -100,23 +100,23 @@ A pin used for PWM (Pulse-Width Modulation) output. A PWM pin produces a logic-l
100
100
101
101
## TwiMaster
102
102
103
-
An interface for controlling a TWI module, in TWI bus-master mode, enabling communication with multiple TWI-enabled slave modules.
103
+
An interface for controlling a TWI (Two Wire Interface) module, in TWI bus-master mode, enabling communication with multiple TWI-enabled slave modules.
104
104
105
105
`io = ioio.openTwiMaster(TWINumber, mode)`
106
106
107
-
Opens a TWI module number TWINumber in master mode, using its dedicated SDA and SCL pins. The TWI module will run at 100KHz and will use I2C voltage levels if mode = false (pass true for SMBus levels).
108
-
109
107
| Name | Description |
110
108
|---------|---------------|
111
-
|void write(Address, Register, DataByte) |Writes a byte of data to the given register of an I2C device with given address.|
112
-
|int readwrite(Address, NumReceiveBytes, Register, DataByte) |Writes a byte of data to the given register of an I2C device with given address and reads NumReceiveBytes. NumReceiveBytes can be max 8 bytes long.|
109
+
|void write(Address, Register, DataBytes)|Writes one or more bytes of data to the given register of an I2C device with given address.|
110
+
|int readWrite(address, NumReceiveBytes, Register, DataBytes)|Writes one or more bytes of data to the given register of an I2C device with given address and reads NumReceiveBytes. NumReceiveBytes can be max 8 bytes long.|
113
111
114
112
## SpiMaster
115
113
116
-
An interface for controlling an SPI module, in SPI bus-master mode, enabling communication with multiple SPI-enabled slave modules
114
+
An interface for controlling an SPI (Serial Peripheral Interface) module, in SPI bus-master mode, enabling communication with multiple SPI-enabled slave modules
Copy file name to clipboardexpand all lines: ioio/api.json
+31-6
Original file line number
Diff line number
Diff line change
@@ -229,6 +229,7 @@
229
229
{
230
230
"name": "PwmOutput",
231
231
"comment": "A pin used for PWM (Pulse-Width Modulation) output. A PWM pin produces a logic-level PWM signal. These signals are typically used for simulating analog outputs for controlling the intensity of LEDs, the rotation speed of motors, etc. They are also frequently used for controlling hobby servo motors. PwmOutput instances are obtained by calling IOIO#openPwmOutput. When used for motors and LEDs, a frequency of several KHz is typically used, where there is a trade-off between switching power-loses and smoothness of operation. The pulse width is typically set by specifying the duty cycle, with the setDutyCycle method. A duty cycle of 0 is \"off\", a duty cycle of 1 is \"on\", and every intermediate value produces an intermediate intensity. Please note that any devices consuming more than 20mA of current (e.g. motors) should not by directly connected the the IOIO pins, but rather through an amplification circuit suited for the specific load. When used for hobby servos, the PWM signal is rather used for encoding of the desired angle the motor should go to. By standard, a 100Hz signal is used and the pulse width is varied between 1ms and 2ms (corresponding to both extremes of the shaft angle), using setPulseWidth. The instance is alive since its creation. If the connection with the IOIO drops at any point, the instance transitions to a disconnected state, in which every attempt to use the pin (except close()) will throw a ConnectionLostException. Whenever close() is invoked the instance may no longer be used. Any resources associated with it are freed and can be reused. Typical usage (fading LED):",
232
+
"signature": "pin, frequency",
232
233
"pins": 2,
233
234
"methods": [
234
235
{
@@ -247,14 +248,38 @@
247
248
},
248
249
{
249
250
"name": "TwiMaster":
250
-
"comment": "An interface for controlling a TWI module, in TWI bus-master mode, enabling communication with multiple TWI-enabled slave modules.",
251
-
"methods": [],
252
-
"pins": 2
251
+
"comment": "An interface for controlling a TWI (Two Wire Interface) module, in TWI bus-master mode, enabling communication with multiple TWI-enabled slave modules.",
252
+
"signature": "TWINumber, mode",
253
+
"nogen" : true,
254
+
"pins": 2,
255
+
"methods": [{
256
+
"name": "write",
257
+
"rtn": "void",
258
+
"signature": "Address, Register, DataBytes",
259
+
"comment": "Writes one or more bytes of data to the given register of an I2C device with given address."
"comment": "Writes one or more bytes of data to the given register of an I2C device with given address and reads NumReceiveBytes. NumReceiveBytes can be max 8 bytes long."
265
+
}]
253
266
},
254
267
{
255
268
"name": "SpiMaster":
256
-
"comment": "An interface for controlling an SPI module, in SPI bus-master mode, enabling communication with multiple SPI-enabled slave modules",
257
-
"methods": [],
258
-
"pins": 4
269
+
"comment": "An interface for controlling an SPI (Serial Peripheral Interface) module, in SPI bus-master mode, enabling communication with multiple SPI-enabled slave modules",
270
+
"nogen" : true,
271
+
"signature": "misoPin, mosiPin, clkPin, csPin",
272
+
"pins": 4,
273
+
"methods": [{
274
+
"name": "write",
275
+
"rtn": "void",
276
+
"signature": "DataBytes",
277
+
"comment": "Writes one or more bytes of data."
278
+
},{
279
+
"name": "readWrite",
280
+
"rtn": "int",
281
+
"signature": "NumReceiveBytes, DataBytes",
282
+
"comment": "Writes one or more bytes of data and reads NumReceiveBytes. NumReceiveBytes can be max 8 bytes long."
0 commit comments