PCDIDE COMPILER Custom Computer Services Inc (CCS), PCDIDE COMPILER Datasheet - Page 99

PCD C-COMPILER PIC24, DSPIC

PCDIDE COMPILER

Manufacturer Part Number
PCDIDE COMPILER
Description
PCD C-COMPILER PIC24, DSPIC
Manufacturer
Custom Computer Services Inc (CCS)
Type
Compilerr
Datasheet

Specifications of PCDIDE COMPILER

For Use With/related Products
Microchip PIC24/dsPIC®
Lead Free Status / RoHS Status
Not applicable / Not applicable
Other names
429-1008
SPI
SPI™ is a fluid standard for 3 or 4 wire, full duplex communications named by Motorola. Most PIC
devices support most common SPI™ modes. CCS provides a support library for taking advantage
of both hardware and software based SPI™ functionality. For software support, see
Relevant Functions:
setup_spi(mode)
setup_spi2
Note: for devices with dual SPI interfaces a second function, setup_spi2(), is provided to configure
the second interface.
spi_data_is_in()
spi_data_is_in2()
spi_write(value)
spi_write2(value)
spi_read(value)
spi_read2(value)
Relevant Preprocessor:
None
Relevant Interrupts:
#int_sspA
#int_ssp2
#int_spi1
#int_spi2
Relevant Include Files:
None, all functions built-in to the compiler.
Relevant getenv() Parameters:
SPI
Example Code:
//configure the device to be a master, data transmitted on H-to-L clock transition
setup_spi(SPI_MASTER | SPI_H_TO_L | SPI_CLK_DIV_16);
spi_write(0x80);
value=spi_read();
value=spi_read(0x80);
Configure the hardware SPI to the specified mode. The mode configures
setup_spi2(mode) thing such as master or slave mode, clock speed and
clock/data trigger configuration.
Returns TRUE if the SPI receive buffer has a byte of data.
Transmits the value over the SPI interface. This will cause the data to be
clocked out on the SDO pin.
Performs an SPI transaction, where the value is clocked out on the SDO
pin and data clocked in on the SDI pin is returned. If you just want to
clock in data then you can use spi_read() without a parameter.
Transaction (read or write) has completed on the indicated peripheral.
Interrupts on activity from the first SPI module
Interrupts on activity from the second SPI module
Returns TRUE if the device has an SPI peripheral
//write 0x80 to SPI device
//read a value from the SPI device
//write 0x80 to SPI device the same time you are reading a value.
#USE
SPI.
85

Related parts for PCDIDE COMPILER