BO.I2CBase Class
A base class for I2C objects. Extend this class when creating an interface for a new I2C device. I2CBase should not be instantiated directly.
Constructor
BO.I2CBase
-
board -
address -
delayUS
Parameters:
-
boardIOBoardA reference to the IOBoard instance
-
addressNumberThe I2C address of the device
-
delayUSNumberThe number of microseconds ...
Item Index
Methods
Properties
- address
- I2CBase.I2C_CONFIG static
- I2CBase.I2C_REPLY
- I2CBase.I2C_REQUEST static
- I2CBase.READ static
- I2CBase.READ_CONTINUOUS static
- I2CBase.STOP_READING static
- I2CBase.WRITE static
Methods
addEventListener
-
type -
listener
Parameters:
-
typeStringThe event type
-
listenerFunctionThe function to be called when the event is fired
dispatchEvent
-
type -
optionalParams
Parameters:
-
typeEventThe Event object.
-
optionalParamsObjectOptional parameters passed as an object. return {boolean} True if dispatch is successful, false if not.
handleI2C
()
protected
To be implemented in subclass. Data should be: slave address, register, data0, data1...
hasEventListener
-
type
Parameters:
-
typeStringThe event type return {boolean} True is listener exists for this type, false if not.
removeEventListener
-
type -
listener
Parameters:
-
typeStringThe event type
-
listenerFunctionThe function to be called when the event is fired
sendI2CRequest
-
command -
data
Send an i2c request command to the board
Parameters:
-
commandNumber -
dataNumber
update
()
protected
To be implemented in subclass
Properties
address
Number
[read-only] The address of the i2c device.
