@@ -122,27 +122,27 @@ STATIC sdmmc_err_t _do_transaction(int slot, sdmmc_command_t *cmdinfo) {
122122 if (EMMC -> STATUS_b .DAT_INHIBIT ) {
123123 return SDMMC_ERR_BUSY ;
124124 }
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 ;
126126 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 ;
128128 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 ;
130130 }
131131 }
132132 if (read ) {
133- cmd_flags |= EMMC_CMDTM_TM_DAT_DIR_Msk ;
133+ cmd_flags |= Arasan_EMMC_Distributor_CMDTM_TM_DAT_DIR_Msk ;
134134 }
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 ;
137137 }
138138
139139 uint32_t response_type = EMMC_CMDTM_CMD_RSPNS_TYPE_RESPONSE_48BITS ;
140140 uint32_t crc = 0 ;
141141 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 ;
143143 }
144144 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 ;
146146 }
147147 if ((cmdinfo -> flags & SCF_RSP_136 ) != 0 ) {
148148 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) {
152152 response_type = EMMC_CMDTM_CMD_RSPNS_TYPE_RESPONSE_NONE ;
153153 }
154154 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 ;
157157 EMMC -> CMDTM = full_cmd ;
158158
159159 // 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) {
170170 }
171171 return SDMMC_ERR_TIMEOUT ;
172172 } else {
173- EMMC -> INTERRUPT = EMMC_INTERRUPT_CMD_DONE_Msk ;
173+ EMMC -> INTERRUPT = Arasan_EMMC_Distributor_INTERRUPT_CMD_DONE_Msk ;
174174 }
175175
176176 // Transfer the data.
@@ -197,7 +197,7 @@ STATIC sdmmc_err_t _do_transaction(int slot, sdmmc_command_t *cmdinfo) {
197197 EMMC -> DATA = ((uint32_t * )cmdinfo -> data )[i ];
198198 }
199199 }
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 ;
201201 start_ticks = port_get_raw_ticks (NULL );
202202 while ((EMMC -> INTERRUPT & data_done_mask ) == 0 && (port_get_raw_ticks (NULL ) - start_ticks ) < (size_t )cmdinfo -> timeout_ms ) {
203203 }
@@ -282,7 +282,7 @@ void common_hal_sdioio_sdcard_construct(sdioio_sdcard_obj_t *self,
282282
283283 }
284284 // 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 );
286286
287287 EMMC -> IRPT_MASK = 0xffffffff ;
288288
0 commit comments