nanoFramework.Companion.Core  1.0.0-preview004
Core library for all other nanoFramework companion libraries
nanoFramework.Companion.Core.Utils.I2CScanner Class Reference

Utility to scan the I2C bus and search for devices...This scanner simply tries to read a few bytes from an I2C device. Since many I2C devices require specific commands to read, this scanner may give a false indicator that the device is not found (since read may fail even if the device is there) More...

Public Member Functions

delegate void OnI2CDeviceFound (byte addr)
 Method signature for handling the event when a new I2C device is found during scanning the bus More...
 
int ScanForDevices (string deviceSelector)
 Scan bus for devices...Looks in the address range 9....118 Uses standard speed (100KHz) and shared bus mode More...
 

Properties

Hashtable FoundDevices [get]
 List of devices found on the bus More...
 

Events

OnI2CDeviceFound I2CDeviceFound
 Event that is raised when a new I2C device is found on the bus More...
 

Detailed Description

Utility to scan the I2C bus and search for devices...This scanner simply tries to read a few bytes from an I2C device. Since many I2C devices require specific commands to read, this scanner may give a false indicator that the device is not found (since read may fail even if the device is there)

Member Function Documentation

◆ OnI2CDeviceFound()

delegate void nanoFramework.Companion.Core.Utils.I2CScanner.OnI2CDeviceFound ( byte  addr)

Method signature for handling the event when a new I2C device is found during scanning the bus

Parameters
addrThe device address

◆ ScanForDevices()

int nanoFramework.Companion.Core.Utils.I2CScanner.ScanForDevices ( string  deviceSelector)

Scan bus for devices...Looks in the address range 9....118 Uses standard speed (100KHz) and shared bus mode

Parameters
deviceSelectorThe I2C device selector
Returns
Count of devices found

Property Documentation

◆ FoundDevices

Hashtable nanoFramework.Companion.Core.Utils.I2CScanner.FoundDevices
get

List of devices found on the bus

Event Documentation

◆ I2CDeviceFound

OnI2CDeviceFound nanoFramework.Companion.Core.Utils.I2CScanner.I2CDeviceFound

Event that is raised when a new I2C device is found on the bus


The documentation for this class was generated from the following file: