available only i2c0
internal pull-up is available. But, We recommend use external pull-up resistor.
path |
type |
conditions |
description |
i2cX.mode |
string |
|
|
i2cX.sda |
pinSetting |
|
|
i2cX.scl |
pinSetting |
|
|
i2cX.clock |
integer |
- required
- 1 ≤ value ≤ 1000000
|
frequency (Hz) |
// Json Example
[
{
"i2c0": {
"mode": "master",
"sda": 0,
"scl": 1,
"clock": 500000
}
}
]
Related item
path |
type |
conditions |
description |
i2cX.mode |
string |
|
|
i2cX.sda |
pinSetting |
|
|
i2cX.scl |
pinSetting |
|
|
i2cX.slave_address |
integer |
|
|
i2cX.slave_address_length |
integer |
|
|
i2cX.address |
integer |
|
|
i2cX.address_bits |
integer |
|
|
i2cX.data |
dataArray |
|
|
i2cX.read |
integer |
|
|
// Json Example
[
{
"i2c0": {
"mode": "master",
"sda": 0,
"scl": 1,
"slave_address": 511,
"slave_address_length": 7,
"address": 511,
"address_bits": 7,
"data": [16, 34, 242],
"read": 500
}
}
]
if address over 0b01111111; then address treated as 10bit address automatically. or specify address_bits: 10 to force 10bit address mode.
path |
type |
conditions |
description |
i2cX.address |
integer |
|
|
i2cX.address_bits |
integer |
|
|
i2cX.data |
dataArray1024 |
|
|
// Json Example
[
{
"i2c0": {
"address": 511,
"address_bits": 7,
"data": [100, 255, 21, 0, 21]
}
}
]
request: read
if address over 0b01111111; then address treated as 10bit address automatically. or specify address_bits: 10 to force 10bit address mode.
Related item
path |
type |
conditions |
description |
i2cX.address |
integer |
|
|
i2cX.address_bits |
integer |
|
|
i2cX.read |
integer |
|
|
// Json Example
[
{
"i2c0": {
"address": 511,
"address_bits": 7,
"read": 512
}
}
]
path |
type |
conditions |
description |
i2cX |
null |
|
|
// Json Example
[
{
"i2c0": null
}
]
path |
type |
conditions |
description |
i2cX.mode |
string |
|
|
i2cX.address |
integer |
|
|
i2cX.data |
dataArray |
|
|
//Response Example
[
{
"i2c0": {
"mode": "master",
"address": 511,
"data": [16, 34, 242]
}
}
]
path |
type |
conditions |
description |
i2cX.mode |
string |
|
|
i2cX.address |
integer |
|
|
i2cX.is_fragmented |
boolean |
|
|
i2cX.data |
dataArray |
|
|
//Response Example
[
{
"i2c0": {
"mode": "slave",
"address": 511,
"is_fragmented": true,
"data": [16, 34, 242]
}
}
]
path |
type |
conditions |
description |
i2cX.error.message |
string |
|
io warning |
//Response Example
[
{
"i2c0": {
"error": {
"message": "Heavy output"
}
}
}
]
path |
type |
conditions |
description |
i2cX.warning.message |
string |
|
io warning |
//Response Example
[
{
"i2c0": {
"warning": {
"message": "Heavy output"
}
}
}
]
type defines
type |
conditions |
examples |
description |
array |
|
[16, 34, 242] [100, 255, 21, 0, 21]
|
Binary data array. |
type |
conditions |
examples |
description |
array |
|
|
|
type |
conditions |
examples |
description |
integer |
|
|
|