nrfxlib API 3.3.99
Loading...
Searching...
No Matches
Soft eMMC

Soft eMMC driver. More...

Data Structures

struct  nrf_semmc_event_t
 
struct  nrf_semmc_config_t
 Configuration for initializing an eMMC driver instance. More...
 
struct  nrf_semmc_cmd_desc_t
 
struct  nrf_semmc_transfer_desc_t
 Descriptor for data transfer operations. More...
 
struct  nrf_semmc_t
 sEMMC driver instance structure. More...
 

Macros

#define NRF_SEMMC_FLAG_HOLD_XFER   (1UL << 0)
 Flag indicating that the transfer is prepared but not started.
 

Typedefs

typedef void(* nrf_semmc_event_handler_t) (nrf_semmc_event_t const *p_event, void *p_context)
 Callback function type for eMMC driver events.
 

Enumerations

enum  nrf_semmc_cmd_t {
  NRF_SEMMC_CMD0_GO_IDLE_STATE = 0 , NRF_SEMMC_CMD1_SEND_OP_COND = 1 , NRF_SEMMC_CMD2_ALL_SEND_CID = 2 , NRF_SEMMC_CMD3_SET_RELATIVE_ADDR = 3 ,
  NRF_SEMMC_CMD4_SET_DSR = 4 , NRF_SEMMC_CMD5_SLEEP_AWAKE = 5 , NRF_SEMMC_CMD6_SWITCH = 6 , NRF_SEMMC_CMD7_SELECT_DESELECT = 7 ,
  NRF_SEMMC_CMD8_SEND_EXT_CSD = 8 , NRF_SEMMC_CMD9_SEND_CSD = 9 , NRF_SEMMC_CMD10_SEND_CID = 10 , NRF_SEMMC_CMD12_STOP_TRANSMISSION = 12 ,
  NRF_SEMMC_CMD13_SEND_STATUS = 13 , NRF_SEMMC_CMD14_BUSTEST_R = 14 , NRF_SEMMC_CMD15_GO_INACTIVE_STATE = 15 , NRF_SEMMC_CMD16_SET_BLOCKLEN = 16 ,
  NRF_SEMMC_CMD17_READ_SINGLE = 17 , NRF_SEMMC_CMD18_READ_MULTIPLE = 18 , NRF_SEMMC_CMD19_BUSTEST_W = 19 , NRF_SEMMC_CMD21_SEND_TUNING_BLOCK = 21 ,
  NRF_SEMMC_CMD23_SET_BLOCK_COUNT = 23 , NRF_SEMMC_CMD24_WRITE_BLOCK = 24 , NRF_SEMMC_CMD25_WRITE_MULTIPLE = 25 , NRF_SEMMC_CMD26_PROGRAM_CID = 26 ,
  NRF_SEMMC_CMD27_PROGRAM_CSD = 27 , NRF_SEMMC_CMD28_SET_WRITE_PROT = 28 , NRF_SEMMC_CMD29_CLR_WRITE_PROT = 29 , NRF_SEMMC_CMD30_SEND_WRITE_PROT = 30 ,
  NRF_SEMMC_CMD31_SEND_WRITE_PROT_TYPE = 31 , NRF_SEMMC_CMD35_ERASE_GROUP_START = 35 , NRF_SEMMC_CMD36_ERASE_GROUP_END = 36 , NRF_SEMMC_CMD38_ERASE = 38 ,
  NRF_SEMMC_CMD42_LOCK_UNLOCK = 42 , NRF_SEMMC_CMD44_QUEUED_TASK_PARAMS = 44 , NRF_SEMMC_CMD45_QUEUED_TASK_ADDRESS = 45 , NRF_SEMMC_CMD46_EXECUTE_READ_TASK = 46 ,
  NRF_SEMMC_CMD47_EXECUTE_WRITE_TASK = 47 , NRF_SEMMC_CMD48_CMDQ_TASK_MGMT = 48 , NRF_SEMMC_CMD49_SET_TIME = 49
}
 eMMC command index definitions More...
 
