spi.c File Reference

Serial Peripheral Interface module Target: PIC16F876. More...

#include <app.h>
Include dependency graph for spi.c:

Go to the source code of this file.

Functions

void SPI_Init (void)
 
BYTE SPI_Exchange (BYTE data)
 
void SPI_Write (BYTE data)
 
BYTE SPI_Read (void)
 

Variables

volatile bit gSpiTx =CLEAR
 
volatile bit gSpiRx =CLEAR
 

Detailed Description

Serial Peripheral Interface module Target: PIC16F876.

This file is part of JADEKU Portable ADQ device for Routines Control.

Copyright (C) 2002-2009, Hernan Monserrat hemonserrat<at>gmail<dot>com

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file spi.c.

Function Documentation

◆ SPI_Exchange()

BYTE SPI_Exchange ( BYTE  data)

Poll the shift register.

Parameters
data- outgoing byte.
Returns
a byte read (input)
Remarks
do the input/output polling the register

Definition at line 62 of file spi.c.

Here is the caller graph for this function:

◆ SPI_Init()

void SPI_Init ( void  )

Initialize SPI subsystem

Definition at line 33 of file spi.c.

Here is the caller graph for this function:

◆ SPI_Read()

BYTE SPI_Read ( void  )

Get a byte from the SPI subsystem RMC packet is received.

Returns
a byte from the shift register

Definition at line 86 of file spi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SPI_Write()

void SPI_Write ( BYTE  data)

Send a byte to the SPI network.

Parameters
data- Put a data byte in the shift register.

Definition at line 75 of file spi.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ gSpiRx

volatile bit gSpiRx =CLEAR

Definition at line 29 of file spi.c.

◆ gSpiTx

volatile bit gSpiTx =CLEAR

SPI interrupt flags

Definition at line 28 of file spi.c.