lib/spi_comms.h File Reference

Definitions for the bytes sent over the SPI bus. More...


Defines

#define SPI_COMMAND_FLAG_MASK   0xf8
#define SPI_COMMAND_FLAG_VALUE   0xf8
#define SPI_COMMAND_MASK   0x07
#define MAKE_SPI_COMMAND(command)   (SPI_COMMAND_FLAG_VALUE | (command))
#define IS_SPI_COMMAND(byte)   (((byte) & SPI_COMMAND_FLAG_MASK) == SPI_COMMAND_FLAG_VALUE)
#define GET_SPI_COMMAND(byte)   ((byte) & SPI_COMMAND_MASK)
#define SPI_COMMAND_IDLE   0x7
#define SPI_COMMAND_INVERTED_BYTE   0x6
#define SPI_COMMAND_STOP_DATA   0x5
#define SPI_COMMAND_RESUME_DATA   0x4
#define SPI_COMMAND_FLOW_REQUEST   0x3
#define SPI_COMMAND_END_DATA_BLOCK   0x2


Detailed Description

Definitions for the bytes sent over the SPI bus.


Define Documentation

#define GET_SPI_COMMAND ( byte   )     ((byte) & SPI_COMMAND_MASK)

Get the command from a command byte

#define IS_SPI_COMMAND ( byte   )     (((byte) & SPI_COMMAND_FLAG_MASK) == SPI_COMMAND_FLAG_VALUE)

Test if a byte is a spi command

#define MAKE_SPI_COMMAND ( command   )     (SPI_COMMAND_FLAG_VALUE | (command))

Make a command byte

#define SPI_COMMAND_END_DATA_BLOCK   0x2

The end of a data block

#define SPI_COMMAND_FLAG_MASK   0xf8

The mask inidicating if a byte is a command byte

#define SPI_COMMAND_FLAG_VALUE   0xf8

The value of the SPI command flag bits

#define SPI_COMMAND_FLOW_REQUEST   0x3

Request the exected flow status

#define SPI_COMMAND_IDLE   0x7

The idle command - ignore these (this gives an all ones byte which is what the DS gets if nothing is on the other side of the SPI bus)

#define SPI_COMMAND_INVERTED_BYTE   0x6

Next byte is inverted data

#define SPI_COMMAND_MASK   0x07

The mask to give the command

#define SPI_COMMAND_RESUME_DATA   0x4

Resume sending data command (data flow on)

#define SPI_COMMAND_STOP_DATA   0x5

Stop sending data command (data flow off)


Generated on Sat Aug 12 18:40:55 2006 for Nintendo DS SPI UART Bridge Driver by  doxygen 1.4.7