Contiki-NG
|
Files | |
file | mmc-arch.h |
Header file for the SD/MMC device driver architecture-specific definitions. | |
file | mmc-arch.c |
Implementation of the SD/MMC device driver RE-Mote-specific definitions. | |
Functions | |
void | mmc_arch_cd_changed_callback (uint8_t dev, bool cd) |
Callback of the SD/MMC driver to call when the card-detection signal changes. | |
bool | mmc_arch_get_cd (uint8_t dev) |
Gets the state of the card-detection signal. | |
bool | mmc_arch_get_wp (uint8_t dev) |
Gets the state of the write-protection signal. | |
void | mmc_arch_spi_select (uint8_t dev, bool sel) |
Sets the SPI /CS signal as indicated. | |
void | mmc_arch_spi_set_clock_freq (uint8_t dev, uint32_t freq) |
Sets the SPI clock frequency. | |
void | mmc_arch_spi_xfer (uint8_t dev, const void *tx_buf, size_t tx_cnt, void *rx_buf, size_t rx_cnt) |
Performs an SPI transfer. | |
SD/MMC device driver architecture-specific definitions.
void mmc_arch_cd_changed_callback | ( | uint8_t | dev, |
bool | cd ) |
Callback of the SD/MMC driver to call when the card-detection signal changes.
dev | Device |
cd | Whether a card is detected |
Definition at line 312 of file mmc.c.
References DISK_STATUS_DISK, DISK_STATUS_WRITABLE, mmc_arch_get_wp(), and MMC_CONF_DEV_COUNT.
bool mmc_arch_get_cd | ( | uint8_t | dev | ) |
Gets the state of the card-detection signal.
dev | Device |
Definition at line 73 of file mmc-arch.c.
References GPIO_CLR_PIN, GPIO_IS_OUTPUT, GPIO_READ_PIN, and GPIO_SET_OUTPUT.
bool mmc_arch_get_wp | ( | uint8_t | dev | ) |
Gets the state of the write-protection signal.
dev | Device |
Definition at line 92 of file mmc-arch.c.
Referenced by mmc_arch_cd_changed_callback().
void mmc_arch_spi_select | ( | uint8_t | dev, |
bool | sel ) |
Sets the SPI /CS signal as indicated.
dev | Device |
sel | Whether to assert /CS |
Definition at line 98 of file mmc-arch.c.
void mmc_arch_spi_set_clock_freq | ( | uint8_t | dev, |
uint32_t | freq ) |
Sets the SPI clock frequency.
dev | Device |
freq | Frequency (Hz) |
Definition at line 108 of file mmc-arch.c.
References spix_set_clock_freq().
void mmc_arch_spi_xfer | ( | uint8_t | dev, |
const void * | tx_buf, | ||
size_t | tx_cnt, | ||
void * | rx_buf, | ||
size_t | rx_cnt ) |
Performs an SPI transfer.
dev | Device |
tx_buf | Pointer to the transmission buffer, or NULL |
tx_cnt | Number of bytes to transmit, or 0 |
rx_buf | Pointer to the reception buffer, or NULL |
rx_cnt | Number of bytes to receive, or 0 |
Definition at line 114 of file mmc-arch.c.