Syntax
typedef enum {
  VM_DCL_GPIO_COMMAND_READ = 1,
  VM_DCL_GPIO_COMMAND_WRITE_LOW,
  VM_DCL_GPIO_COMMAND_WRITE_HIGH,
  VM_DCL_GPIO_COMMAND_SET_MODE_0,
  VM_DCL_GPIO_COMMAND_SET_MODE_1,
  VM_DCL_GPIO_COMMAND_SET_MODE_2,
  VM_DCL_GPIO_COMMAND_SET_MODE_3,
  VM_DCL_GPIO_COMMAND_SET_MODE_4,
  VM_DCL_GPIO_COMMAND_SET_MODE_5,
  VM_DCL_GPIO_COMMAND_SET_MODE_6,
  VM_DCL_GPIO_COMMAND_SET_MODE_7,
  VM_DCL_GPIO_COMMAND_SET_MODE_8,
  VM_DCL_GPIO_COMMAND_SET_DIRECTION_OUT,
  VM_DCL_GPIO_COMMAND_SET_DIRECTION_IN,
  VM_DCL_GPIO_COMMAND_RETURN_MODE,
  VM_DCL_GPIO_COMMAND_RETURN_DIRECTION,
  VM_DCL_GPIO_COMMAND_RETURN_OUT,
  VM_DCL_GPIO_COMMAND_ENABLE_PULL,
  VM_DCL_GPIO_COMMAND_DISABLE_PULL,
  VM_DCL_GPIO_COMMAND_SET_PULL_HIGH,
  VM_DCL_GPIO_COMMAND_SET_PULL_LOW,
  VM_DCL_GPIO_COMMAND_SET_INVERSION,
  VM_DCL_GPIO_COMMAND_RESERVED_0,
  VM_DCL_GPIO_COMMAND_SET_CLOCK_OUT,
  VM_DCL_GPIO_COMMAND_SET_CLOCK_DIVIDE,
  VM_DCL_GPIO_COMMAND_RESERVED_1,
  VM_DCL_GPIO_COMMAND_RESERVED_2,
  VM_DCL_GPIO_COMMAND_RESERVED_3,
  VM_DCL_GPIO_COMMAND_RESERVED_4,
  VM_DCL_GPIO_COMMAND_RESERVED_5,
  VM_DCL_GPIO_COMMAND_RESERVED_6,
  VM_DCL_GPIO_COMMAND_RESERVED_7,
  VM_DCL_GPIO_COMMAND_RESERVED_8,
  VM_DCL_GPIO_COMMAND_RESERVED_9,
  VM_DCL_GPIO_COMMAND_RESERVED_10,
  VM_DCL_GPIO_COMMAND_RESERVED_11,
  VM_DCL_GPIO_COMMAND_RESERVED_12,
  VM_DCL_GPIO_COMMAND_RESERVED_13,
  VM_DCL_GPIO_COMMAND_RESERVED_14,
  VM_DCL_GPIO_COMMAND_SET_REGISTER_STATUS_R0_R1,
  VM_DCL_GPIO_COMMAND_SET_MODE_9,
  VM_DCL_GPIO_COMMAND_SET_MODE_10
} VM_DCL_GPIO_CONTROL_COMMAND;
ContentsIndex
PreviousUpNext
VM_DCL_GPIO_CONTROL_COMMAND
Example
Syntax
typedef enum {
  VM_DCL_GPIO_COMMAND_READ = 1,
  VM_DCL_GPIO_COMMAND_WRITE_LOW,
  VM_DCL_GPIO_COMMAND_WRITE_HIGH,
  VM_DCL_GPIO_COMMAND_SET_MODE_0,
  VM_DCL_GPIO_COMMAND_SET_MODE_1,
  VM_DCL_GPIO_COMMAND_SET_MODE_2,
  VM_DCL_GPIO_COMMAND_SET_MODE_3,
  VM_DCL_GPIO_COMMAND_SET_MODE_4,
  VM_DCL_GPIO_COMMAND_SET_MODE_5,
  VM_DCL_GPIO_COMMAND_SET_MODE_6,
  VM_DCL_GPIO_COMMAND_SET_MODE_7,
  VM_DCL_GPIO_COMMAND_SET_MODE_8,
  VM_DCL_GPIO_COMMAND_SET_DIRECTION_OUT,
  VM_DCL_GPIO_COMMAND_SET_DIRECTION_IN,
  VM_DCL_GPIO_COMMAND_RETURN_MODE,
  VM_DCL_GPIO_COMMAND_RETURN_DIRECTION,
  VM_DCL_GPIO_COMMAND_RETURN_OUT,
  VM_DCL_GPIO_COMMAND_ENABLE_PULL,
  VM_DCL_GPIO_COMMAND_DISABLE_PULL,
  VM_DCL_GPIO_COMMAND_SET_PULL_HIGH,
  VM_DCL_GPIO_COMMAND_SET_PULL_LOW,
  VM_DCL_GPIO_COMMAND_SET_INVERSION,
  VM_DCL_GPIO_COMMAND_RESERVED_0,
  VM_DCL_GPIO_COMMAND_SET_CLOCK_OUT,
  VM_DCL_GPIO_COMMAND_SET_CLOCK_DIVIDE,
  VM_DCL_GPIO_COMMAND_RESERVED_1,
  VM_DCL_GPIO_COMMAND_RESERVED_2,
  VM_DCL_GPIO_COMMAND_RESERVED_3,
  VM_DCL_GPIO_COMMAND_RESERVED_4,
  VM_DCL_GPIO_COMMAND_RESERVED_5,
  VM_DCL_GPIO_COMMAND_RESERVED_6,
  VM_DCL_GPIO_COMMAND_RESERVED_7,
  VM_DCL_GPIO_COMMAND_RESERVED_8,
  VM_DCL_GPIO_COMMAND_RESERVED_9,
  VM_DCL_GPIO_COMMAND_RESERVED_10,
  VM_DCL_GPIO_COMMAND_RESERVED_11,
  VM_DCL_GPIO_COMMAND_RESERVED_12,
  VM_DCL_GPIO_COMMAND_RESERVED_13,
  VM_DCL_GPIO_COMMAND_RESERVED_14,
  VM_DCL_GPIO_COMMAND_SET_REGISTER_STATUS_R0_R1,
  VM_DCL_GPIO_COMMAND_SET_MODE_9,
  VM_DCL_GPIO_COMMAND_SET_MODE_10
} VM_DCL_GPIO_CONTROL_COMMAND;
Description

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.

