Data Structures | |
| struct | _AT45D_DCB |
Defines | |
| #define | SPI_RATE_AT45D0 33000000 |
| #define | SPI_MODE_AT45D0 SPI_MODE_3 |
| #define | SPI_RATE_AT45D1 33000000 |
| #define | SPI_MODE_AT45D1 SPI_MODE_3 |
| #define | SPI_RATE_AT45D2 33000000 |
| #define | SPI_MODE_AT45D2 SPI_MODE_3 |
| #define | SPI_RATE_AT45D3 33000000 |
| #define | SPI_MODE_AT45D3 SPI_MODE_3 |
Typedefs | |
| typedef struct _AT45D_DCB | AT45D_DCB |
Functions | |
| int | At45dNodeLock (NUTSPINODE *node) |
| void | At45dNodeUnlock (NUTSPINODE *node) |
| int | At45dNodeTransfer (NUTSPINODE *node, uint8_t op, uint32_t parm, uint_fast8_t oplen, CONST void *txbuf, void *rxbuf, int xlen) |
| Execute DataFlash command with data transfer. | |
| int | At45dNodeCommand (NUTSPINODE *node, uint8_t op, uint32_t parm, uint_fast8_t oplen) |
| Execute DataFlash command without data. | |
| uint8_t | At45dNodeStatus (NUTSPINODE *node) |
| Query the status of the serial flash. | |
| int | At45dNodeWaitReady (NUTSPINODE *node, uint32_t tmo, int poll) |
| Wait until DataFlash memory cycle finished. | |
| AT45D_INFO * | At45dNodeProbe (NUTSPINODE *node) |
| Determine the DataFlash type. | |
Variables | |
| NUTSPINODE | nodeAt45d0 |
| First AT45D DataFlash SPI node implementation structure. | |
| NUTSPINODE | nodeAt45d1 |
| Second AT45D DataFlash SPI node implementation structure. | |
| NUTSPINODE | nodeAt45d2 |
| Third AT45D DataFlash SPI node implementation structure. | |
| NUTSPINODE | nodeAt45d3 |
| Forth AT45D DataFlash SPI node implementation structure. | |
| #define SPI_RATE_AT45D0 33000000 |
Definition at line 267 of file spi_node_at45d.c.
| #define SPI_MODE_AT45D0 SPI_MODE_3 |
Definition at line 275 of file spi_node_at45d.c.
| #define SPI_RATE_AT45D1 33000000 |
Definition at line 308 of file spi_node_at45d.c.
| #define SPI_MODE_AT45D1 SPI_MODE_3 |
Definition at line 316 of file spi_node_at45d.c.
| #define SPI_RATE_AT45D2 33000000 |
Definition at line 346 of file spi_node_at45d.c.
| #define SPI_MODE_AT45D2 SPI_MODE_3 |
Definition at line 354 of file spi_node_at45d.c.
| #define SPI_RATE_AT45D3 33000000 |
Definition at line 384 of file spi_node_at45d.c.
| #define SPI_MODE_AT45D3 SPI_MODE_3 |
Definition at line 392 of file spi_node_at45d.c.
| typedef struct _AT45D_DCB AT45D_DCB |
| int At45dNodeLock | ( | NUTSPINODE * | node | ) |
Definition at line 80 of file spi_node_at45d.c.
References _AT45D_DCB::dcb_lock, _NUTSPINODE::node_dcb, NUT_WAIT_INFINITE, and NutEventWait().

| void At45dNodeUnlock | ( | NUTSPINODE * | node | ) |
Definition at line 87 of file spi_node_at45d.c.
References _AT45D_DCB::dcb_lock, _NUTSPINODE::node_dcb, and NutEventPost().

