|
iPXE
|
Three-wire serial interface. More...
Go to the source code of this file.
Macros | |
| #define | THREEWIRE_READ 0x6 |
| Read data from memory array. | |
| #define | THREEWIRE_WRITE 0x5 |
| Write data to memory array. | |
| #define | THREEWIRE_EWEN 0x4 |
| Write enable. | |
| #define | THREEWIRE_EWEN_ADDRESS INT_MAX |
| Address to be used for write enable command. | |
| #define | THREEWIRE_WRITE_MDELAY 10 |
| Time to wait for write cycles to complete. | |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER) | |
| FILE_SECBOOT (PERMITTED) | |
| int | threewire_read (struct nvs_device *nvs, unsigned int address, void *data, size_t len) |
| Read data from three-wire device. | |
| int | threewire_write (struct nvs_device *nvs, unsigned int address, const void *data, size_t len) |
| Write data to three-wire device. | |
| int | threewire_detect_address_len (struct spi_device *device) |
| Autodetect device address length. | |
| static | __attribute__ ((always_inline)) void init_at93c06(struct spi_device *device |
| Initialise Atmel AT93C06 serial EEPROM. | |
| init_at93cx6 (device, organisation) | |
Variables | |
| static unsigned int | organisation |
| device nvs | block_size = 1 |
| device | command_len = 3 |
| device device nvs | read = threewire_read |
| device nvs | write = threewire_write |
| device | address_len = ( ( organisation == 8 ) ? 7 : 6 ) |
Three-wire serial interface.
The Atmel three-wire interface is a subset of the (newer) SPI interface, and is implemented here as a layer on top of the SPI support.
Definition in file threewire.h.
| FILE_LICENCE | ( | GPL2_OR_LATER | ) |
| FILE_SECBOOT | ( | PERMITTED | ) |
|
extern |
Read data from three-wire device.
| rc | Return status code |
Definition at line 48 of file threewire.c.
References address, assert, bus, data, DBGC, len, NULL, spi_device::nvs, rc, SPI_MODE_THREEWIRE, strerror(), and THREEWIRE_READ.
Referenced by threewire_detect_address_len().
|
extern |
Write data to three-wire device.
| rc | Return status code |
Definition at line 78 of file threewire.c.
References address, assert, bus, data, DBGC, len, mdelay(), NULL, spi_device::nvs, rc, SPI_MODE_THREEWIRE, strerror(), THREEWIRE_EWEN, THREEWIRE_EWEN_ADDRESS, THREEWIRE_WRITE, and THREEWIRE_WRITE_MDELAY.
|
extern |
Autodetect device address length.
| device | SPI device |
| rc | Return status code |
Definition at line 120 of file threewire.c.
References DBGC, NULL, rc, SPI_AUTODETECT_ADDRESS_LEN, strerror(), threewire_read(), and nvs_device::word_len_log2.
Referenced by ifec_init_eeprom().