spi_bit.h File Reference

SPI bit-bashing interface. More...

#include <gpxe/spi.h>
#include <gpxe/bitbash.h>

Go to the source code of this file.

Data Structures

struct  spi_bit_basher
 A bit-bashing SPI bus. More...

Defines

#define SPI_BIT_SS(slave)   ( SPI_BIT_SS0 + (slave) )
 Determine bit index for a particular slave.
#define SPI_BIT_UDELAY   1
 Delay between SCLK transitions.
#define SPI_BIT_BIG_ENDIAN   0
 SPI bit basher treats data as big-endian.
#define SPI_BIT_LITTLE_ENDIAN   1
 SPI bit basher treats data as little-endian.

Enumerations

enum  { SPI_BIT_SCLK = 0, SPI_BIT_MOSI, SPI_BIT_MISO, SPI_BIT_SS0 }
 Bit indices used for SPI bit-bashing interface. More...

Functions

 FILE_LICENCE (GPL2_OR_LATER)
void init_spi_bit_basher (struct spi_bit_basher *spibit)
 Initialise SPI bit-bashing interface.


Detailed Description

SPI bit-bashing interface.

Definition in file spi_bit.h.


Define Documentation

#define SPI_BIT_SS ( slave   )     ( SPI_BIT_SS0 + (slave) )

Determine bit index for a particular slave.

Parameters:
slave Slave number
Return values:
index Bit index (i.e. SPI_BIT_SSN, where N=slave)

Definition at line 50 of file spi_bit.h.

Referenced by spi_bit_set_slave_select().

#define SPI_BIT_UDELAY   1

Delay between SCLK transitions.

Definition at line 53 of file spi_bit.h.

Referenced by spi_bit_delay().

#define SPI_BIT_BIG_ENDIAN   0

SPI bit basher treats data as big-endian.

Definition at line 56 of file spi_bit.h.

Referenced by spi_bit_rw(), and spi_bit_transfer().

#define SPI_BIT_LITTLE_ENDIAN   1

SPI bit basher treats data as little-endian.

Definition at line 59 of file spi_bit.h.

Referenced by natsemi_init_eeprom().


Enumeration Type Documentation

anonymous enum

Bit indices used for SPI bit-bashing interface.

Enumerator:
SPI_BIT_SCLK  Serial clock.
SPI_BIT_MOSI  Master Out Slave In.
SPI_BIT_MISO  Master In Slave Out.
SPI_BIT_SS0  Slave 0 select.

Definition at line 33 of file spi_bit.h.

00033      {
00034         /** Serial clock */
00035         SPI_BIT_SCLK = 0,
00036         /** Master Out Slave In */
00037         SPI_BIT_MOSI,
00038         /** Master In Slave Out */
00039         SPI_BIT_MISO,
00040         /** Slave 0 select */
00041         SPI_BIT_SS0,
00042 };


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER   ) 

void init_spi_bit_basher ( struct spi_bit_basher spibit  ) 

Initialise SPI bit-bashing interface.

Parameters:
spibit SPI bit-bashing interface

Definition at line 221 of file spi_bit.c.

References assert, spi_bit_basher::basher, spi_bit_basher::bus, NULL, bit_basher::op, bit_basher_operations::read, spi_bus::rw, spi_bit_rw(), and bit_basher_operations::write.

Referenced by ifec_init_eeprom(), natsemi_init_eeprom(), rtl818x_probe(), and rtl_init_eeprom().

00221                                                            {
00222         assert ( &spibit->basher.op->read != NULL );
00223         assert ( &spibit->basher.op->write != NULL );
00224         spibit->bus.rw = spi_bit_rw;
00225 }


Generated on Tue Apr 6 20:01:52 2010 for gPXE by  doxygen 1.5.7.1