PCD
spi_prewrite(data);
Syntax:
spi_prewrite( data );
spi_prewrite( stream , data );
Parameters: stream – is the SPI stream to use as defined in the STREAM=name option in
#USE SPI.
data - the variable or constant to transfer via SPI
Returns:
Function:
Nothing.
Writes data into the SPI buffer without waiting for transfer to be completed. Can
be used in conjunction with spi_xfer() with no parameters to transfer more then 8
bits for PCM and PCH device, or more then 8 bits or 16 bits (XFER16 option) for
PCD. Function is useful when using the SSP or SSP2 interrupt service routines
for PCM and PCH device, or the SPIx interrupt service routines for PCD device.
Availability: This function is only available on devices with SPI hardware.
Requires:
Examples:
Example
Files:
Also See:
#USE SPI, and the option SLAVE is used in #USE SPI to setup PIC as a SPI
slave device
spi_prewrite(data_out);
ex_spi_slave.c
#USE SPI, spi_xfer(), spi_xfer_in(), spi_init(), spi_speed()
spi_read( ) spi_read2( )
Syntax:
value = spi_read ([ data] )
value = spi_read2 ([ data] )
Parameters: data – optional parameter and if included is an 8 bit int.
Returns:
Function:
Availability:
288
An 8 bit int
Return a value read by the SPI. If a value is passed to the spi_read() the data will
be clocked out and the data received will be returned. If no data is ready,
spi_read() will wait for the data is a SLAVE or return the last DATA clocked in from
spi_write().
If this device is the MASTER then either do a spi_write(data) followed by a
spi_read() or do a spi_read(data). These both do the same thing and will generate
a clock. If there is no data to send just do a spi_read(0) to get the clock.
If this device is a SLAVE then either call spi_read() to wait for the clock and data or
use_spi_data_is_in() to determine if data is ready.
This function is only available on devices with SPI hardware.
相关PDF资料
PCI-EXP-T42G5-N1 IP CORE PCI EXPRESS ORCA 4
PCM18XH2 PROCESSOR MODULE MPLAB-ICE 2000
PCM18XN0 PROCESSOR MODULE FOR ICE2000
PDA-B-24-615-E-2B1-1-C CIRCUIT BREAKER MAG 1P 15A
PFMF.260.2 PFMF PTC FUSE SMT 2.6A 1812
PFNF.200.2 PFNF PTC FUSE SMT 2A 1206
PFRY.375 PTC-FUSE RADIAL 72 VDC
PFSM.150.33.2 FUSE PTC 8A 15V FST-TRIP SMD
相关代理商/技术参数
PCD_09 制造商:MACOM 制造商全称:Tyco Electronics 功能描述:Low Profile PCB Relay PCD
PCD-00173-0C 制造商:Molex 功能描述:ETHERNET CABLE ASSEMBLY
PCD-00173-0E 制造商:Molex 功能描述:Ethernet Cable Assembly
PCD-00173-0H 制造商:Molex 功能描述:ETHERNET CABLE ASSEMBLY
PCD-00173-0K 制造商:Molex 功能描述:ETHERNET CABLE ASSEMBLY
PCD-00174-0C 制造商:Molex 功能描述:ETHERNET CABLE ASSEMBLY 制造商:Molex 功能描述:ETHERNET CABLE ASSEMBLY; Cable Length - Imperial:3ft; Cable Length - Metric:914.4mm; Connector Type A:RJ45 Plug; Connector Type B:RJ45 Plug; Jacket Color:Red; Approval Bodies:CSA / UL; Body Material:PVC; Cable Assembly Type:Ethernet ;RoHS Compliant: NA
PCD-00174-0E 制造商:Molex 功能描述:ETHERNET CABLE ASSEMBLY 制造商:Molex 功能描述:ETHERNET CABLE ASSEMBLY; Cable Length - Imperial:3ft; Cable Length - Metric:914.4mm; Connector Type A:RJ45 Plug; Connector Type B:RJ45 Plug; Jacket Color:Grey; Approval Bodies:CSA / UL; Body Material:PVC; Cable Assembly Type:Ethernet;RoHS Compliant: NA
PCD-00174-0H 制造商:Molex 功能描述:ETHERNET CABLE ASSEMBLY