Class BoardHardware
java.lang.Object
com.codename1.hardware.Hardware
com.codename1.impl.KernelHardware
com.codename1.backend.BoardHardware
public final class BoardHardware
extends com.codename1.impl.KernelHardware
The headless backend's
Hardware: the same kernel interfaces as the Linux
port, through the same C (cn1_hardware_impl.h, wrapped in
cn1_backend_hardware.c). A gateway or sensor hub serves its REST API and
drives its buses from one binary. Listener callbacks run on the pin's own
watcher thread, since a server has no event dispatch thread. Built for a
host other than Linux every primitive answers -ENOSYS.-
Field Summary
Fields inherited from class Hardware
EDGE_RESULT_FALLING, EDGE_RESULT_RISING, EDGE_TIMEOUT, FEATURE_BACKLIGHT, FEATURE_CAN, FEATURE_GPIO, FEATURE_I2C, FEATURE_PWM, FEATURE_SERIAL, FEATURE_SPI, FEATURE_WATCHDOG -
Method Summary
Modifier and TypeMethodDescriptionstatic voidinstall()Makes this the instanceHardware.getInstance()returns.protected intrawBacklight(int op, int value) op: 0 read, 1 maximum, 2 writevalue.protected intrawCanOpen(String iface) protected intrawCanReceive(int handle, int[] idOut, byte[] data, int timeoutMs) protected intrawCanSend(int handle, int id, boolean extended, byte[] data, int len) protected voidrawClose(int handle, boolean disarm) protected intrawGpioOpen(String chip, int line, boolean output, boolean high, int bias, int edges) protected intrawGpioRead(int handle) protected intrawGpioWaitEdge(int handle, int timeoutMs, long[] timestampOut) protected intrawGpioWrite(int handle, boolean high) protected intrawI2cOpen(int bus, int address) protected intrawI2cTransfer(int handle, byte[] write, int writeLen, byte[] read, int readLen) protected StringrawList(int kind) kind: 0 GPIO chips, 1 I2C buses, 2 SPI devices, 3 serial ports, 4 CAN interfaces.protected intrawPwmConfigure(int handle, long periodNanos, long dutyNanos, boolean enabled) protected intrawPwmOpen(int chip, int channel) protected intrawSerialOpen(String device, int baud, int dataBits, int parity, int stopBits) protected intrawSerialRead(int handle, byte[] buf, int off, int len, int timeoutMs) protected intrawSerialWrite(int handle, byte[] buf, int off, int len) protected intrawSpiOpen(int bus, int chipSelect, int mode, int speedHz, int bitsPerWord) protected intrawSpiTransfer(int handle, byte[] tx, byte[] rx, int len) protected intrawWatchdogKick(int handle) protected intrawWatchdogOpen(int timeoutSeconds) Methods inherited from class com.codename1.impl.KernelHardware
canOpen, canReceive, canSend, close, getBacklightBrightness, getMaxBacklightBrightness, getSupportedFeatures, gpioOpen, gpioRead, gpioWaitEdge, gpioWrite, i2cOpen, i2cTransfer, listCanInterfaces, listGpioChips, listI2cBuses, listSerialPorts, listSpiDevices, pwmConfigure, pwmOpen, serialOpen, serialRead, serialWrite, setBacklightBrightness, spiOpen, spiTransfer, watchdogKick, watchdogOpenMethods inherited from class Hardware
deliver, getInstance, install, isSupported, isSupported, openCan, openGpioInput, openGpioOutput, openI2c, openPwm, openSerial, openSpi, openWatchdog, unsupported
-
Method Details
-
install
public static void install()Makes this the instanceHardware.getInstance()returns. The server calls it as it starts; calling it again does nothing. -
rawList
Description copied from class:com.codename1.impl.KernelHardwarekind: 0 GPIO chips, 1 I2C buses, 2 SPI devices, 3 serial ports, 4 CAN interfaces. Names separated by newlines.- Specified by:
rawListin classcom.codename1.impl.KernelHardware
-
rawBacklight
protected int rawBacklight(int op, int value) Description copied from class:com.codename1.impl.KernelHardwareop: 0 read, 1 maximum, 2 writevalue.- Specified by:
rawBacklightin classcom.codename1.impl.KernelHardware
-
rawGpioOpen
- Specified by:
rawGpioOpenin classcom.codename1.impl.KernelHardware
-
rawGpioRead
protected int rawGpioRead(int handle) - Specified by:
rawGpioReadin classcom.codename1.impl.KernelHardware
-
rawGpioWrite
protected int rawGpioWrite(int handle, boolean high) - Specified by:
rawGpioWritein classcom.codename1.impl.KernelHardware
-
rawGpioWaitEdge
protected int rawGpioWaitEdge(int handle, int timeoutMs, long[] timestampOut) - Specified by:
rawGpioWaitEdgein classcom.codename1.impl.KernelHardware
-
rawI2cOpen
protected int rawI2cOpen(int bus, int address) - Specified by:
rawI2cOpenin classcom.codename1.impl.KernelHardware
-
rawI2cTransfer
protected int rawI2cTransfer(int handle, byte[] write, int writeLen, byte[] read, int readLen) - Specified by:
rawI2cTransferin classcom.codename1.impl.KernelHardware
-
rawSpiOpen
protected int rawSpiOpen(int bus, int chipSelect, int mode, int speedHz, int bitsPerWord) - Specified by:
rawSpiOpenin classcom.codename1.impl.KernelHardware
-
rawSpiTransfer
protected int rawSpiTransfer(int handle, byte[] tx, byte[] rx, int len) - Specified by:
rawSpiTransferin classcom.codename1.impl.KernelHardware
-
rawSerialOpen
- Specified by:
rawSerialOpenin classcom.codename1.impl.KernelHardware
-
rawSerialRead
protected int rawSerialRead(int handle, byte[] buf, int off, int len, int timeoutMs) - Specified by:
rawSerialReadin classcom.codename1.impl.KernelHardware
-
rawSerialWrite
protected int rawSerialWrite(int handle, byte[] buf, int off, int len) - Specified by:
rawSerialWritein classcom.codename1.impl.KernelHardware
-
rawPwmOpen
protected int rawPwmOpen(int chip, int channel) - Specified by:
rawPwmOpenin classcom.codename1.impl.KernelHardware
-
rawPwmConfigure
protected int rawPwmConfigure(int handle, long periodNanos, long dutyNanos, boolean enabled) - Specified by:
rawPwmConfigurein classcom.codename1.impl.KernelHardware
-
rawCanOpen
- Specified by:
rawCanOpenin classcom.codename1.impl.KernelHardware
-
rawCanSend
protected int rawCanSend(int handle, int id, boolean extended, byte[] data, int len) - Specified by:
rawCanSendin classcom.codename1.impl.KernelHardware
-
rawCanReceive
protected int rawCanReceive(int handle, int[] idOut, byte[] data, int timeoutMs) - Specified by:
rawCanReceivein classcom.codename1.impl.KernelHardware
-
rawWatchdogOpen
protected int rawWatchdogOpen(int timeoutSeconds) - Specified by:
rawWatchdogOpenin classcom.codename1.impl.KernelHardware
-
rawWatchdogKick
protected int rawWatchdogKick(int handle) - Specified by:
rawWatchdogKickin classcom.codename1.impl.KernelHardware
-
rawClose
protected void rawClose(int handle, boolean disarm) - Specified by:
rawClosein classcom.codename1.impl.KernelHardware
-