Syntax
typedef struct {
  VMUINT8* read_data_ptr;
  VMUINT32 read_data_length;
  VMUINT8* write_data_ptr;
  VMUINT32 write_data_length;
} vm_dcl_spi_control_read_write_t;
ContentsIndex
PreviousUpNext
vm_dcl_spi_control_read_write_t
Example
Syntax
typedef struct {
  VMUINT8* read_data_ptr;
  VMUINT32 read_data_length;
  VMUINT8* write_data_ptr;
  VMUINT32 write_data_length;
} vm_dcl_spi_control_read_write_t;
Description

vm_dcl_spi_control_write_and_read_t holds the SPI write and read operation parameters.

Example
 VM_DCL_HANDLE spi_handle;
 vm_dcl_spi_config_parameter_t config_data;
spi_handle = vm_dcl_open(VM_DCL_SPI_PORT0,0);
if(VM_DCL_HANDLE_INVALID==spi_handle) return;
 config_data.clock_high_time = 5;
 config_data.clock_low_time = 5;
 config_data.cs_hold_time = 15;
 config_data.cs_idle_time = 15;
 config_data.cs_setup_time= 15;
 config_data.clock_polarity = VM_DCL_SPI_CLOCK_POLARITY_0;
 config_data.clock_phase = VM_DCL_SPI_CLOCK_PHASE_0;
 config_data.rx_endian = VM_DCL_SPI_ENDIAN_LITTLE;
 config_data.tx_endian = VM_DCL_SPI_ENDIAN_LITTLE;
 config_data.rx_msbf = VM_DCL_SPI_MSB_FIRST;
 config_data.tx_msbf = VM_DCL_SPI_MSB_FIRST;
 vm_dcl_spi_control_write_and_read_t  write_and_read;
 write_and_read.read_data_ptr=in_buff;
 write_and_read.read_data_length=10;
 write_and_read.write_data_ptr=out_buff;
 write_and_read.write_data_length=1;
 vm_dcl_control(spi_handle,VM_DCL_SPI_CONTROL_SET_CONFIG_PARAMETER,(void *)&config_data);
 vm_dcl_control(spi_handle,VM_DCL_SPI_CONTROL_WRITE_AND_READ,(void *)&write_and_read);
//To do something.
File

vmdcl_spi.h

Members
Members 
Description 
VMUINT8* read_data_ptr; 
The pointer to the read data. 
VMUINT32 read_data_length; 
The read data length. 
VMUINT8* write_data_ptr; 
The pointer to the write data. 
VMUINT32 write_data_length; 
The write data length. 
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.