typedef enum { VM_PWM_CMD_START = 0xD06, VM_PWM_CMD_STOP = 0xD07, VM_PWM_CMD_SET_LEVEL = 0xD0C, VM_PWM_CMD_CONFIG = 0xD14, VM_PWM_CMD_SET_CLOCK = 0xD1B, VM_PWM_CMD_SET_COUNTER_AND_THRESHOLD = 0xD1C } VM_DCL_PWM_CONTROL_COMMAND;
typedef enum { VM_PWM_CMD_START = 0xD06, VM_PWM_CMD_STOP = 0xD07, VM_PWM_CMD_SET_LEVEL = 0xD0C, VM_PWM_CMD_CONFIG = 0xD14, VM_PWM_CMD_SET_CLOCK = 0xD1B, VM_PWM_CMD_SET_COUNTER_AND_THRESHOLD = 0xD1C } VM_DCL_PWM_CONTROL_COMMAND;
This enum defines the control commands for PWM module. The vm_dcl_control() uses these commands to control different functions of the PWM device. The applications should use the DCL (Driver Common Layer) APIs to control PWM.
#include "vmdcl.h" VM_DCL_HANDLE pwm_handle; // Declares a VM_DCL_HANDLE variable. VM_PWM_LEVEL_T pwm_level_var; pwm_handle = vm_dcl_open(VM_DCL_PWM_KPLED, 0); // Calls vm_dcl_open() to get a handle. The second parameter is always 0. pwm_level_var.pwm_level = 2; vm_dcl_control(pwm_handle, VM_PWM_CMD_SET_LEVEL, (void *)(&pwm_level_var)); // Calls vm_dcl_control() to set the KPLED full brightness. vm_dcl_close(pwm_handle); // Calls vm_dcl_close() to close the device.
vmdcl_pwm.h
|
Members |
Description |
|
VM_PWM_CMD_START = 0xD06 |
Starts HW PWM control. |
|
VM_PWM_CMD_STOP = 0xD07 |
Stops HW PWM control. |
|
VM_PWM_CMD_SET_LEVEL = 0xD0C |
Controls VM_DCL_PWM_KPLED. The keypad LED only supports 3 levels: 0,1,2. 0 means stop PWM; 1 means 50% of brightness, 2 means 100% of brightness. |
|
VM_PWM_CMD_CONFIG = 0xD14 |
Configures HW PWM. |
|
VM_PWM_CMD_SET_CLOCK = 0xD1B |
Sets PWM clock. |
|
VM_PWM_CMD_SET_COUNTER_AND_THRESHOLD = 0xD1C |
Sets PWM counter and threshold. |
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.