Package com.diozero.sbc
Class BoardInfo
java.lang.Object
com.diozero.sbc.BoardPinInfo
com.diozero.sbc.BoardInfo
- Direct Known Subclasses:
GenericLinuxArmBoardInfo
,UnknownBoardInfo
public abstract class BoardInfo extends BoardPinInfo
Information about the connected SBC. Note that the connected board instance
might be a remote device, e.g. connected via serial, Bluetooth or TCP/IP. The
BoardInfo instance for the connected device must be obtained by calling
getBoardInfo()
the on the
NativeDeviceFactoryInterface
instance returned from
DeviceFactoryHelper.getNativeDeviceFactory()
.-
Field Summary
Fields Modifier and Type Field Description static String
UNKNOWN
static float
UNKNOWN_ADC_VREF
Fields inherited from class com.diozero.sbc.BoardPinInfo
ADC_KEY_PREFIX, DAC_KEY_PREFIX, DEFAULT_ADC_NAME_PREFIX, DEFAULT_DAC_NAME_PREFIX, DEFAULT_GPIO_NAME_PREFIX, GPIO_KEY_PREFIX
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description boolean
compareMakeAndModel(String make, String model)
Compare make and modelMmapGpioInterface
createMmapGpio()
Instantiate the memory mapped GPIO interface for this board.float
getAdcVRef()
Get the Analog to Digital converter reference voltage to be used when taking ADC readingsfloat
getCpuTemperature()
Utility method to get the CPU temperate of the attached boardCollection<Integer>
getI2CBusNumbers()
Detect the I2C bus controller numbers that are available on this board.String
getLibraryPath()
Internal diozero method to get the library path prefix to be used when loading native libraries for this device.String
getLongName()
String
getMake()
The make of the connected board, e.g.int
getMemoryKb()
Get the memory (in KB) of the connected boardString
getModel()
The model of the connected board, e.g.String
getName()
Get the name of this board - usual a concatenation of make and modelint
getPwmChip(int pwmNum)
Get the PWM chip for the specified PWM number.abstract void
populateBoardPinInfo()
Pin initialisation is done separately to the constructor since all known BoardInfo instances get instantiated on startup by the Java ServiceLoader.String
toString()
Methods inherited from class com.diozero.sbc.BoardPinInfo
addAdcPinInfo, addAdcPinInfo, addAdcPinInfo, addAdcPinInfo, addDacPinInfo, addDacPinInfo, addDacPinInfo, addDacPinInfo, addDacPinInfo, addGeneralPinInfo, addGeneralPinInfo, addGeneralPinInfo, addGeneralPinInfo, addGeneralPinInfo, addGpioPinInfo, addGpioPinInfo, addGpioPinInfo, addGpioPinInfo, addGpioPinInfo, addGpioPinInfo, addGpioPinInfo, addPwmPinInfo, addPwmPinInfo, addPwmPinInfo, addPwmPinInfo, addPwmPinInfo, getAdcPins, getByAdcNumber, getByChipAndLineOffset, getByDacNumber, getByGpioNumber, getByName, getByPwmNumber, getDacPins, getGpioPins, getGpios, getHeaders, getHeaderValues, mapToSysFsGpioNumber
-
Field Details
-
UNKNOWN
- See Also:
- Constant Field Values
-
UNKNOWN_ADC_VREF
public static final float UNKNOWN_ADC_VREF- See Also:
- Constant Field Values
-
-
Constructor Details
-
BoardInfo
-
BoardInfo
-
-
Method Details
-
populateBoardPinInfo
public abstract void populateBoardPinInfo()Pin initialisation is done separately to the constructor since all known BoardInfo instances get instantiated on startup by the Java ServiceLoader. -
getMake
The make of the connected board, e.g. "Raspberry Pi"- Returns:
- the make of the connected board
-
getModel
The model of the connected board, e.g. "3B+"- Returns:
- the model of the connected board
-
getMemoryKb
public int getMemoryKb()Get the memory (in KB) of the connected board- Returns:
- memory in KB
-
getLibraryPath
Internal diozero method to get the library path prefix to be used when loading native libraries for this device.- Returns:
- the library path prefix
-
getAdcVRef
public float getAdcVRef()Get the Analog to Digital converter reference voltage to be used when taking ADC readings- Returns:
- the reference voltage for this board
-
getName
Get the name of this board - usual a concatenation of make and model- Returns:
- the name of this board
-
getLongName
-
compareMakeAndModel
Compare make and model- Parameters:
make
- the make to comparemodel
- the model to compare- Returns:
- true if the make and model are the same
-
getPwmChip
public int getPwmChip(int pwmNum)Get the PWM chip for the specified PWM number. Only actually relevant for sysfs PWM control on the BeagleBone Black.- Parameters:
pwmNum
- The sysfs PWM channel number- Returns:
- The PWM chip number for the requested PWM channel number, -1 if not found / not relevant
-
createMmapGpio
Instantiate the memory mapped GPIO interface for this board. Not that the caller needs to callinitialise
prior to use.- Returns:
- the MMAP GPIO interface implementation for this board, null if there isn't one
-
getI2CBusNumbers
Detect the I2C bus controller numbers that are available on this board.- Returns:
- collection of I2C bus controller numbers
-
getCpuTemperature
public float getCpuTemperature()Utility method to get the CPU temperate of the attached board- Returns:
- the CPU temperature
-
toString
-