Lines Matching refs:twim
110 Twim *const twim = cfg->regs; in i2c_clk_set() local
140 twim->HSCWGR = cwgr_reg_val; in i2c_clk_set()
142 twim->CWGR = cwgr_reg_val; in i2c_clk_set()
150 twim->SRR = ((speed == BUS_SPEED_PLUS_HZ) ? TWIM_SRR_FILTER(2) : in i2c_clk_set()
157 twim->HSSRR = TWIM_HSSRR_FILTER(1) | in i2c_clk_set()
288 Twim *const twim = cfg->regs; in i2c_start_xfer() local
294 twim->CR = TWIM_CR_MEN; in i2c_start_xfer()
295 twim->CR = TWIM_CR_SWRST; in i2c_start_xfer()
296 twim->CR = TWIM_CR_MDIS; in i2c_start_xfer()
297 twim->IDR = ~0UL; /* Clear the interrupt flags */ in i2c_start_xfer()
298 twim->SCR = ~0UL; /* Clear the status flags */ in i2c_start_xfer()
331 twim->CMDR = cmdr_reg | TWIM_CMDR_START; in i2c_start_xfer()
346 twim->NCMDR = cmdr_reg | TWIM_CMDR_START; in i2c_start_xfer()
353 twim->CMDR = cmdr_reg | TWIM_CMDR_START; in i2c_start_xfer()
360 twim->NCMDR = cmdr_reg; in i2c_start_xfer()
365 twim->CMDR, twim->NCMDR); in i2c_start_xfer()
368 cmdr_reg = twim->CMDR; in i2c_start_xfer()
372 twim->CR = TWIM_CR_MEN; in i2c_start_xfer()
374 twim->IER = TWIM_IER_STD_MASK | in i2c_start_xfer()
380 Twim *const twim) in i2c_prepare_next() argument
397 while ((twim->NCMDR & TWIM_NCMDR_VALID) && (ncmdr_wait--)) { in i2c_prepare_next()
401 cmdr_reg = twim->CMDR; in i2c_prepare_next()
403 twim->IER |= (cur_is_read ? TWIM_IER_RXRDY : TWIM_IER_TXRDY); in i2c_prepare_next()
412 twim->NCMDR = cmdr_reg; in i2c_prepare_next()
414 LOG_DBG("ld xfer: NCMDR: 0x%08x", twim->NCMDR); in i2c_prepare_next()
421 Twim *const twim = cfg->regs; in i2c_sam_twim_isr() local
426 isr_status = twim->SR & twim->IMR; in i2c_sam_twim_isr()
436 twim->NCMDR &= ~TWIM_NCMDR_VALID; in i2c_sam_twim_isr()
437 twim->CMDR &= ~TWIM_CMDR_VALID; in i2c_sam_twim_isr()
447 msg->buf[data->cur_idx++] = twim->RHR; in i2c_sam_twim_isr()
454 twim->IDR = TWIM_IDR_RXRDY; in i2c_sam_twim_isr()
458 i2c_prepare_next(data, twim); in i2c_sam_twim_isr()
468 twim->THR = msg->buf[data->cur_idx++]; in i2c_sam_twim_isr()
474 twim->IDR = TWIM_IDR_TXRDY; in i2c_sam_twim_isr()
478 i2c_prepare_next(data, twim); in i2c_sam_twim_isr()
493 twim->IDR = ~0UL; in i2c_sam_twim_isr()
496 twim->SCR = ~0UL; in i2c_sam_twim_isr()
539 Twim *const twim = cfg->regs; in i2c_sam_twim_initialize() local
567 twim->CR = TWIM_CR_MEN; in i2c_sam_twim_initialize()
570 twim->CR |= TWIM_CR_SWRST; in i2c_sam_twim_initialize()
573 twim->SCR = ~0UL; in i2c_sam_twim_initialize()