Example #1
0
void spic1Reset(void) {

    SPI1_CS = SPI_CS_IDLE;          // Disable chip select
    SPIC1_DMAR_CONbits.CHEN = 0;    // Disable DMA module
    SPIC1_DMAW_CONbits.CHEN = 0;
    SPI1STATbits.SPIROV = 0;        // Clear overwrite bit
    spi_port_ch2_unlock();          // Release lock on channel

}
Example #2
0
void spic2EndTransaction(void) {

    if (port_cs_line[1] == 0)
      SPI2_CS1 = SPI_CS_IDLE;  // Idle chip select
    if (port_cs_line[1] == 1)
      SPI2_CS2 = SPI_CS_IDLE;  // Idle chip select
    spi_port_ch2_unlock();     // Free port

}
Example #3
0
void spic2Reset(void) {

    SPI2_CS1 = SPI_CS_IDLE;         // Disable chip select
    SPI2_CS2 = SPI_CS_IDLE;         // Disable chip select
    SPIC2_DMAR_CONbits.CHEN = 0;    // Disable DMA module
    SPIC2_DMAW_CONbits.CHEN = 0;
    SPI2STATbits.SPIROV = 0;
    spi_port_ch2_unlock();          // Release lock on channel

}