I. Hardware Description:
J2306 socket on the motherboard is 5 programmable GPIO, we need to use inpoutx64 library for input and output operations.
|No.||Description||Address of the corresponding operation|
II. GPIO mode setting:
Through the inpoutx64 library, write the following values to the corresponding GPIOs to switch modes, write once for a long time to maintain, the board re-powered to restore the default output mode.
Input mode: 0x84000100
Three, control methods:
When the IO is in output mode: write 1 to the corresponding GPIO to indicate a high level, write 0 to indicate a low level. (Note that in the output mode, the value of the read IO is random, please ignore the value)
When IO is input mode: read the corresponding GPIO, if the value is 0X84000102 means high level, if the value is 0X84000100 means low level. (Note that the input mode, do not write data to the IO, once written data, the IO will become output mode)
Fourth, the use of sample software control instructions:
On the GPIO test samples, will provide inpoutx64 operating code of the C# sample program.
Test Software Usage
Output mode test.
Select the IO you want to test, first click "Set Output Mode" to set the IO to output mode.
Input 1 (output high level) or 0 (output low level) in the "Value (HEX)" position.
Then tap the "Write IO" button. Then use a multimeter to measure the corresponding IO to check if the output level is correct.
Input Mode Test.
Select the IO you want to test, first tap "Set Input Mode" to set the IO as input mode, the corresponding IO can be connected to GND.
The corresponding IO can be connected to GND (low level) or suspended (IO internal pull-up, default high level).
Then point to "read IO" button, view the value read (if the value is 0X84000102 means high, if the value is 0X84000100 means low), to verify the reading results.
Test software download
Execution File（Right Mouse Menu -> Save As）
Download testing software source code
Source Code（Right Mouse Menu -> Save As）