enum  nrf_semmc_resp_type_t {
  NRF_SEMMC_RESP_NONE , NRF_SEMMC_RESP_R1 , NRF_SEMMC_RESP_R1B , NRF_SEMMC_RESP_R2 ,
  NRF_SEMMC_RESP_R3 , NRF_SEMMC_RESP_R4 , NRF_SEMMC_RESP_R5
}
 
enum  nrf_semmc_error_t {
  NRF_SEMMC_SUCCESS = 0 , NRF_SEMMC_ERROR_TIMEOUT , NRF_SEMMC_ERROR_CMDTIMEOUT , NRF_SEMMC_ERROR_CMDCRCERROR ,
  NRF_SEMMC_ERROR_DATACRCERROR , NRF_SEMMC_ERROR_ILLEGAL_CMD , NRF_SEMMC_ERROR_DEVICE_REJECTED , NRF_SEMMC_ERROR_INTERNAL_OR_PROTOCOL ,
  NRF_SEMMC_ERROR_BUSY , NRF_SEMMC_ERROR_UNSUPPORTED , NRF_SEMMC_ERROR_INVALID_PARAM , NRF_SEMMC_ERROR_INVALID_STATE ,
  NRF_SEMMC_ERROR_HW_FAULT
}
 
enum  nrf_semmc_bus_width_t { NRF_SEMMC_BUS_WIDTH_1 = 1 , NRF_SEMMC_BUS_WIDTH_4 = 4 , NRF_SEMMC_BUS_WIDTH_8 = 8 }
 
enum  nrf_semmc_event_type_t { NRF_SEMMC_EVT_XFER_DONE , NRF_SEMMC_EVT_XFER_STARTED }
 
enum  nrf_semmc_event_xfer_done_t { NRF_SEMMC_RESULT_OK , NRF_SEMMC_RESULT_ABORTED }
 

Functions

nrf_semmc_error_t nrf_semmc_init (nrf_semmc_t const *p_semmc, nrf_semmc_event_handler_t handler, void *p_context)
 Initialize the eMMC controller driver for a given instance.
 
void nrf_semmc_uninit (nrf_semmc_t const *p_semmc)
 Uninitialize the sEMMC driver instance.
 
nrf_semmc_error_t nrf_semmc_enable (nrf_semmc_t const *p_semmc)
 Explicitly power up and configure the controller.
 
nrf_semmc_error_t nrf_semmc_disable (nrf_semmc_t const *p_semmc)
 Explicitly power down the controller.
 
nrf_semmc_error_t nrf_semmc_cmd (nrf_semmc_t const *p_semmc, nrf_semmc_cmd_desc_t *p_cmd, nrf_semmc_config_t const *p_config, nrf_semmc_transfer_desc_t *p_transfer, size_t cmd_count, uint32_t flags)
 Start an asynchronous command.
 
nrf_semmc_error_t nrf_semmc_cmd_prepare (nrf_semmc_t const *p_semmc, nrf_semmc_cmd_desc_t *p_cmd, nrf_semmc_config_t const *p_config, nrf_semmc_transfer_desc_t *p_transfer, size_t cmd_count)
 prepare to start an asynchronous command.
 
uint32_t * nrf_semmc_start_task_address_get (nrf_semmc_t const *p_semmc)
 Get an address of the task register to start the prepared transfer.
 
nrf_semmc_error_t nrf_semmc_abort (nrf_semmc_t const *p_semmc)
 Abort any ongoing eMMC operation.
 
bool nrf_semmc_is_busy (nrf_semmc_t const *p_semmc)
 Returns true if an operation is still in progress.
 
void nrf_semmc_irq_handler (void)
 IRQ handler to be called from the eMMC interrupt vector.
 

Detailed Description

Soft eMMC driver.

This API describes the driver operation of a Software eMMC emulated in a VPR CPU. Based on JEDEC Standard No. 84-B51A.

The functions in this driver are not reentrant if they operate on the same eMMC peripheral. It is the responsibility of the API user to ensure the functions are not preempted by each other. An exception is the callback function context. Multiple functions from this API can be called from the callback.

Note
The nrf_semmc_irq_handler() function must be called from an external IRQ handler that has been properly registered with the interrupt controller system.
The GPIO pins required for eMMC operation must be properly configured by the user before initializing the driver with nrf_semmc_init().