Skip Headers
Oracle® Java ME Embedded Getting Started Guide for the Reference Platform (Raspberry Pi)
Release 8
E48512-03
  Go To Table Of Contents
Contents

Previous
Previous
 
Next
Next
 

A Device I/O Preconfigured List

This appendix describes the proper ID and names for the various peripheral ports and buses for the Raspberry Pi embedded board, which are accessible using the Device I/O APIs.

Note that any IMlet that accesses the Device I/O APIs must be digitally signed using a trusted certificate authority. An IMlet that is not signed will encounter an authentication error when attempting to access the Device I/O APIs.

To access any device from the preconfigured peripheral list, the following permission is required:

jdk.dio.DeviceMgmtPermission(%Name%:%ID%);

You can find the names and IDs for specific devices in the tables that follow in this appendix. You must also specify an action. An empty string means open.

The tables use the following legend:

Note the following items for Device I/O in the Raspberry Pi board:

GPIO Pins

The following GPIO pins are preconfigured.

Devicel ID Device Name Mapped Configuration

2

GPIO2

GPIO 2

controllerNumber = 0

pinNumber = 2

direction = GPIOPinConfig.DIR_INPUT_ONLY

mode = GPIOPinConfig.MODE_INPUT_PULL_UP

trigger = GPIOPinConfig.TRIGGER_BOTH_EDGES

initValue - ignored

3

GPIO3

GPIO 3

controllerNumber = 0

pinNumber = 3

direction = GPIOPinConfig.DIR_INPUT_ONLY

mode = GPIOPinConfig.MODE_INPUT_PULL_UP

trigger = GPIOPinConfig.TRIGGER_BOTH_EDGES

initValue - ignored

4

GPIO4

GPIO 4

controllerNumber = 0

pinNumber = 4

direction = GPIOPinConfig.DIR_INPUT_ONLY

mode = DeviceConfig.DEFAULT

trigger = GPIOPinConfig.TRIGGER_BOTH_EDGES

initValue - ignored

7

GPIO7

GPIO 7

controllerNumber = 0

pinNumber = 7

direction = GPIOPinConfig.DIR_OUTPUT_ONLY

mode = GPIOPinConfig.MODE_OUTPUT_PUSH_PULL

trigger = GPIOPinConfig.TRIGGER_BOTH_EDGES

initValue = false

8

GPIO8

GPIO 8

controllerNumber = 0

pinNumber = 8

direction = GPIOPinConfig.DIR_OUTPUT_ONLY

mode = GPIOPinConfig.MODE_OUTPUT_PUSH_PULL

trigger = GPIOPinConfig.TRIGGER_BOTH_EDGES

initValue = false

9

GPIO9

GPIO 9

controllerNumber = 0

pinNumber = 9

direction = GPIOPinConfig.DIR_INPUT_ONLY

mode = DeviceConfig.DEFAULT

trigger = GPIOPinConfig.TRIGGER_BOTH_EDGES

initValue - ignored

10

GPIO10

GPIO 10

controllerNumber = 0

pinNumber = 10

direction = GPIOPinConfig.DIR_INPUT_ONLY

mode = DeviceConfig.DEFAULT

trigger = GPIOPinConfig.TRIGGER_BOTH_EDGES

initValue - ignored

11

GPIO11

GPIO 11

controllerNumber = 0

pinNumber = 11

direction = GPIOPinConfig.DIR_INPUT_ONLY

mode = DeviceConfig.DEFAULT

trigger = GPIOPinConfig.TRIGGER_BOTH_EDGES

initValue - ignored

14

GPIO14

GPIO 14

controllerNumber = 0

pinNumber = 14

direction = GPIOPinConfig.DIR_OUTPUT_ONLY

mode = GPIOPinConfig.MODE_OUTPUT_PUSH_PULL

trigger = GPIOPinConfig.TRIGGER_BOTH_EDGES

initValue = false

15

GPIO15

GPIO 15

controllerNumber = 0

pinNumber = 15

direction = GPIOPinConfig.DIR_OUTPUT_ONLY

mode = GPIOPinConfig.MODE_OUTPUT_PUSH_PULL

trigger = GPIOPinConfig.TRIGGER_BOTH_EDGES

initValue = false

17

GPIO17

GPIO 17

controllerNumber = 0

pinNumber = 17

direction = GPIOPinConfig.DIR_INPUT_ONLY

mode = DeviceConfig.DEFAULT

trigger = GPIOPinConfig.TRIGGER_BOTH_EDGES

initValue - ignored

18

GPIO18

GPIO 18

controllerNumber = 0

pinNumber = 18

direction = GPIOPinConfig.DIR_OUTPUT_ONLY

mode = GPIOPinConfig.MODE_OUTPUT_PUSH_PULL

trigger - ignored

initValue = false

22

GPIO22

GPIO 22

controllerNumber = 0

pinNumber = 22

direction = GPIOPinConfig.DIR_INPUT_ONLY

mode = DeviceConfig.DEFAULT

trigger = GPIOPinConfig.TRIGGER_BOTH_EDGES

initValue - ignored

23

GPIO23

GPIO 23

controllerNumber = 0

pinNumber = 23

direction = GPIOPinConfig.DIR_OUTPUT_ONLY

mode = GPIOPinConfig.MODE_OUTPUT_PUSH_PULL

trigger = GPIOPinConfig.TRIGGER_BOTH_EDGES

initValue = false

24

GPIO24

GPIO 24

controllerNumber = 0

pinNumber = 24

direction = GPIOPinConfig.DIR_OUTPUT_ONLY

mode = GPIOPinConfig.MODE_OUTPUT_PUSH_PULL

trigger = GPIOPinConfig.TRIGGER_BOTH_EDGES

initValue = false

25

GPIO25

GPIO 25

controllerNumber = 0

pinNumber = 25

direction = GPIOPinConfig.DIR_OUTPUT_ONLY

mode = GPIOPinConfig.MODE_OUTPUT_PUSH_PULL

trigger = GPIOPinConfig.TRIGGER_BOTH_EDGES

initValue = false

27

GPIO27

GPIO 27

controllerNumber = 0

pinNumber = 27

direction = GPIOPinConfig.DIR_INPUT_ONLY

mode = DeviceConfig.DEFAULT

trigger = GPIOPinConfig.TRIGGER_BOTH_EDGES

initValue - ignored


Please note the following items concerning GPIO on the Raspberry Pi board.

Description of pinout.jpg follows
Description of the illustration pinout.jpg

I2C

There is no static I2C configuration with the Raspberry Pi because there is no connected hardware. In comparison with SPI, I2C does not allow any communication with a loopback device.

Device ID Device Name Mapped Configuration

NONE


GPIO 2 (SDA)

GPIO 3 (SCL)



Please note the following items about I2C on the Raspberry Pi.

MMIO

The following MMIO peripherals are available:

Device ID Device Name Mapped Configuration

61

PWM



The MMIO peripherals include CTL, STA, RNG1, DAT1, and FIF1 registers (all of them are of type INT) with no event support.

Due to nature of memory organization of the Raspberry Pi, programmers can create a custom MMIODeviceConfig to access the memory range {0x20000000, 0x21000000}. Please note that not all addresses are accessible in the range and some of them may cause a board reboot. Please check the documentation for SFR addresses and its behavior. The end addresses are not inclusive.

SPI

The SPI has a single static configuration with the following parameters:

Device ID Device Name Mapped Configuration

12

SPI_Slave

GPIO10 (MOSI)GPIO9 (MISO)GPIO11 (SCLK)GPIO8 (CE0)

SPI bus number: 0 (SPI1)

Chip Enable: 0 (CE0/GPIO8)

The number of bit of slave's word: 8

Clock frequency in Hz: 2000000

Clock polarity and phase: 1 (CPOL_Low, CPHA_2Edge)

Bit ordering of the slave device: 1 (BIG_ENDIAN)


Please note the following items about SPI on the Raspberry Pi.


Note:

You can connect MISO and MOSI pins to get a simple loopback device for testing your code.


UART

The following UART devices are preconfigured:

Device ID Device Name Mapped Configuration

40

UART

GPIO 14 (TXD)GPIO 15 (RXD)

uartNumber = 0

baudRate = 19200

dataBits = DATABITS_8

parity = PARITY_NONE

stopBits = STOPBITS_1

flowcontrol = FLOWCONTROL_NONE

inputBufferSize - ignored

outputBufferSize - ignored


Please note the following items about UART on the Raspberry Pi.

Watchdog

The following watchdog devices are pre-configured:

Device ID Device Name Mapped Configuration

30

WDG

Platform Watchdog


31

WWDG




ATCmdDevice

The following ATCmd device is preconfigured:

Device ID Device Name Mapped Configuration

13

EMUL


A simple ATCmd device emulator. Returns OK for every command request. No async notification is supported. For debug purpose only.