Class: IO

IO

new IO(options)

Name Type Description
options Object
Name Type Default Description
log Boolean false optional

dump log

quickInit Boolean true optional

quickly init galileo IO

emu Boolean false optional

Run in emulation mode

fake Boolean false optional

alias of options.emu

rpc Boolean false optional

enable RPC client

hostname String undefined optional

remote RPC server's IP address

port Integer undefined optional

remote RPC server's port

Classes

RingBuffer
Servo
SPIClass
TTYUARTClass
TwoWire

Members

constantADC_RESOLUTION

12

constantBUFFER_LENGTH

32

constantCHANGE

0x08

constantCYPRESS_I2C_ADDRESS

0x20

constantDEFAULT

0

constantDEFAULT_PULSE_WIDTH

1500

constantDEG_TO_RAD

0.017453292519943295769236907684886

constantDISPLAY

0x1

constantFALLING

0x04

constantfalse

0x0

constantFN_ANALOG

0x20

constantFN_GPIO_FIXED_OUTPUT

0x02

constantFN_GPIO_OPENDRAIN

0x04

constantFN_I2C

0x10

constantFN_MUX

0x200

constantFN_PULLUP

0x100

constantFN_PWM

0x08

constantFN_RESERVED

0x400

constantFN_SPI

0x80

constantFN_UART

0x40

constantGPIO_DRIVE_HIZ

2

constantGPIO_DRIVE_PULLUP

0

constantGPIO_DRIVE_STRONG

1

constantGPIO_FAST_IO2

0x40

constantGPIO_FAST_IO3

0x80

constantGPIO_TOTAL

56

constantGPORT0_BIT0_PWM7

0x01

constantGPORT0_BIT1_PWM5

0x02

constantGPORT0_BIT3_PWM1

0x08

constantGPORT0_BIT4_PWM7

0x10

constantGPORT1_BIT0_PWM6

0xff

constantGPORT1_BIT1_PWM4

0xff

constantHIGH

0x1

constantHIGH

0x1

constantI2C1

0x00000000

constantI2C2

0x4819c000

constantINPUT

0x00

constantINPUT_FAST

0x04

constantINPUT_PULLUP

0x02

constantINVALID_SERVO

255

constantLINUX_ADC_FMT

"/sys/bus/iio/devices/iio:device0/in_voltage%d_raw"

constantLINUX_BOOTLOADER_TTY

"/dev/ttyGS0"

constantLINUX_EEPROM

"/sys/bus/i2c/devices/0-0050/eeprom"

constantLINUX_SPIDEV

"/dev/spidev1.0"

constantLOW

0x0

constantLOW

0x0

constantLSBFIRST

0

constantMAX_ANGLE

180

constantMAX_GPIO_PATH

0x200

constantMAX_NUMBER_OF_SERVOS

6

constantMAX_PULSE_WIDTH

2000

constantMAX_VARIANT_HPET_FREQ_HZ

1000

constantMIN_ANGLE

0

constantMIN_PULSE_WIDTH

544

constantMSBFIRST

1

constantMUX_DEPTH_ANALOG

0x01

constantMUX_DEPTH_DIGITAL

0x02

constantMUX_DEPTH_I2C

0x01

constantMUX_DEPTH_SPI

0x03

constantMUX_DEPTH_UART

0x02

constantMUX_SEL_AD7298_VIN0

14

constantMUX_SEL_AD7298_VIN1

15

constantMUX_SEL_AD7298_VIN2

16

constantMUX_SEL_AD7298_VIN3

17

constantMUX_SEL_AD7298_VIN4

18

constantMUX_SEL_AD7298_VIN5

19

constantMUX_SEL_I2C

18

constantMUX_SEL_NONE

-1

constantMUX_SEL_SPI1_MISO

12

constantMUX_SEL_SPI1_MOSI

11

constantMUX_SEL_SPI1_SCK

13

constantMUX_SEL_SPI1_SS_B

10

constantMUX_SEL_UART0_RXD

0

constantMUX_SEL_UART0_TXD

1

constantMY_TRACE_PREFIX

"ServoX86Lib"

constantNONE

0xFFFFFFFF

constantNUM_ANALOG_INPUTS

6

constantNUM_DIGITAL_PINS

20

constantNUM_I2C

0x01

constantNUM_SPI

0x02

constantNUM_UARTS

0x03

constantOUTPUT

0x01

constantOUTPUT_FAST

0x03

constantPA

1

constantPB

2

constantPC

3

constantPD

4

constantPE

5

constantPF

6

constantPG

7

constantPH

8

constantPIN_EINVAL

0xFFFFFFFF

constantPJ

10

constantPK

11

constantPL

12

constantPLATFORM_ID

0x06

constantRAD_TO_DEG

57.295779513082320876798154814105

constantRISING

0x02

constantSERIAL

0x0

constantSERIAL_BUFFER_SIZE

256

constantSPI_CLOCK_DIV2

0x04

constantSPI_CLOCK_DIV4

0x00

constantSPI_CLOCK_DIV8

0x05

constantSPI_CLOCK_DIV16

0x01

constantSPI_CLOCK_DIV32

0x06

constantSPI_CLOCK_DIV64

0x02

constantSPI_CLOCK_DIV128

0x03

constantSPI_MODE0

0x00

constantSPI_MODE1

0x04

constantSPI_MODE2

0x08

constantSPI_MODE3

0x0C

constanttrue

0x1

constantWIRE_INTERFACES_COUNT

1

Methods

staticIO.addRpc(funcName)

add extra customized RPC function

Name Type Description
funcName String

function name

staticIO.offload(func, config, callback){function}

offload a function to remote server.

Name Type Description
func function

the function will be offloaded to remote

config Object

configuration

callback function

the callback function for return value

staticIO.offloadClear()

clear all of offloaded function

staticIO.offloadQuery(options, callback)

query the data saved in the remote context

Name Type Description
options Object

configuration

callback function optional

callback functions for queried value

staticIO.rpc(funcName, arg)

call customized RPC function

Name Type Description
funcName String

function name

arg * repeatable

function arguments

analogRead(arg0){function}

Name Type Description
arg0 Integer
Returns:
Name Type Description
function
Integer

analogReadResolution(res){function}

Name Type Description
res Integer
Returns:
Name Type Description
function
Void

analogReference(mode){function}

Name Type Description
mode Integer
Returns:
Name Type Description
function
Void

analogWrite(arg0, arg1){function}

Name Type Description
arg0 Integer
arg1 Integer
Returns:
Name Type Description
function
Void

attachInterrupt(pin, callback, mode){function}

Name Type Description
pin Integer
callback Callback_3
mode Integer
Returns:
Name Type Description
function
Void

attachTimerInterrupt(callback, microseconds){function}

Name Type Description
callback Callback_4
microseconds Integer
Returns:
Name Type Description
function
Void

delay(arg0){function}

Name Type Description
arg0 Integer
Returns:
Name Type Description
function
Void

delayMicroseconds(us){function}

Name Type Description
us Integer
Returns:
Name Type Description
function
Void

detachInterrupt(pin){function}

Name Type Description
pin Integer
Returns:
Name Type Description
function
Void

digitalRead(pin){function}

Name Type Description
pin Integer
Returns:
Name Type Description
function
Integer

digitalWrite(pin, val){function}

Name Type Description
pin Integer
val Integer
Returns:
Name Type Description
function
Void

fastGpioDigitalLatch(){function}

Type Description
Void
Returns:
Name Type Description
function
Integer

fastGpioDigitalWrite(gpio, val){function}

Name Type Description
gpio Integer
val Integer
Returns:
Name Type Description
function
Void

fastGpioDigitalWriteDestructive(gpio){function}

Name Type Description
gpio Integer
Returns:
Name Type Description
function
Void

fastGpioSCFini(){function}

Type Description
Void
Returns:
Name Type Description
function
Void

fastGpioSCInit(){function}

Type Description
Void
Returns:
Name Type Description
function
Integer
Type Description
Void
Returns:
Name Type Description
function
Integer
Type Description
Void
Returns:
Name Type Description
function
Integer
Type Description
Void
Returns:
Name Type Description
function
Integer
Type Description
Void
Returns:
Name Type Description
function
Integer
Type Description
Void
Returns:
Name Type Description
function
Integer
Type Description
Void
Returns:
Name Type Description
function
Integer
Type Description
Void
Returns:
Name Type Description
function
Integer
Type Description
Void
Returns:
Name Type Description
function
Integer

getLed_builtinV8(){function}

Type Description
Void
Returns:
Name Type Description
function
Integer

getMisoV8(){function}

Type Description
Void
Returns:
Name Type Description
function
Integer

getMosiV8(){function}

Type Description
Void
Returns:
Name Type Description
function
Integer
Type Description
Void
Returns:
Name Type Description
function
Integer
Type Description
Void
Returns:
Name Type Description
function
Integer
Type Description
Void
Returns:
Name Type Description
function
Integer

getSerial1V8(){function}

Type Description
Void
Returns:
Name Type Description
function
Object

getSerial2V8(){function}

Type Description
Void
Returns:
Name Type Description
function
Object

getSerialV8(){function}

Type Description
Void
Returns:
Name Type Description
function
Object
Type Description
Void
Returns:
Name Type Description
function
Object
Type Description
Void
Returns:
Name Type Description
function
Integer

getWireV8(){function}

Type Description
Void
Returns:
Name Type Description
function
Object

gpio2gpiohandle(gpio){function}

Name Type Description
gpio Integer
Returns:
Name Type Description
function
Integer

i2c_add_to_buf(addr, rw, value, length){function}

Name Type Description
addr Integer
rw Integer
value Array | String | Object
length Integer
Returns:
Name Type Description
function
Integer

i2c_getadapter(i2c_bus_address){function}

Name Type Description
i2c_bus_address Integer
Returns:
Name Type Description
function
Integer

i2c_openadapter(i2c_adapter_nr){function}

Name Type Description
i2c_adapter_nr Integer
Returns:
Name Type Description
function
Integer

i2c_readbyte(i2c_fd){function}

Name Type Description
i2c_fd Integer
Returns:
Name Type Description
function
Integer

i2c_readbytes(i2c_fd, buf, length){function}

Name Type Description
i2c_fd Integer
buf Array | String | Object
length Integer
Returns:
Name Type Description
function
Integer

i2c_readwrite(i2c_fd){function}

Name Type Description
i2c_fd Integer
Returns:
Name Type Description
function
Integer

i2c_setslave(i2c_fd, addr){function}

Name Type Description
i2c_fd Integer
addr Integer
Returns:
Name Type Description
function
Integer

i2c_writebyte(i2c_fd, byte){function}

Name Type Description
i2c_fd Integer
byte Integer
Returns:
Name Type Description
function
Integer

i2c_writebytes(i2c_fd, bytes, length){function}

Name Type Description
i2c_fd Integer
bytes Array | String | Object
length Integer
Returns:
Name Type Description
function
Integer

initWithTty(tty0, tty1, tty2){function}

Name Type Description
tty0 Array | String | Object
tty1 Array | String | Object
tty2 Array | String | Object
Returns:
Name Type Description
function
Void

interrupt_fini(){function}

Type Description
Void
Returns:
Name Type Description
function
Void

interrupt_init(){function}

Type Description
Void
Returns:
Name Type Description
function
Integer
Type Description
Void
Returns:
Name Type Description
function
Integer
Type Description
Void
Returns:
Name Type Description
function
Integer

muxSelectAnalogPin(pin){function}

Name Type Description
pin Integer
Returns:
Name Type Description
function
Integer

muxSelectDigitalPin(pin){function}

Name Type Description
pin Integer
Returns:
Name Type Description
function
Integer

muxSelectI2c(interface){function}

Name Type Description
interface Integer
Returns:
Name Type Description
function
Integer

muxSelectSpi(interface){function}

Name Type Description
interface Integer
Returns:
Name Type Description
function
Integer

muxSelectUart(interface){function}

Name Type Description
interface Integer
Returns:
Name Type Description
function
Integer

pin2gpiohandle(pin){function}

Name Type Description
pin Integer
Returns:
Name Type Description
function
Integer

pin2path(pin){function}

Name Type Description
pin Integer
Returns:
Name Type Description
function
String

pin2pwmhandle_enable(pin){function}

Name Type Description
pin Integer
Returns:
Name Type Description
function
Integer

pinGetIndex(pin){function}

Name Type Description
pin Integer
Returns:
Name Type Description
function
Integer

pinHandleReopen(index){function}

Name Type Description
index Integer
Returns:
Name Type Description
function
Integer
Type Description
Void
Returns:
Name Type Description
function
Void

pinMode(pin, mode){function}

Name Type Description
pin Integer
mode Integer
Returns:
Name Type Description
function
Void

pinModeIRQ(pin, mode){function}

Name Type Description
pin Integer
mode Integer
Returns:
Name Type Description
function
Integer
Type Description
Void
Returns:
Name Type Description
function
Void

setMinimumTimerFreq(microseconds){function}

Name Type Description
microseconds Integer
Returns:
Name Type Description
function
Integer

setSerial1V8(Serial1){function}

Name Type Description
Serial1 Object
Returns:
Name Type Description
function
Void

setSerial2V8(Serial2){function}

Name Type Description
Serial2 Object
Returns:
Name Type Description
function
Void

setSerialV8(Serial){function}

Name Type Description
Serial Object
Returns:
Name Type Description
function
Void

setSpiV8(SPI){function}

Name Type Description
SPI Object
Returns:
Name Type Description
function
Void

setWireV8(Wire){function}

Name Type Description
Wire Object
Returns:
Name Type Description
function
Void

sysfsGpioDirection(gpio, output, outval){function}

Name Type Description
gpio Integer
output Integer
outval Integer
Returns:
Name Type Description
function
Integer

sysfsGpioEdgeConfig(gpio, mode){function}

Name Type Description
gpio Integer
mode Integer
Returns:
Name Type Description
function
Integer

sysfsGpioExport(gpio, path, max_path){function}

Name Type Description
gpio Integer
path Array | String | Object
max_path Integer
Returns:
Name Type Description
function
Integer

sysfsGpioGet(ihandle){function}

Name Type Description
ihandle Integer
Returns:
Name Type Description
function
Integer

sysfsGpioLevelConfig(gpio, mode){function}

Name Type Description
gpio Integer
mode Integer
Returns:
Name Type Description
function
Integer

sysfsGpioSet(ihandle, value){function}

Name Type Description
ihandle Integer
value Integer
Returns:
Name Type Description
function
Integer

sysfsGpioSetDrive(gpio, mode){function}

Name Type Description
gpio Integer
mode Integer
Returns:
Name Type Description
function
Integer

sysfsPwmDisable(handle_enable){function}

Name Type Description
handle_enable Integer
Returns:
Name Type Description
function
Integer

sysfsPwmEnable(handle_enable, handle_duty, ulValue){function}

Name Type Description
handle_enable Integer
handle_duty Integer
ulValue Integer
Returns:
Name Type Description
function
Integer

sysfsPwmExport(pwm, handle_enable, handle_duty){function}

Name Type Description
pwm Integer
handle_enable Array
handle_duty Array
Returns:
Name Type Description
function
Integer

turnOffPWM(pin){function}

Name Type Description
pin Integer
Returns:
Name Type Description
function
Void

turnOnPWM(pin){function}

Name Type Description
pin Integer
Returns:
Name Type Description
function
Void

variantEnableFastGpio(pin){function}

Name Type Description
pin Integer
Returns:
Name Type Description
function
Void

variantEnablePullup(pin, enable){function}

Name Type Description
pin Integer
enable Integer
Returns:
Name Type Description
function
Void

variantPinMode(pin, mode){function}

Name Type Description
pin Integer
mode Integer
Returns:
Name Type Description
function
Integer

variantPinModeIRQ(pin, mode){function}

Name Type Description
pin Integer
mode Integer
Returns:
Name Type Description
function
Integer
Type Description
Void
Returns:
Name Type Description
function
String