Serial bit banged interface 0. More...
Go to the source code of this file.
Defines | |
#define | SPPI0_MAX_DEVICES 4 |
Maximum number of devices (chip selects). | |
Functions | |
int | Sppi0SetMode (ureg_t ix, ureg_t mode) |
void | Sppi0SetSpeed (ureg_t ix, uint32_t rate) |
void | Sppi0Enable (ureg_t ix) |
void | Sppi0ChipReset (ureg_t ix, uint8_t hi) |
void | Sppi0ChipSelect (ureg_t ix, uint8_t hi) |
void | Sppi0SelectDevice (ureg_t ix) |
void | Sppi0DeselectDevice (ureg_t ix) |
void | Sppi0NegSelectDevice (ureg_t ix) |
void | Sppi0NegDeselectDevice (ureg_t ix) |
uint8_t | Sppi0Byte (uint8_t data) |
Exchange a byte with the currently selected SPI device. | |
void | Sppi0Transact (CONST void *wdata, void *rdata, size_t len) |
Exchange a specified number of bytes with the currently selected SPI device. |
Serial bit banged interface 0.
* * $Log$ * Revision 1.2 2008/08/11 06:59:59 haraldkipp * BSD types replaced by stdint types (feature request #1282721). * * Revision 1.1 2007/04/12 09:07:54 haraldkipp * Configurable SPI added. * * *
Definition in file sppif0.h.
#define SPPI0_MAX_DEVICES 4 |
Maximum number of devices (chip selects).
Definition at line 59 of file sppif0.h.
Referenced by Sppi0SetMode().
void Sppi0Enable | ( | ureg_t | ix | ) |
Referenced by Sppi0NegSelectDevice(), and Sppi0SelectDevice().
Referenced by Sppi0DeselectDevice(), Sppi0NegDeselectDevice(), Sppi0NegSelectDevice(), and Sppi0SelectDevice().
void Sppi0SelectDevice | ( | ureg_t | ix | ) |
void Sppi0DeselectDevice | ( | ureg_t | ix | ) |
void Sppi0NegSelectDevice | ( | ureg_t | ix | ) |
void Sppi0NegDeselectDevice | ( | ureg_t | ix | ) |
Exchange a byte with the currently selected SPI device.
data | Byte to transmit. |
Definition at line 353 of file sppif0.c.
References inb, loop_until_bit_is_set, and outb.
Referenced by Sppi0Transact().
void Sppi0Transact | ( | CONST void * | wdata, |
void * | rdata, | ||
size_t | len | ||
) |
Exchange a specified number of bytes with the currently selected SPI device.
It is assumed, that the serial peripheral interface has been properly initialized by calling Sppi0SetMode() and optionally Sppi0SetSpeed().
Further it is assumed, that the chip select (if there is one) had been enabled by a previous call to Sppi0SelectDevice() or Sppi0NegSelectDevice().
wdata | Pointer to the data to transmit. |
rdata | Pointer to a buffer that receives the data from the device. Can be set to NULL for transmit only. May also point to the tranmit buffer, in which case the transmitted bytes are replaced by the bytes received. |
Definition at line 377 of file sppif0.c.
References CONST, and Sppi0Byte().