public class Pin
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
ANA
Helper for the pin mode
|
static int |
CNT
Helper for the counter mode
|
static int |
DOWN
Helper for the pin pull
|
static int |
HIZ
Helper for the pin pull
|
static int |
IN
Helper for the pin mode
|
static short |
INT_BOTH
Helper for the interrupt mode
Interruptions are handled in the onEvent method
|
static short |
INT_DISABLE
Helper for the interrupt mode
Interruptions are handled in the onEvent method
|
static short |
INT_FALLING
Helper for the interrupt mode
Interruptions are handled in the onEvent method
|
static short |
INT_HIGH
Helper for the interrupt mode
Interruptions are handled in the onEvent method
|
static short |
INT_LOW
Helper for the interrupt mode
Interruptions are handled in the onEvent method
|
static short |
INT_RISING
Helper for the interrupt mode
Interruptions are handled in the onEvent method
|
static int |
INVALID
Helper for the pin mode
|
static int |
OD_OUT
Helper for the pin mode
|
static int |
PA10
Pin PA10 is used for:
TnLFIW103:
digital/analog I/O but only digital when WiFi is active
(GPIO_NUM26 on ESP32)
|
static int |
PA11
Pin PA11 is used for:
TnLFIW103:
digital/analog I/O but only digital when WiFi is active
AF=I2C_SCL with JVM I2C driver
(GPIO_NUM25 on ESP32)
|
static int |
PA2
Pin PA2 is used for:
TnLFIW103: This pin must be used with care:
it is fetched by HW at reset to configure the voltage
of the processor => do NOT apply any external voltage
and do NOT modify its impedance (no pullup, no pulldown).
|
static int |
PA3
Pin PA3 is used by IoTize for programming and test purpose.
|
static int |
PA4
Pin PA4 is used by IoTize for programming and test purpose.
|
static int |
PA5
Pin PA5 used for:
TnLFIW103: /RST (reset active low) signal .
|
static int |
PA6
Pin PA6 used for:
TnLFIW103: Not connected
|
static int |
PA7
Pin PA7 used for:
TnLFIW103: Reserved.
|
static int |
PA8
Pin PA8 is used for:
TnLFIW103: This pin must be used with care:
it is fetched by HW at reset to configure the voltage
of the processor => do NOT apply any external voltage
and do NOT modify its impedance (no pullup, no pulldown).
|
static int |
PA9
Pin PA9 is used for:
TnLFIW103:
digital/analog I/O but only digital when WiFi is active
Connected to GPIO_NUM27 on ESP32
|
static int |
PB10
Pin PB10 is used for:
TnLFIW103:
IO, digital only.
|
static int |
PB11
Pin PB11 is used for:
TnLFIW103:
Clock signal of the target.
|
static int |
PB2
Pin PB2 is used for:
TnLFIW103:
digital/analog IO but only digital when WiFi is active.
|
static int |
PB3
Pin PB3 is used for:
TnLFIW103:
digital/analog Input (don't use it as output).
|
static int |
PB4
Pin PB4 is used for:
TnLFIW103:
digital/analog IO but only digital when WiFi is active.
|
static int |
PB5
Pin PB5 is used for:
TnLFIW103:
digital/analog but only digital when WiFi is active
AF: CTS of the Host UART
Connected to GPIO_NUM_13 of the ESP32
|
static int |
PB6
Pin PB6 is used for:
TnLFIW103:
DATA signal of the target.
|
static int |
PB7
Pin PB7 is used for:
TnLFIW103:
digital/analog but only digital when WiFi is active
AF=HOST_UART_TX on all taps
Connected to GPIO_NUM_2 of the ESP32
|
static int |
PB8
Pin PB8 used for:
TnLFIW103:
IO, digital only.
|
static int |
PB9
Pin PB9 used for:
TnLFIW103:
IO, digital only.
|
static int |
PP_OUT
Helper for the pin mode
|
static int |
TGT_ANA
Pin id of the Target Analog Input pin
|
static int |
TGT_CLK
Pin id of the Target Clock (S3P-CLK, SWDCK, ...)
|
static int |
TGT_DATA
Pin id of the Target Data (S3P-DAT, SWDIO, ...)
|
static int |
TGT_NRST
Pin id of the Target Reset
|
static int |
TGT_RXD
Pin id of the RXD for UART/Modbus or TDO
|
static int |
TGT_TXD
Pin id of the TXD for UART/Modbus or TDI
|
static int |
UP
Helper for the pin pull
|
static int |
X1
Pin X1 is reserved.
|
static int |
X2
Pin X2 is reserved.
|
Constructor and Description |
---|
Pin(int pinId,
int pinMode,
int pinPull)
Creates a new Pin interface.
|
Modifier and Type | Method and Description |
---|---|
int |
getMode()
Returns the mode of the pin, or Pin.INVALID if a wrong mode has been
selected.
|
int |
getValue()
Returns the value of the pin: 0 or 1 on digital IO or a voltage in mV
[0,3300] in case of analog input
|
void |
setInterrupt(int mode)
Sets interrupt on the current Pin.
|
void |
setMode(int newMode,
int newPull)
Sets the pin with a new mode and pull.
|
void |
setValue(int val)
Sets the value of the pin to the given parameter.
|
public static final int INVALID
public static final int IN
public static final int OD_OUT
public static final int PP_OUT
public static final int ANA
public static final int CNT
public static final int HIZ
public static final int UP
public static final int DOWN
public static final int TGT_NRST
public static final int TGT_TXD
public static final int TGT_RXD
public static final int TGT_CLK
public static final int TGT_DATA
public static final int TGT_ANA
public static final int PA2
public static final int PA3
public static final int PA4
public static final int PA5
public static final int PA6
public static final int PA7
public static final int PA8
public static final int PA9
public static final int PA10
public static final int PA11
public static final int PB2
public static final int PB3
public static final int PB4
public static final int PB5
public static final int PB6
public static final int PB7
public static final int PB8
public static final int PB9
public static final int PB10
public static final int PB11
public static final int X1
public static final int X2
public static final short INT_DISABLE
public static final short INT_RISING
public static final short INT_FALLING
public static final short INT_BOTH
public static final short INT_LOW
public static final short INT_HIGH
public Pin(int pinId, int pinMode, int pinPull)
pinId
- the id of the interfaced pinpinMode
- the work mode of the pinpinPull
- the pull mode of the pinpublic int getValue()
public void setValue(int val)
val
- the value to set the pin topublic void setMode(int newMode, int newPull)
newMode
- the new mode to set the pin tonewPull
- the new pull mode to set the pin topublic int getMode()
public void setInterrupt(int mode)
MainClass.onEvent(java.lang.Object)
is called with
the current Pin Object as the event parameter.mode
- the mode of the interrupt