Main Page | File List | Globals | Related Pages

spi_lib.h File Reference

#include "lib_mcu\spi\spi_drv.h"

Go to the source code of this file.

Enumerations

enum  spi_cf_t { SPI_MASTER, SPI_SLAVE }
 This enumeration allows to define a MASTER or SLAVE configuration. More...


Functions

bit spi_init (spi_cf_t config)
 This function configures the SPI controller: -MASTER or SLAVE -bit timing -enable the controller.

char spi_putchar (char uc_wr_byte)
 This function sends a byte on the SPI.

bit spi_test_hit (void)
 This function checks if a bytes has been received on the SPI.

char spi_getchar (void)
 This function reads a byte on the SPI.


Enumeration Type Documentation

enum spi_cf_t
 

This enumeration allows to define a MASTER or SLAVE configuration.

Enumeration values:
SPI_MASTER 
SPI_SLAVE 

Definition at line 35 of file spi_lib.h.


Function Documentation

char spi_getchar void   ) 
 

This function reads a byte on the SPI.

Returns:
character read

bit spi_init spi_cf_t  config  ) 
 

This function configures the SPI controller: -MASTER or SLAVE -bit timing -enable the controller.

Parameters:
configuration of the node (MASTER or SLAVE).
Returns:
status of the init:
  1. TRUE
  2. FALSE
Precondition:
before calling this function some declaration must be define in config.h:
  • SPI_CONFIG select the prescaler, CPHA leading, CPOL LOW, LSB first.

char spi_putchar char  uc_wr_byte  ) 
 

This function sends a byte on the SPI.

Parameters:
character to send on the SPI.
Returns:
character sent

bit spi_test_hit void   ) 
 

This function checks if a bytes has been received on the SPI.

Returns:
TRUE if byte received


Generated on Thu Apr 1 15:50:21 2004 for SPI Library by doxygen 1.3.6