@@ -122,27 +122,27 @@ STATIC sdmmc_err_t _do_transaction(int slot, sdmmc_command_t *cmdinfo) {
122
122
if (EMMC -> STATUS_b .DAT_INHIBIT ) {
123
123
return SDMMC_ERR_BUSY ;
124
124
}
125
- cmd_flags = EMMC_CMDTM_TM_BLKCNT_EN_Msk | EMMC_CMDTM_CMD_ISDATA_Msk ;
125
+ cmd_flags = Arasan_EMMC_Distributor_CMDTM_TM_BLKCNT_EN_Msk | Arasan_EMMC_Distributor_CMDTM_CMD_ISDATA_Msk ;
126
126
if (cmdinfo -> datalen > cmdinfo -> blklen ) {
127
- cmd_flags |= EMMC_CMDTM_TM_MULTI_BLOCK_Msk ;
127
+ cmd_flags |= Arasan_EMMC_Distributor_CMDTM_TM_MULTI_BLOCK_Msk ;
128
128
if ((cmdinfo -> flags & SCF_AUTO_STOP ) != 0 ) {
129
- cmd_flags |= 1 << EMMC_CMDTM_TM_AUTO_CMD_EN_Pos ;
129
+ cmd_flags |= 1 << Arasan_EMMC_Distributor_CMDTM_TM_AUTO_CMD_EN_Pos ;
130
130
}
131
131
}
132
132
if (read ) {
133
- cmd_flags |= EMMC_CMDTM_TM_DAT_DIR_Msk ;
133
+ cmd_flags |= Arasan_EMMC_Distributor_CMDTM_TM_DAT_DIR_Msk ;
134
134
}
135
- EMMC -> BLKSIZECNT = (cmdinfo -> datalen / cmdinfo -> blklen ) << EMMC_BLKSIZECNT_BLKCNT_Pos |
136
- cmdinfo -> blklen << EMMC_BLKSIZECNT_BLKSIZE_Pos ;
135
+ EMMC -> BLKSIZECNT = (cmdinfo -> datalen / cmdinfo -> blklen ) << Arasan_EMMC_Distributor_BLKSIZECNT_BLKCNT_Pos |
136
+ cmdinfo -> blklen << Arasan_EMMC_Distributor_BLKSIZECNT_BLKSIZE_Pos ;
137
137
}
138
138
139
139
uint32_t response_type = EMMC_CMDTM_CMD_RSPNS_TYPE_RESPONSE_48BITS ;
140
140
uint32_t crc = 0 ;
141
141
if ((cmdinfo -> flags & SCF_RSP_CRC ) != 0 ) {
142
- crc |= EMMC_CMDTM_CMD_CRCCHK_EN_Msk ;
142
+ crc |= Arasan_EMMC_Distributor_CMDTM_CMD_CRCCHK_EN_Msk ;
143
143
}
144
144
if ((cmdinfo -> flags & SCF_RSP_IDX ) != 0 ) {
145
- crc |= EMMC_CMDTM_CMD_IXCHK_EN_Msk ;
145
+ crc |= Arasan_EMMC_Distributor_CMDTM_CMD_IXCHK_EN_Msk ;
146
146
}
147
147
if ((cmdinfo -> flags & SCF_RSP_136 ) != 0 ) {
148
148
response_type = EMMC_CMDTM_CMD_RSPNS_TYPE_RESPONSE_136BITS ;
@@ -152,8 +152,8 @@ STATIC sdmmc_err_t _do_transaction(int slot, sdmmc_command_t *cmdinfo) {
152
152
response_type = EMMC_CMDTM_CMD_RSPNS_TYPE_RESPONSE_NONE ;
153
153
}
154
154
uint32_t full_cmd = cmd_flags | crc |
155
- cmdinfo -> opcode << EMMC_CMDTM_CMD_INDEX_Pos |
156
- response_type << EMMC_CMDTM_CMD_RSPNS_TYPE_Pos ;
155
+ cmdinfo -> opcode << Arasan_EMMC_Distributor_CMDTM_CMD_INDEX_Pos |
156
+ response_type << Arasan_EMMC_Distributor_CMDTM_CMD_RSPNS_TYPE_Pos ;
157
157
EMMC -> CMDTM = full_cmd ;
158
158
159
159
// Wait for an interrupt to indicate completion of the command.
@@ -170,7 +170,7 @@ STATIC sdmmc_err_t _do_transaction(int slot, sdmmc_command_t *cmdinfo) {
170
170
}
171
171
return SDMMC_ERR_TIMEOUT ;
172
172
} else {
173
- EMMC -> INTERRUPT = EMMC_INTERRUPT_CMD_DONE_Msk ;
173
+ EMMC -> INTERRUPT = Arasan_EMMC_Distributor_INTERRUPT_CMD_DONE_Msk ;
174
174
}
175
175
176
176
// Transfer the data.
@@ -197,7 +197,7 @@ STATIC sdmmc_err_t _do_transaction(int slot, sdmmc_command_t *cmdinfo) {
197
197
EMMC -> DATA = ((uint32_t * )cmdinfo -> data )[i ];
198
198
}
199
199
}
200
- uint32_t data_done_mask = EMMC_INTERRUPT_ERR_Msk | EMMC_INTERRUPT_DATA_DONE_Msk ;
200
+ uint32_t data_done_mask = Arasan_EMMC_Distributor_INTERRUPT_ERR_Msk | Arasan_EMMC_Distributor_INTERRUPT_DATA_DONE_Msk ;
201
201
start_ticks = port_get_raw_ticks (NULL );
202
202
while ((EMMC -> INTERRUPT & data_done_mask ) == 0 && (port_get_raw_ticks (NULL ) - start_ticks ) < (size_t )cmdinfo -> timeout_ms ) {
203
203
}
@@ -282,7 +282,7 @@ void common_hal_sdioio_sdcard_construct(sdioio_sdcard_obj_t *self,
282
282
283
283
}
284
284
// Set max timeout
285
- EMMC -> CONTROL1 |= EMMC_CONTROL1_CLK_INTLEN_Msk | (0xe << EMMC_CONTROL1_DATA_TOUNIT_Pos );
285
+ EMMC -> CONTROL1 |= Arasan_EMMC_Distributor_CONTROL1_CLK_INTLEN_Msk | (0xe << Arasan_EMMC_Distributor_CONTROL1_DATA_TOUNIT_Pos );
286
286
287
287
EMMC -> IRPT_MASK = 0xffffffff ;
288
288
0 commit comments