| int At45dNodeTransfer | ( | NUTSPINODE * | node, |
| uint8_t | op, | ||
| uint32_t | parm, | ||
| uint_fast8_t | oplen, | ||
| CONST void * | txbuf, | ||
| void * | rxbuf, | ||
| int | xlen | ||
| ) |
Execute DataFlash command with data transfer.
| node | Specifies the SPI node. |
| op | Command code. |
| parm | Command parameter. |
| oplen | Command length. |
| txbuf | Pointer to the transmit data buffer, may be set to NULL. |
| rxbuf | Pointer to the receive data buffer, may be set to NULL. |
| xlen | Number of byte to receive and/or transmit. |
Definition at line 132 of file spi_node_at45d.c.
References _NUTSPIBUS::bus_alloc, _NUTSPIBUS::bus_release, _NUTSPIBUS::bus_transfer, _NUTSPINODE::node_bus, and NUTASSERT.
Referenced by At45dNodeCommand().
| int At45dNodeCommand | ( | NUTSPINODE * | node, |
| uint8_t | op, | ||
| uint32_t | parm, | ||
| uint_fast8_t | oplen | ||
| ) |
Execute DataFlash command without data.
| node | Specifies the SPI node. |
| op | Command operation code. |
| parm | Optional command parameter. |
| oplen | Command length. |
Definition at line 167 of file spi_node_at45d.c.
References At45dNodeTransfer().

| uint8_t At45dNodeStatus | ( | NUTSPINODE * | node | ) |
Query the status of the serial flash.
| node | Specifies the SPI node. |
Definition at line 179 of file spi_node_at45d.c.
References _NUTSPIBUS::bus_alloc, _NUTSPIBUS::bus_release, _NUTSPIBUS::bus_transfer, _NUTSPIBUS::bus_wait, DFCMD_READ_STATUS, _NUTSPINODE::node_bus, NUT_WAIT_INFINITE, and NUTASSERT.
Referenced by At45dNodeProbe(), and At45dNodeWaitReady().
| int At45dNodeWaitReady | ( | NUTSPINODE * | node, |
| uint32_t | tmo, | ||
| int | poll | ||
| ) |
Wait until DataFlash memory cycle finished.
| node | Specifies the SPI node. |
| tmo | Number of loops (or milliseconds) to wait at max. |
| poll | If 0, the current thread will be suspended for 1 millisecond between each retry. Otherwise the polling loop will not sleep, but may be still suspended by the lower level SPI bus driver. |
Definition at line 219 of file spi_node_at45d.c.
References At45dNodeStatus(), and NutSleep().
Referenced by At45dNodeProbe().

| AT45D_INFO* At45dNodeProbe | ( | NUTSPINODE * | node | ) |
Determine the DataFlash type.
If the board contains a known DataFlash chip, but couldn't be determined by this routine, then most probably the chip select configuration is wrong.
| node | Specifies the SPI node. |
Definition at line 247 of file spi_node_at45d.c.
References at45d_info, at45d_known_types, AT45D_STATUS_DENSITY, AT45D_STATUS_PAGE_SIZE, At45dNodeStatus(), and At45dNodeWaitReady().

{
NULL,
NULL,
SPI_RATE_AT45D0,
SPI_MODE_AT45D0,
8,
0,
&dcbAt45d0
}
First AT45D DataFlash SPI node implementation structure.
Definition at line 297 of file spi_node_at45d.c.
{
NULL,
NULL,
SPI_RATE_AT45D1,
SPI_MODE_AT45D1,
8,
0,
&dcbAt45d1
}
Second AT45D DataFlash SPI node implementation structure.
Definition at line 335 of file spi_node_at45d.c.
{
NULL,
NULL,
SPI_RATE_AT45D2,
SPI_MODE_AT45D2,
8,
0,
&dcbAt45d2
}
Third AT45D DataFlash SPI node implementation structure.
Definition at line 373 of file spi_node_at45d.c.
{
NULL,
NULL,
SPI_RATE_AT45D3,
SPI_MODE_AT45D3,
8,
0,
&dcbAt45d3
}
Forth AT45D DataFlash SPI node implementation structure.
Definition at line 411 of file spi_node_at45d.c.