Example
  #include "vm_dcl.h"
  VM_DCL_HANDLE gpio_handle;  // device handle
  vm_dcl_gpio_control_level_status_t gpio_input_data;  // parameter for VM_DCL_GPIO_COMMAND_READ.
  gpio_handle = vm_dcl_open(VM_DCL_GPIO, 55);          // First, we call vm_dcl_open to get a handle. 55 means gpio55
  vm_dcl_control(gpio_handle, VM_DCL_GPIO_COMMAND_SET_MODE_3, NULL);                 // we call vm_dcl_control to set gpio55 as mode3.
  vm_dcl_control(gpio_handle, VM_DCL_GPIO_COMMAND_READ, (void *)&gpio_input_data);   // We call vm_dcl_control to read gpio55.
  vm_dcl_control(gpio_handle, VM_DCL_GPIO_COMMAND_WRITE_HIGH, 0);                    // we call vm_dcl_control to write gpio55.
  vm_dcl_close(gpio_handle);    // close the device handle.
File

vmdcl_gpio.h

Members
Members 
Description 
VM_DCL_GPIO_COMMAND_READ = 1 
Read level status from GPIO Pin. Uses vm_dcl_gpio_control_level_status_t as parameter. This is only valid when the direction is set to input with VM_DCL_GPIO_COMMAND_SET_DIRECTION_IN. 
VM_DCL_GPIO_COMMAND_WRITE_LOW 
Write LOW to GPIO pin. The pin must be set with VM_DCL_GPIO_COMMAND_SET_DIRECTION_OUT. 
VM_DCL_GPIO_COMMAND_WRITE_HIGH 
Write HIGH to GPIO pin. The pin must be set with VM_DCL_GPIO_COMMAND_SET_DIRECTION_OUT. 
VM_DCL_GPIO_COMMAND_SET_MODE_0 
Set pin mode to mode 0. Refer to the pin mapping table for the corresponding mode of each pin. 
VM_DCL_GPIO_COMMAND_SET_MODE_1 
Set pin mode to mode 1. Refer to the pin mapping table for the corresponding mode of each pin. 
VM_DCL_GPIO_COMMAND_SET_MODE_2 
Set pin mode to mode 2. Refer to the pin mapping table for the corresponding mode of each pin. 
VM_DCL_GPIO_COMMAND_SET_MODE_3 
Set pin mode to mode 3. Refer to the pin mapping table for the corresponding mode of each pin. 
VM_DCL_GPIO_COMMAND_SET_MODE_4 
Set pin mode to mode 4. Refer to the pin mapping table for the corresponding mode of each pin. 
VM_DCL_GPIO_COMMAND_SET_MODE_5 
Set pin mode to mode 5. Refer to the pin mapping table for the corresponding mode of each pin. 
VM_DCL_GPIO_COMMAND_SET_MODE_6 
Set pin mode to mode 6. Refer to the pin mapping table for the corresponding mode of each pin. 
VM_DCL_GPIO_COMMAND_SET_MODE_7 
Set pin mode to mode 7. Refer to the pin mapping table for the corresponding mode of each pin. 
VM_DCL_GPIO_COMMAND_SET_MODE_8 
Set pin mode to mode 8. Refer to the pin mapping table for the corresponding mode of each pin. 
VM_DCL_GPIO_COMMAND_SET_DIRECTION_OUT 
Set GPIO direction as output. 
VM_DCL_GPIO_COMMAND_SET_DIRECTION_IN 
Set GPIO direction as input. 
VM_DCL_GPIO_COMMAND_RETURN_MODE 
Get current mode of the GPIO pin. Use vm_dcl_gpio_control_mode_t as output parameter. 
VM_DCL_GPIO_COMMAND_RETURN_DIRECTION 
Get current GPIO direction. Use vm_dcl_gpio_control_direction_t as output parameter. 
VM_DCL_GPIO_COMMAND_RETURN_OUT 
Get current GPIO output level. Uses vm_dcl_gpio_control_level_status_t as parameter. This is only valid when the direction is set to input with VM_DCL_GPIO_COMMAND_SET_DIRECTION_IN. 
VM_DCL_GPIO_COMMAND_ENABLE_PULL 
Enable GPIO pull-up/down resistors. No parameter needed. 
VM_DCL_GPIO_COMMAND_DISABLE_PULL 
Disable GPIO pull-up/pull-down resistors. No parameter needed. 
VM_DCL_GPIO_COMMAND_SET_PULL_HIGH 
Set pull-up resistor. The pin must be set with VM_DCL_GPIO_COMMAND_ENABLE_PULL first. No parameter needed. 
VM_DCL_GPIO_COMMAND_SET_PULL_LOW 
Set pull-down resistor. The pin must be set with VM_DCL_GPIO_COMMAND_ENABLE_PULL first. No parameter needed. 
VM_DCL_GPIO_COMMAND_SET_INVERSION 
Enable or disable GPIO data inversion. Uses vm_dcl_gpio_control_set_division_t as parameter. This command is valid only when the direction is set to input with VM_DCL_GPIO_COMMAND_SET_DIRECTION_IN. 
VM_DCL_GPIO_COMMAND_RESERVED_0 
Reserved, do not use. 
VM_DCL_GPIO_COMMAND_SET_CLOCK_OUT 
Select the clock output source of GPIO. 
VM_DCL_GPIO_COMMAND_SET_CLOCK_DIVIDE 
Set the clock division of the clock source. 
VM_DCL_GPIO_COMMAND_RESERVED_1 
Reserved, do not use. 
VM_DCL_GPIO_COMMAND_RESERVED_2 
Reserved, do not use. 
VM_DCL_GPIO_COMMAND_RESERVED_3 
Reserved, do not use. 
VM_DCL_GPIO_COMMAND_RESERVED_4 
Reserved, do not use. 
VM_DCL_GPIO_COMMAND_RESERVED_5 
Reserved, do not use. 
VM_DCL_GPIO_COMMAND_RESERVED_6 
Reserved, do not use. 
VM_DCL_GPIO_COMMAND_RESERVED_7 
Reserved, do not use. 
VM_DCL_GPIO_COMMAND_RESERVED_8 
Reserved, do not use. 
VM_DCL_GPIO_COMMAND_RESERVED_9 
Reserved, do not use. 
VM_DCL_GPIO_COMMAND_RESERVED_10 
Reserved, do not use. 
VM_DCL_GPIO_COMMAND_RESERVED_11 
Reserved, do not use. 
VM_DCL_GPIO_COMMAND_RESERVED_12 
Reserved, do not use. 
VM_DCL_GPIO_COMMAND_RESERVED_13 
Reserved, do not use. 
VM_DCL_GPIO_COMMAND_RESERVED_14 
Reserved, do not use. 
VM_DCL_GPIO_COMMAND_SET_REGISTER_STATUS_R0_R1 
set the special gpio's pull up/down register, user should refer to the GPIO datasheet. 
VM_DCL_GPIO_COMMAND_SET_MODE_9 
Set pin mode to mode 9. Refer to the pin mapping table for the corresponding mode of each pin. 
VM_DCL_GPIO_COMMAND_SET_MODE_10 
Set pin mode to mode 10. Refer to the pin mapping table for the corresponding mode of each pin. 
Group
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.