2.21. sdio
— Secure Digital Input Output¶
Source code: src/drivers/sdio.h, src/drivers/sdio.c
Defines
-
SDIO_IO_RW_EXTENDED_BLOCK_MODE_BYTE
¶
-
SDIO_IO_RW_EXTENDED_BLOCK_MODE_BLOCK
¶
-
SDIO_IO_RW_EXTENDED_OP_CODE_FIXED_ADDRESS
¶
-
SDIO_IO_RW_EXTENDED_OP_CODE_INCREMENTING_ADDRESS
¶
Functions
-
int
sdio_module_init
(void)¶ Initialize the SDIO module. This function must be called before calling any other function in this module.
The module will only be initialized once even if this function is called multiple times.
- Return
- zero(0) or negative error code.
-
int
sdio_init
(struct sdio_driver_t *self_p, struct sdio_device_t *dev_p)¶ Initialize driver object from given configuration.
- Return
- zero(0) or negative error code.
- Parameters
self_p
: Driver object to be initialized.dev_p
: Device to use.
-
int
sdio_start
(struct sdio_driver_t *self_p)¶ Starts the SDIO device using given driver object.
- Return
- zero(0) or negative error code.
- Parameters
self_p
: Initialized driver object.
-
int
sdio_stop
(struct sdio_driver_t *self_p)¶ Stops the SDIO device referenced by driver object.
- Return
- zero(0) or negative error code.
- Parameters
self_p
: Initialized driver object.
-
int
sdio_send_relative_addr
(struct sdio_driver_t *self_p)¶ Send the
send relative address
command (CMD3) to the device and optionally wait for the response.- Return
- zero(0) or negative error code.
- Parameters
self_p
: Initialized driver object.
-
int
sdio_io_send_op_cond
(struct sdio_driver_t *self_p)¶ Send the
io send operation condition
command (CMD5) to the device and optionally wait for the response.- Return
- zero(0) or negative error code.
- Parameters
self_p
: Initialized driver object.
-
int
sdio_select_deselect_card
(struct sdio_driver_t *self_p)¶ Send the
select/deselect card
command (CMD7) to the device and optionally wait for the response.- Return
- zero(0) or negative error code.
- Parameters
self_p
: Initialized driver object.
-
int
sdio_io_read_direct
(struct sdio_driver_t *self_p, void *dst_p)¶ Execute the
input output read write direct
command (CMD52) as a read operation with given parameters.- Return
- Number of bytes read or negative error code.
- Parameters
self_p
: Initialized driver object.dst_p
: Destination buffer.
-
int
sdio_io_write_direct
(struct sdio_driver_t *self_p, const void *src_p)¶ Execute the
input output read write direct
command (CMD52) as a write operation with given parameters.- Return
- Number of bytes written or negative error code.
- Parameters
self_p
: Initialized driver object.src_p
: Source buffer.
-
ssize_t
sdio_io_read_extended
(struct sdio_driver_t *self_p, int function_number, int block_mode, int op_code, void *dst_p, uint32_t src_address, size_t size)¶ Execute the
input output read write extended
command (CMD53) as a read operation with given parameters.- Return
- Number of bytes read or negative error code.
- Parameters
self_p
: Initialized driver object.function_number
: Function number.block_mode
: Block or byte mode.op_code
: Operation code.dst_p
: Destination buffer.src_address
: Source address.size
: Number of bytes to read.
-
ssize_t
sdio_io_write_extended
(struct sdio_driver_t *self_p, int function_number, int block_mode, int op_code, uint32_t dst_address, const void *src_p, size_t size)¶ Execute the
input output read write extended
command (CMD53) as a write operation with given parameters.- Return
- Number of bytes written or negative error code.
- Parameters
self_p
: Initialized driver object.function_number
: Function number.block_mode
: Block or byte mode.op_code
: Operation code.dst_address
: Destination address.src_p
: Source buffer.size
: Number of bytes to write.
Variables
-
struct sdio_device_t
sdio_device
[SDIO_DEVICE_MAX]¶
- struct
Public Members
-
uint8_t
sdio_io_rw_extended_t::
rw_flag
¶
-
uint8_t
sdio_io_rw_extended_t::
function_number
¶
-
uint8_t
sdio_io_rw_extended_t::
block_mode
¶
-
uint8_t
sdio_io_rw_extended_t::
op_code
¶
-
uint8_t
sdio_io_rw_extended_t::
register_address_16_15
¶
-
uint8_t
sdio_io_rw_extended_t::
register_address_14_7
¶
-
uint8_t
sdio_io_rw_extended_t::
register_address_6_0
¶
-
uint8_t
sdio_io_rw_extended_t::
byte_block_count_8
¶
-
uint8_t
sdio_io_rw_extended_t::
byte_block_count_7_0
¶
-
uint8_t