inc/bf52x_spi.h File Reference

#include "tll_config.h"

Include dependency graph for bf52x_spi.h:

This graph shows which files directly or indirectly include this file:


Data Structures

struct  _bf52x_spi_settings_st
 .h Contains declarations for BF52X SPI driver. More...

Typedefs

typedef _bf52x_spi_settings_st bf52x_spi_settings_st
 .h Contains declarations for BF52X SPI driver.

Enumerations

enum  chipselect { PH9_J13_CS = 0, PH10_J10_CS = 1, PH12_SDCARD_CS = 2, PG1_FLASH_CS = 3 }

Functions

int bf52x_spi_csHigh (enum chipselect cs)
int bf52x_spi_csLow (enum chipselect cs)
int bf52x_spi_master_init (bf52x_spi_settings_st *spi_settings)
 Initializes the SPI interface as master.
int bf52x_spi_master_send (void *data, unsigned short len, unsigned char datatype)
 Send data.
int bf52x_spi_master_send16 (unsigned short *data, unsigned short len)
int bf52x_spi_master_send8 (unsigned char *data, unsigned short len, unsigned char usedelay)
int bf52x_spi_master_get (void *data, unsigned short len, unsigned char datatype)
 Receive data.
int bf52x_spi_master_get16 (unsigned short *data, unsigned short len)
int bf52x_spi_master_get8 (unsigned char *data, unsigned short len)
int bf52x_spi_master_release ()

Typedef Documentation

typedef struct _bf52x_spi_settings_st bf52x_spi_settings_st

.h Contains declarations for BF52X SPI driver.


Enumeration Type Documentation

enum chipselect

Enumerator:
PH9_J13_CS 
PH10_J10_CS 
PH12_SDCARD_CS 
PG1_FLASH_CS 


Function Documentation

int bf52x_spi_csHigh ( enum chipselect  cs  ) 

int bf52x_spi_csLow ( enum chipselect  cs  ) 

int bf52x_spi_master_get ( void *  data,
unsigned short  len,
unsigned char  datatype 
)

Receive data.

This function sends the command initially stored in data buffer and starts receiving the data.

Pre-conditions:

Post condtions:

Parameters:

Parameters:
data - Initialy holds the command to be transmitted and space (of length bytes) for holding received data. len - length of data to be received. datatype - Indicates 1 byte or 2 byte data buffer.
Returns:
Zero if the data transaction was successful. Else negative value.

int bf52x_spi_master_get16 ( unsigned short *  data,
unsigned short  len 
)

int bf52x_spi_master_get8 ( unsigned char *  data,
unsigned short  len 
)

int bf52x_spi_master_init ( bf52x_spi_settings_st spi_settings  ) 

Initializes the SPI interface as master.

This function initializes the SPI interface as master and configures the clock based on user input.

Pre-conditions:

Post condtions:

Parameters:

Parameters:
spi_settings - see the above bf52x_spi_settings_st structure declaration for.
Returns:
0 if initialization was successful. Else non-zero value.

int bf52x_spi_master_release (  ) 

int bf52x_spi_master_send ( void *  data,
unsigned short  len,
unsigned char  datatype 
)

Send data.

This function sends the data.

Pre-conditions:

Post condtions:

Parameters:

Parameters:
data - Holds the data to be transmitted. len - length of data to be transmitted. datatype - Indicates 1 byte or 2 byte data buffer.
Returns:
Zero if the device data transfer was successful. Else negative value.

int bf52x_spi_master_send16 ( unsigned short *  data,
unsigned short  len 
)

int bf52x_spi_master_send8 ( unsigned char *  data,
unsigned short  len,
unsigned char  usedelay 
)


Generated on 3 Mar 2014 for PAL bare-c Library by  doxygen 1.4.7