Skip to content

Commit ea8dd95

Browse files
committed
Update common-hal routines with new params
1 parent 08ac95a commit ea8dd95

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

ports/broadcom/common-hal/busio/UART.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ void pl011_IRQHandler(uint8_t index) {
124124
// Clear the interrupt in case we weren't able to clear it by emptying the
125125
// FIFO. (This won't clear the FIFO.)
126126
ARM_UART_PL011_Type *pl011 = uart[index];
127-
pl011->ICR = UART0_ICR_RXIC_Msk;
127+
pl011->ICR = ARM_UART_PL011_ICR_RXIC_Msk;
128128
}
129129

130130
void UART0_IRQHandler(void) {
@@ -258,31 +258,31 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self,
258258

259259
common_hal_busio_uart_set_baudrate(self, baudrate);
260260

261-
uint32_t line_control = UART0_LCR_H_FEN_Msk;
262-
line_control |= (bits - 5) << UART0_LCR_H_WLEN_Pos;
261+
uint32_t line_control = ARM_UART_PL011_LCR_H_FEN_Msk;
262+
line_control |= (bits - 5) << ARM_UART_PL011_LCR_H_WLEN_Pos;
263263
if (stop == 2) {
264-
line_control |= UART0_LCR_H_STP2_Msk;
264+
line_control |= ARM_UART_PL011_LCR_H_STP2_Msk;
265265
}
266266
if (parity != BUSIO_UART_PARITY_NONE) {
267-
line_control |= UART0_LCR_H_PEN_Msk;
267+
line_control |= ARM_UART_PL011_LCR_H_PEN_Msk;
268268
}
269269
if (parity == BUSIO_UART_PARITY_EVEN) {
270-
line_control |= UART0_LCR_H_EPS_Msk;
270+
line_control |= ARM_UART_PL011_LCR_H_EPS_Msk;
271271
}
272272
pl011->LCR_H = line_control;
273273

274-
uint32_t control = UART0_CR_UARTEN_Msk;
274+
uint32_t control = ARM_UART_PL011_CR_UARTEN_Msk;
275275
if (tx != NULL) {
276-
control |= UART0_CR_TXE_Msk;
276+
control |= ARM_UART_PL011_CR_TXE_Msk;
277277
}
278278
if (rx != NULL) {
279-
control |= UART0_CR_RXE_Msk;
279+
control |= ARM_UART_PL011_CR_RXE_Msk;
280280
}
281281
if (cts != NULL) {
282-
control |= UART0_CR_CTSEN_Msk;
282+
control |= ARM_UART_PL011_CR_CTSEN_Msk;
283283
}
284284
if (rts != NULL) {
285-
control |= UART0_CR_RTSEN_Msk;
285+
control |= ARM_UART_PL011_CR_RTSEN_Msk;
286286
}
287287
pl011->CR = control;
288288
}

ports/broadcom/common-hal/sdioio/SDCard.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)