ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
board_sd_state_t Struct Reference

The modelled card: backing image + command/response framing. More...

#include <board_periph_sd_internal.h>

Data Fields

int image_fd
 Owned anonymous sparse backing descriptor.
uint64_t image_len
 Image size in bytes (64-bit: cards > 4 GB).
bool attached
 A --sd image is loaded.
uint8_t fat_bits
 12/16/32 if formatted by –sd-new, else 0.
char label [k_sd_label_cap]
 Volume label (11 + NUL), for GUI.
bool collecting
 Mid command-frame collection.
bool app_cmd
 Previous command was CMD55 (APP_CMD).
bool ready
 ACMD41 has completed.
uint8_t cmd [k_sd_cmd_len]
 Cmd.
uint32_t cmd_idx
 Cmd index.
uint8_t resp [k_sd_resp_cap]
 Resp.
uint32_t resp_len
 Resp length.
uint32_t resp_pos
 Resp pos.
board_sd_wr_phase_t wr_phase
 CMD24/CMD25 write sub-state.
bool wr_multi
 Write is CMD25 (multi-block).
uint64_t wr_off
 Byte offset of the current block.
uint32_t wr_cnt
 Bytes seen in the data/CRC phase.
uint8_t wr_block [k_sd_block]
 Bounded block-write staging buffer.
bool rd_multi
 An open CMD18 read stream.
uint64_t rd_off
 Byte offset of the next streamed CMD18 block.
uint32_t erase_start
 CMD32 ERASE_WR_BLK_START block.
uint32_t erase_end
 CMD33 ERASE_WR_BLK_END block.

Detailed Description

The modelled card: backing image + command/response framing.

Definition at line 86 of file board_periph_sd_internal.h.

Field Documentation

◆ app_cmd

bool board_sd_state_t::app_cmd

Previous command was CMD55 (APP_CMD).

Definition at line 93 of file board_periph_sd_internal.h.

Referenced by internal_board_sd_dispatch_ident(), and internal_board_sd_process_cmd().

◆ attached

bool board_sd_state_t::attached

A --sd image is loaded.

Definition at line 89 of file board_periph_sd_internal.h.

◆ cmd

uint8_t board_sd_state_t::cmd[k_sd_cmd_len]

Cmd.

Definition at line 95 of file board_periph_sd_internal.h.

Referenced by internal_board_sd_process_cmd().

◆ cmd_idx

uint32_t board_sd_state_t::cmd_idx

Cmd index.

Definition at line 96 of file board_periph_sd_internal.h.

◆ collecting

bool board_sd_state_t::collecting

Mid command-frame collection.

Definition at line 92 of file board_periph_sd_internal.h.

◆ erase_end

uint32_t board_sd_state_t::erase_end

CMD33 ERASE_WR_BLK_END block.

Definition at line 109 of file board_periph_sd_internal.h.

Referenced by internal_board_sd_cmd_erase(), and internal_board_sd_dispatch_data().

◆ erase_start

uint32_t board_sd_state_t::erase_start

CMD32 ERASE_WR_BLK_START block.

Definition at line 108 of file board_periph_sd_internal.h.

Referenced by internal_board_sd_cmd_erase(), and internal_board_sd_dispatch_data().

◆ fat_bits

uint8_t board_sd_state_t::fat_bits

12/16/32 if formatted by –sd-new, else 0.

Definition at line 90 of file board_periph_sd_internal.h.

◆ image_fd

int board_sd_state_t::image_fd

Owned anonymous sparse backing descriptor.

Definition at line 87 of file board_periph_sd_internal.h.

◆ image_len

uint64_t board_sd_state_t::image_len

Image size in bytes (64-bit: cards > 4 GB).

Definition at line 88 of file board_periph_sd_internal.h.

Referenced by internal_board_sd_cmd_erase(), internal_board_sd_cmd_send_csd(), and internal_board_sd_fill_block().

◆ label

char board_sd_state_t::label[k_sd_label_cap]

Volume label (11 + NUL), for GUI.

Definition at line 91 of file board_periph_sd_internal.h.

◆ rd_multi

bool board_sd_state_t::rd_multi

◆ rd_off

uint64_t board_sd_state_t::rd_off

Byte offset of the next streamed CMD18 block.

Definition at line 106 of file board_periph_sd_internal.h.

Referenced by internal_board_sd_begin_read(), and internal_board_sd_read_stream_next().

◆ ready

bool board_sd_state_t::ready

ACMD41 has completed.

Definition at line 94 of file board_periph_sd_internal.h.

Referenced by internal_board_sd_process_cmd().

◆ resp

◆ resp_len

◆ resp_pos

uint32_t board_sd_state_t::resp_pos

◆ wr_block

uint8_t board_sd_state_t::wr_block[k_sd_block]

Bounded block-write staging buffer.

Definition at line 104 of file board_periph_sd_internal.h.

Referenced by internal_sd_write_crc(), and internal_sd_write_data().

◆ wr_cnt

uint32_t board_sd_state_t::wr_cnt

Bytes seen in the data/CRC phase.

Definition at line 103 of file board_periph_sd_internal.h.

Referenced by internal_board_sd_begin_write(), internal_sd_write_crc(), internal_sd_write_data(), and internal_sd_write_token().

◆ wr_multi

bool board_sd_state_t::wr_multi

Write is CMD25 (multi-block).

Definition at line 101 of file board_periph_sd_internal.h.

Referenced by internal_board_sd_begin_write(), internal_sd_write_crc(), and internal_sd_write_token().

◆ wr_off

uint64_t board_sd_state_t::wr_off

Byte offset of the current block.

Definition at line 102 of file board_periph_sd_internal.h.

Referenced by internal_board_sd_begin_write(), and internal_sd_write_crc().

◆ wr_phase


The documentation for this struct was generated from the following file: