Module: BusPirate/i2c

I2C module - adds I2C function calls to the BusPirate object
Author:
  • nodebotanist
Source:

Methods


<inner> i2cConfig(options)

Configures the BusPirate to recieve I2C commands
Parameters:
Name Type Description
options Object options for the BusPirate
Properties
Name Type Description
power boolean turns on the power to the 3.3 and 5V pins when true, off when false
pullups boolean enables pullup resistors when true, disables when false
aux boolean sets the state of the AUX pin (HIGH on true, LOW on false)
cs boolean sets the state of the CS pin (HIGH on true, LOW on false)
Source:
Fires:

<inner> i2cInit(initCallback)

Initializes the I2C mode
Parameters:
Name Type Description
initCallback I2cInitCallback optional callback on completion
Source:
Fires:

<inner> i2cReadFrom(address, register, numBytes)

Reads the designated # of data bytes from the I2C device at address from the given register
Parameters:
Name Type Description
address Byte - the address of the device
register Byte - the register to read from
numBytes Number - number of bytes to be read (default 1)
Source:
Fires:

<inner> i2cWrite(register, bytes)

Writes I2C data to the BusPirate
Parameters:
Name Type Description
register byte the register to write to
bytes Array bytes to write
Source:
Fires:

Events


i2c_configured

This is an event emitted when I2C config is complete
Source:

i2c_read_complete

This event fires when the i2c read is complete
Source:

i2c_read_data

This event fires when the i2c device sends nev data
Source:

i2c_read_error

This event means there was an error reading from the i2c device
Source:

i2c_read_start

This event means we are ready to recieve i2c data
Source:

i2c_ready

I2C_ready event - signals that the BusPirate is ready for I2C commands
Source:

i2c_write_complete

This event fires when the write is complete
Source: