src/modules/spi.c File Reference

This is the library file for using SPI. More...

#include "sysconfig.h"
#include "spi.h"

Functions

void SPI_MasterInit (void)
 SPI_MasterInit This function is used to Initialize the Chip's SPI as the Master.
void SPI_CS_high (int ChipSelect)
 SPI_SlaveInit This function is used to Initialize the Chip's SPI as a Slave.
void SPI_CS_low (int ChipSelect)
 SPI_CS_low This function is used to set a specific Chipselect to LOW.
char SPI_MasterTransmit (int ChipSelect, char cData)
 SPI_MasterTransmit This function is used to Transmit Data via SPI (This is only working as Master, receiving is implemented as pseudo-reading)
.


Detailed Description

This is the library file for using SPI.

It contains all functions which are neccessary to handle SPI
It handles outputs/inputs with Master/Slave selecting.

It is Controller specific (only for AVR90USB)


Function Documentation

void SPI_CS_high ( int  ChipSelect  ) 

SPI_SlaveInit This function is used to Initialize the Chip's SPI as a Slave.

Parameters:
void 
Returns:
void SPI_CS_high This function is used to set a specific Chipselect to HIGH
Parameters:
ChipSelect The ChipSelect PIN we want to drive to High
Returns:
void

References SPI_PORT.

Referenced by init().

void SPI_CS_low ( int  ChipSelect  ) 

SPI_CS_low This function is used to set a specific Chipselect to LOW.

Parameters:
ChipSelect The ChipSelect PIN we want to drive to Low
Returns:
void

References SPI_PORT.

void SPI_MasterInit ( void   ) 

SPI_MasterInit This function is used to Initialize the Chip's SPI as the Master.

Parameters:
void 
Returns:
void

References DD_SPI_MISO, DD_SPI_MOSI, DD_SPI_SCK, DD_SPI_SS, DDR_SPI, PROPER_SPICON1, and SPI_PORT.

Referenced by main().

char SPI_MasterTransmit ( int  ChipSelect,
char  cData 
)

SPI_MasterTransmit This function is used to Transmit Data via SPI (This is only working as Master, receiving is implemented as pseudo-reading)
.

Parameters:
ChipSelect The ChipSelect PIN we need to drive to LOW to select the other Slave-Chip We drive it to HIGH again after the communication is finished.
cData The Byte we want to send via SPI
Returns:
char The Byte we got via pseudo-reading (SPI is a shifiting Register - so readable Data should be here)

References my_delay(), and SPI_PORT.

Referenced by get_temperature(), init_lcd(), lcd_clear(), lcd_send_bitmask(), lcd_send_char(), and lcd_set_start().


Generated on Mon Jan 12 21:12:08 2009 for BlueTemp by  doxygen 1.5.8