Package com.codename1.hardware
package com.codename1.hardware
Buses and pins of embedded devices: GPIO lines (GpioPin,
GpioListener), I2C (I2cDevice), SPI (SpiDevice), serial ports
(SerialPort), PWM (PwmChannel), CAN (CanBus, CanFrame), the
hardware watchdog (Watchdog) and backlight brightness.
Hardware.getInstance() is the entry point. Ports without hardware access
report every feature as unsupported, so an application written against this
package also runs on phones, desktops and the simulator.
-
ClassDescriptionA CAN network interface, opened through
Hardware.openCan(String).One classic CAN frame: an identifier and up to eight data bytes.Receives edge events from aGpioPinthat was opened as an input with edge detection.A claimed GPIO line, opened throughHardware.openGpioOutput(String, int, boolean)orHardware.openGpioInput(String, int, int, int).Entry point to the buses and pins of the device the application runs on: GPIO lines, I2C, SPI, serial ports, PWM, CAN, the hardware watchdog and the display backlight.Thrown when a hardware bus or pin cannot be opened or an I/O operation on it fails: the device node is absent, the process lacks permission for it, the line is already claimed, or the peripheral did not acknowledge.A device on an I2C bus, opened throughHardware.openI2c(int, int).A hardware PWM channel, opened throughHardware.openPwm(int, int).A serial port in raw mode, opened throughHardware.openSerial(String, int, int, int, int).A device on an SPI bus, opened throughHardware.openSpi(int, int, int, int, int).The hardware watchdog, opened throughHardware.openWatchdog(int).