ContentsIndex
PreviousUpNext
GPIO
Topics | Structs, Records, Enums
Description

Controls digital signal over GPIO pins.

Introduction

GPIO(General Purpose Input Output) module in the DCL module is one of the foundamental modules on LinkIt ONE; There are some other driver modules and middleware libraries that are implemented based on GPIO module. It is normally used for transmitting digital signals, which is different from analog signals. Digital signals have only two statuses, high and low, indicated as HIGH and LOW. The voltage of HIGH is different on each HDK, refer to the HDK documentation for details. 

Each pin is identified by GPIO _pin numbers_. This pin number is different from the pin name of the HDK. Use the macro provided in vmboard.h to access the corresponding GPIO pin numbers for each pin of the HDK. For example, the pin D0 has GPIO pin number 10, denoted as GPIO10 in LinkIt ONE HDK documentations, e.g. pin-out diagrams and pin tables. 

Before using a certain GPIO pin, you have to setup the pin mode of that pin first. The default mode is GPIO INPUT. In most cases, when you use GPIO pins, you have to combine many pins together, depending on the protocol that is used to communicate with peripheral devices.

Limitation

Although pin modes are controlled by GPIO APIs, not every GPIO pin can be configured as GPIO INPUT or OUTPUT. Refer to the HDK pin table for the possible pin mode of each pin.

Group
Structs, Records, Enums
Struct, Record, Enum 
Description 
This enum is for VM_DCL_GPIO_COMMAND_SET_CLOCK_DIVIDE, used in vm_dcl_control as parameter. Please refer the introduction of vm_dcl_gpio_control_set_clock_division_t for more details. 
This enum defines the clock_mode of parameter vm_dcl_gpio_control_set_clock_out_t for command VM_DCL_GPIO_COMMAND_SET_CLOCK_OUT. Please refer to vm_dcl_gpio_control_set_clock_out_t for details. 
GPIO commands that can be passed to GPIO devices with vm_dcl_control. Refer to each command for the related GPIO functionality. Note that for clock-related commands VM_DCL_GPIO_COMMAND_SET_CLOCK_DIVIDE and VM_DCL_GPIO_COMMAND_SET_CLOCK_OUT, open a VM_DCL_GPIO_CLOCK device instead of VM_DCL_GPIO. 
Output parameter for VM_DCL_GPIO_COMMAND_RETURN_DIRECTION command. 
The output parameter for VM_DCL_GPIO_COMMAND_READ and VM_DCL_GPIO_COMMAND_RETURN_OUT commands. 
The output parameter for GPIO_COMMAND_RETURN_MODE control command. With this command, you can get the current mode of a specified GPIOs. Please refer to the sample code in the description of VM_DCL_GPIO_CONTROL_COMMAND
Input parameter for command VM_DCL_GPIO_COMMAND_SET_CLOCK_DIVIDE. Certain GPIO pins can generate different clock waves by request. There are several clock numbers and divison values supported. Refer to the chipset datasheet for the available combinations of clock and division number. 
Input parameter for command VM_DCL_GPIO_COMMAND_SET_CLOCK_OUT. Certain GPIO pins can generate different clock waves by request. There are several clock modes supported. Refer to the chipset datasheet for the available clock modes and numbers available to each pin. 
Input parameter for command VM_DCL_GPIO_COMMAND_SET_INVERSION. When inversion is set to VM_TRUE, the definition of HIGH and LOW is reversed. 
Input parameter for command VM_DCL_GPIO_COMMAND_SET_REGISTER_STATUS_R0_R1. 
These enum defines the device for GPIO module that is passed to vm_dcl_open as a parameter. Before open the device, make sure the pin mode is configured to VM_DCL_PIN_MODE_GPIO with vm_dcl_config_pin_mode. There are two different device enums that can be opened on a GPIO pin. Use the VM_DCL_GPIO_CLOCK enum to send clock-related commands to the GPIO pin. 
Defines the HIGH and LOW state in level_status field of parameter vm_dcl_gpio_control_level_status_t
Links
Created with a commercial version of Doc-O-Matic. In order to make this message disappear you need to register this software. If you have problems registering this software please contact us at support@toolsfactory.com.