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:
-
board
IOBoardA reference to the IOBoard instance
-
address
NumberThe I2C address of the device
-
delayUS
NumberThe 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:
-
type
StringThe event type
-
listener
FunctionThe function to be called when the event is fired
dispatchEvent
-
type
-
optionalParams
Parameters:
-
type
EventThe Event object.
-
optionalParams
ObjectOptional 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:
-
type
StringThe event type return {boolean} True is listener exists for this type, false if not.
removeEventListener
-
type
-
listener
Parameters:
-
type
StringThe event type
-
listener
FunctionThe function to be called when the event is fired
sendI2CRequest
-
command
-
data
Send an i2c request command to the board
Parameters:
-
command
Number -
data
Number
update
()
protected
To be implemented in subclass
Properties
address
Number
[read-only] The address of the i2c device.