Change the setting of the digital output pins.
Change the setting of the digital output pins.
The first parameter specifies the pin number to be set, and the second parameter specifies either HIGH
or LOW
.
The input is of type E_PIN_STATE
. The conversion operator from E_PIN_STATE
to int
type is not defined, so direct numeric input is not allowed.
to unregister the interrupt handler.
Unregisters the interrupt handler.
Reads the values of all ports in the input settings at once.
Included in mwx library 0.1.4 or later
Reads the values of all ports in the input settings at once.
The values are stored in the order of DIO0 ... DIO19 from the LSB side. DIO19 are stored in this order.
The pins on the HIGH side are set to 1 and the pins on the LOW side are set to 0.
to enable DIO interrupt.
Enables DIO interrupts.
For a preconfigured pin, the first parameter is the pin number for which you want to enable interrupts, the second is the interrupt direction (rising, falling.
Interrupt handlers and event handlers are written in Application BEHAVIOR.
Set up an interrupt to be generated when the DIO5 pin changes from HIGH to LOW.
Basic definition of the application behavior myAppClass
. Details are omitted.
Description of the interrupt handler of the application behavior myAppClass
, which inverts the output setting of DIO12 when an interrupt of DIO5 is generated and displays *
on the serial port Serial
for events occurring after the interrupt handler is finished.
Reads the value of the port of the input configuration.
Reads the value of the port of the input configuration.
Get the input value of a pin that has been previously set as an input, either LOW
or HIGH
.
No conversion operator from type E_PIN_STATE
to type int
is defined, so direct assignment to a numeric type is not possible.
Sets the DIO (general-purpose digital IO) pin.
Sets the DIO (general-purpose digital IO) pin.
This function allows you to change the state of DIO0..19 and the pins DO0,1. The setting contents are described in the enumeration value of E_PIN_MODE
, description of DIO and Description of DO.
DO0,1 are special pins, which in principle are used for other purposes, but can also be configured as outputs. However, these pins have hardware restrictions, so care must be taken when using them.
Both pins must be guaranteed to be at a HIGH level when power is applied. If the circuit is configured to take unstable voltages, the module will not start up.
API for DIO (General-purpose digital IO)
The following functions are used for general-purpose digital IO (DIO) operations.
pinMode()
digitalWrite()
digitalRead()
attachIntDio()
detachIntDio()
The following enumeration values are handled with the type name E_PIN_MODE
.
The following enumeration values are handled with the type name E_PIN_MODE
.
The following enumeration values are handled with the type name E_PIN_STATE
.
The following enumeration values are handled with the type name E_PIN_INT_MODE
.
Definition | Name |
---|---|
Definition | Pull-up | Name |
---|---|---|
Definition | Name |
---|---|
Definition | Value | Name |
---|---|---|
Definition | Name |
---|---|
const uint8_t PIN_DIGITAL::DIO0 .. 19
DIO pins 0 to 19
const uint8_t PIN_DIGITAL::DO0 .. 1
DO pin 0,1
PIN_MODE::INPUT
None
Input
PIN_MODE::OUTPUT
None
Output
PIN_MODE::INPUT_PULLUP
Yes
Input
PIN_MODE::OUTPUT_INIT_HIGH
None
Output(init HIGH)
PIN_MODE::OUTPUT_INIT_LOW
None
Output(init LOW)
PIN_MODE::WAKE_FALLING
None
Input, raised pin, falling
PIN_MODE::WAKE_RISING
None
Input, rising pin, rising
PIN_MODE::WAKE_FALLING_PULLUP
Yes
Input, raised pin, falling
PIN_MODE::WAKE_RISING_PULLUP
Yes
Input, rising pin, rising
PIN_MODE::DISABLE_OUTPUT
Yes
return to the input state
PIN_MODE::OUTPUT
Contribute
PIN_MODE::OUTPUT_INIT_HIGH
Output (initial state HIGH)
PIN_MODE::OUTPUT_INIT_LOW
Output (initial state LOW)
PIN_MODE::DISABLE_OUTPUT
Stop setting output
PIN_STATE::HIGH
1
HIGH(=Vcc) level
PIN_STATE::LOW
0
LOW(=GND) level
PIN_INT_MODE::FALLING
falling edge
PIN_INT_MODE::RISING
rising edge