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 callinggetBoardInfo()
the on theNativeDeviceFactoryInterface
instance returned fromDeviceFactoryHelper.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
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
compareMakeAndModel(String make2, String model2)
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 readingsString
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 modelString
getOperatingSystemId()
String
getOperatingSystemVersion()
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, getByAdcNumberOrThrow, getByChipAndLineOffset, getByChipAndLineOffsetOrThrow, getByDacNumber, getByDacNumberOrThrow, getByGpioNumber, getByGpioNumberOrThrow, getByName, getByPhysicalPin, getByPhysicalPinOrThrow, getByPwmNumber, getByPwmNumberOrThrow, getByPwmOrGpioNumber, getByPwmOrGpioNumberOrThrow, getDacPins, getGpioPins, getGpios, getHeaderNames, getHeaders, getHeaderValues, getPwmChipNumberOverride, mapToSysFsGpioNumber
-
-
-
-
Field Detail
-
UNKNOWN
public static final String UNKNOWN
- See Also:
- Constant Field Values
-
UNKNOWN_ADC_VREF
public static final float UNKNOWN_ADC_VREF
- See Also:
- Constant Field Values
-
-
Method Detail
-
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
public String getMake()
The make of the connected board, e.g. "Raspberry Pi"- Returns:
- the make of the connected board
-
getModel
public String 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
public String 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
-
getOperatingSystemId
public String getOperatingSystemId()
-
getOperatingSystemVersion
public String getOperatingSystemVersion()
-
getName
public String getName()
Get the name of this board - usual a concatenation of make and model- Returns:
- the name of this board
-
getLongName
public String getLongName()
-
compareMakeAndModel
public boolean compareMakeAndModel(String make2, String model2)
Compare make and model- Parameters:
make2
- the make to comparemodel2
- the model to compare- Returns:
- true if the make and model are the same
-
createMmapGpio
public MmapGpioInterface 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
-
-