Bridge for serial communication to connected sensors
More...
|
II2CDataProducer | I2C (byte id, byte length) |
| Get an object representing the I2C data corresponding to the id. If the id value cannot be matched with an existing object, the API will create a new object using the More...
|
|
void | WriteI2C (byte deviceAddr, byte registerAddr, byte[] data) |
| Write data to a connected device via the I2C bus. More...
|
|
Task< byte[]> | ReadI2CAsync (byte deviceAddr, byte registerAddr, byte length) |
| Read data from a sensor via the I2C bus. Unlike II2CDataProducer.Read(byte, byte), this function provides a direct way to access I2C data as opposed to creating a data route. More...
|
|
ISPIDataProducer | SPI (byte id, byte length) |
| Get an object representing the SPI data corresponding to the id. If the id value cannot be matched with an existing object, the API will create a new object using the More...
|
|
void | WriteSPI (byte slaveSelectPin, byte clockPin, byte mosiPin, byte misoPin, byte mode, SpiFrequency frequency, byte[] data, bool lsbFirst=true, bool useNativePins=true) |
| Write data to a connected device via the SPI bus More...
|
|
Task< byte[]> | ReadSPIAsync (byte length, byte slaveSelectPin, byte clockPin, byte mosiPin, byte misoPin, byte mode, SpiFrequency frequency, byte[] data=null, bool lsbFirst=true, bool useNativePins=true) |
| Read data from a sensor via the SPI bus. Unlike ISPIDataProducer.Read(byte, byte, byte, byte, byte, SpiFrequency, bool, bool, byte[]), this function provides a direct way to access SPI data as opposed to creating a data route. More...
|
|
Bridge for serial communication to connected sensors
◆ I2C()
II2CDataProducer MbientLab.MetaWear.Peripheral.ISerialPassthrough.I2C |
( |
byte |
id, |
|
|
byte |
length |
|
) |
| |
Get an object representing the I2C data corresponding to the id. If the id value cannot be matched with an existing object, the API will create a new object using the
length
parameter otherwise the existing object will be returned
- Parameters
-
id | Value representing the i2c data, between [0, 254] |
length | Expected length of the data |
- Returns
- Object representing I2C data
◆ ReadI2CAsync()
Task<byte[]> MbientLab.MetaWear.Peripheral.ISerialPassthrough.ReadI2CAsync |
( |
byte |
deviceAddr, |
|
|
byte |
registerAddr, |
|
|
byte |
length |
|
) |
| |
Read data from a sensor via the I2C bus. Unlike II2CDataProducer.Read(byte, byte), this function provides a direct way to access I2C data as opposed to creating a data route.
- Parameters
-
deviceAddr | Address of the slave device |
registerAddr | Register on the slave device to access |
length | How many bytes to read |
- Returns
- Data read via the I2C bus
◆ ReadSPIAsync()
Task<byte[]> MbientLab.MetaWear.Peripheral.ISerialPassthrough.ReadSPIAsync |
( |
byte |
length, |
|
|
byte |
slaveSelectPin, |
|
|
byte |
clockPin, |
|
|
byte |
mosiPin, |
|
|
byte |
misoPin, |
|
|
byte |
mode, |
|
|
SpiFrequency |
frequency, |
|
|
byte [] |
data = null , |
|
|
bool |
lsbFirst = true , |
|
|
bool |
useNativePins = true |
|
) |
| |
Read data from a sensor via the SPI bus. Unlike ISPIDataProducer.Read(byte, byte, byte, byte, byte, SpiFrequency, bool, bool, byte[]), this function provides a direct way to access SPI data as opposed to creating a data route.
- Parameters
-
length | Number of bytes to read |
slaveSelectPin | Pin for slave select |
clockPin | Pin for serial clock |
mosiPin | Pin for master output, slave input |
misoPin | Pin for master input, slave output |
mode | SPI operating mode, see SPI Wiki Page |
frequency | SPI operating frequency |
data | Data to write to the device before the read, defaults to null |
lsbFirst | True to have LSB sent first, defaults to true |
useNativePins | True to use the nRF pin mappings rather than the GPIO pin mappings, defaults to true |
- Returns
- Data received from the read command
◆ SPI()
ISPIDataProducer MbientLab.MetaWear.Peripheral.ISerialPassthrough.SPI |
( |
byte |
id, |
|
|
byte |
length |
|
) |
| |
Get an object representing the SPI data corresponding to the id. If the id value cannot be matched with an existing object, the API will create a new object using the
length
parameter otherwise the existing object will be returned
- Parameters
-
id | Value representing the i2c data, between [0, 14] |
length | Expected length of the data |
- Returns
- Object representing SPI data
◆ WriteI2C()
void MbientLab.MetaWear.Peripheral.ISerialPassthrough.WriteI2C |
( |
byte |
deviceAddr, |
|
|
byte |
registerAddr, |
|
|
byte [] |
data |
|
) |
| |
Write data to a connected device via the I2C bus.
- Parameters
-
deviceAddr | Device to write to |
registerAddr | Device's register to write to |
data | Data to write, up to 10 bytes |
◆ WriteSPI()
void MbientLab.MetaWear.Peripheral.ISerialPassthrough.WriteSPI |
( |
byte |
slaveSelectPin, |
|
|
byte |
clockPin, |
|
|
byte |
mosiPin, |
|
|
byte |
misoPin, |
|
|
byte |
mode, |
|
|
SpiFrequency |
frequency, |
|
|
byte [] |
data, |
|
|
bool |
lsbFirst = true , |
|
|
bool |
useNativePins = true |
|
) |
| |
Write data to a connected device via the SPI bus
- Parameters
-
slaveSelectPin | Pin for slave select |
clockPin | Pin for serial clock |
mosiPin | Pin for master output, slave input |
misoPin | Pin for master input, slave output |
mode | SPI operating mode, see SPI Wiki Page |
frequency | SPI operating frequency |
data | Data to write to the device |
lsbFirst | True to have LSB sent first, defaults to true |
useNativePins | True to use the nRF pin mappings rather than the GPIO pin mappings, defaults to true |
The documentation for this interface was generated from the following file:
- MetaWear/Peripheral/ISerialPassthrough.cs