Enumerations | |
| enum | card_spi_return_code { CARD_SPI_OK, CARD_SPI_BUSY } |
| The driver function return codes. More... | |
| enum | card_spi_clock_freq { CARD_SPI_4_MHZ_CLOCK = 0, CARD_SPI_2_MHZ_CLOCK = 1, CARD_SPI_1_MHZ_CLOCK = 2, CARD_SPI_524_KHZ_CLOCK = 3 } |
| The SPI bus clock frequencies. More... | |
Functions | |
| void | init_cardSPI (void) |
| Initialise the SPI driver. | |
| void | disable_cardSPI (void) |
| Disable the Card SPI bus. | |
| void | config_cardSPI (enum card_spi_clock_freq freq, int use_interrupts) |
| Set the configuration of the Card SPI bus. | |
| void | setupConsecutive_cardSPI (uint32_t num_bytes) |
| Set up a transfer of a number of consecutive bytes. | |
| enum card_spi_return_code | read_cardSPI (uint8_t *read_byte) |
| Read from the card SPI. | |
| enum card_spi_return_code | readBlocking_cardSPI (uint8_t *read_byte) |
| Read from the card SPI blocking if it is busy. | |
| enum card_spi_return_code | write_cardSPI (uint8_t byte) |
| Write a byte out on the SPI bus (initiates a transfer). | |
| enum card_spi_return_code | writeBlocking_cardSPI (uint8_t byte) |
| Write a byte out on the SPI bus (initiates a transfer) blocking until the write can be performed. | |
| enum card_spi_clock_freq |
| enum card_spi_return_code |
| void disable_cardSPI | ( | void | ) |
Disable the Card SPI bus.
Disables the Card SPI bus. A write call will enable the bus again.
| void init_cardSPI | ( | void | ) |
Initialise the SPI driver.
Initialise the Card SPI driver.
| enum card_spi_return_code read_cardSPI | ( | uint8_t * | read_byte | ) |
Read from the card SPI.
If the SPI bus is busy then the read will fail. Otherwise the last received byte is returned.
| read_byte | Pointer to the location to store the received byte. |
| enum card_spi_return_code readBlocking_cardSPI | ( | uint8_t * | read_byte | ) |
Read from the card SPI blocking if it is busy.
Block until any outstanding transfer has completed and then return the byte receive over the SPI bus. The call is always successful, the function parameters and return type is kept in the same format as the non blocking function.
| read_byte | Pointer to the location to store the received byte. |
| void setupConsecutive_cardSPI | ( | uint32_t | num_bytes | ) |
Set up a transfer of a number of consecutive bytes.
The chip select will remain low (active) until the supplied number of bytes have been sent out.
| enum card_spi_return_code write_cardSPI | ( | uint8_t | byte | ) |
Write a byte out on the SPI bus (initiates a transfer).
Writes the supplied byte out on the SPI bus. The write initiates a transfer which once completed will mean the next received byte is available.
| byte | The byte value to be sent out. |
| enum card_spi_return_code writeBlocking_cardSPI | ( | uint8_t | byte | ) |
Write a byte out on the SPI bus (initiates a transfer) blocking until the write can be performed.
Block until any outstanding transfer has completed and then send the byte over the SPI bus. The call is always successful, the function parameters and return type is kept in the same format as the non blocking function.
| byte | The byte value to be sent |
1.4.7