30.10.2014 Views

o_195h4n6al16jb186b1b2qs7fgssa.pdf

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2004 Microchip Technology Inc. DS51456B-page 163<br />

3.14.2 Individual Macros<br />

getcSPI1<br />

getcSPI2<br />

Description: This function is identical to ReadSPI1 and ReadSPI2.<br />

Source File: #define to ReadSPI1 and ReadSPI2 in spi.h<br />

putcSPI1<br />

putcSPI2<br />

Description: This function is identical to WriteSPI1 and WriteSPI2.<br />

Source File: #define to WriteSPI1 and WriteSPI2 in spi.h<br />

EnableIntSPI1<br />

EnableIntSPI2<br />

Description: This macro enables the SPI interrupt.<br />

Include: spi.h<br />

Arguments: None<br />

Remarks: This macro sets SPI Interrupt Enablebit of Interrupt Enable Control<br />

register.<br />

Code Example: EnableIntSPI1;<br />

DisableIntSPI1<br />

DisableIntSPI2<br />

Description: This macro disables the SPI interrupt.<br />

Include: spi.h<br />

Arguments: None<br />

Remarks: This macro clears SPI Interrupt Enablebit of Interrupt Enable Control<br />

register.<br />

Code Example: DisableIntSPI2;<br />

SetPriorityIntSPI1<br />

SetPriorityIntSPI2<br />

Description: This macro sets priority for SPI interrupt.<br />

Include: spi.h<br />

Arguments: priority<br />

Remarks: This macro sets SPI Interrupt Priority bits of Interrupt Priority Control<br />

register.<br />

Code Example: SetPriorityIntSPI2(2);<br />

dsPIC<br />

®<br />

Language Tools Libraries<br />

WriteSPI1 (TMR1);<br />

trong khi (SPI1STATbits.SPITBF);<br />

trong khi (DataRdySPI2 ());<br />

datard = ReadSPI2 ();<br />

if (datard

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!