Lines Matching refs:master_xfer

83 	} master_xfer;  member
101 __ASSERT_NO_MSG(data->master_xfer.msgs_pos < data->master_xfer.msgs_end); in m_numaker_i2c_master_xfer_msg_read_last_byte()
103 __ASSERT_NO_MSG((data->master_xfer.msgs_pos->flags & I2C_MSG_RW_MASK) == I2C_MSG_READ); in m_numaker_i2c_master_xfer_msg_read_last_byte()
104 __ASSERT_NO_MSG((data->master_xfer.buf_end - data->master_xfer.buf_pos) == 1); in m_numaker_i2c_master_xfer_msg_read_last_byte()
107 bool do_stop_prev = data->master_xfer.msgs_pos->flags & I2C_MSG_STOP; in m_numaker_i2c_master_xfer_msg_read_last_byte()
110 data->master_xfer.msgs_pos++; in m_numaker_i2c_master_xfer_msg_read_last_byte()
113 if (data->master_xfer.msgs_pos < data->master_xfer.msgs_end) { in m_numaker_i2c_master_xfer_msg_read_last_byte()
115 struct i2c_msg *msgs_pos = data->master_xfer.msgs_pos; in m_numaker_i2c_master_xfer_msg_read_last_byte()
117 bool do_restart_next = data->master_xfer.msgs_pos->flags & I2C_MSG_RESTART; in m_numaker_i2c_master_xfer_msg_read_last_byte()
142 data->master_xfer.msgs_pos--; in m_numaker_i2c_master_xfer_msg_read_last_byte()
158 k_sem_give(&data->master_xfer.xfer_sync); in m_numaker_i2c_master_xfer_end()
169 switch (data->master_xfer.buf_end - data->master_xfer.buf_pos) { in m_numaker_i2c_master_xfer_msg_read_next_byte()
192 __ASSERT_NO_MSG(data->master_xfer.msgs_pos < data->master_xfer.msgs_end); in m_numaker_i2c_master_xfer_msg_end()
194 __ASSERT_NO_MSG((data->master_xfer.buf_end - data->master_xfer.buf_pos) == 0); in m_numaker_i2c_master_xfer_msg_end()
197 bool is_read_prev = (data->master_xfer.msgs_pos->flags & I2C_MSG_RW_MASK) == I2C_MSG_READ; in m_numaker_i2c_master_xfer_msg_end()
198 bool do_stop_prev = data->master_xfer.msgs_pos->flags & I2C_MSG_STOP; in m_numaker_i2c_master_xfer_msg_end()
201 data->master_xfer.msgs_pos++; in m_numaker_i2c_master_xfer_msg_end()
204 if (data->master_xfer.msgs_pos < data->master_xfer.msgs_end) { in m_numaker_i2c_master_xfer_msg_end()
206 struct i2c_msg *msgs_pos = data->master_xfer.msgs_pos; in m_numaker_i2c_master_xfer_msg_end()
208 bool do_restart_next = data->master_xfer.msgs_pos->flags & I2C_MSG_RESTART; in m_numaker_i2c_master_xfer_msg_end()
232 data->master_xfer.buf_beg = data->master_xfer.msgs_pos->buf; in m_numaker_i2c_master_xfer_msg_end()
233 data->master_xfer.buf_pos = data->master_xfer.msgs_pos->buf; in m_numaker_i2c_master_xfer_msg_end()
234 data->master_xfer.buf_end = data->master_xfer.msgs_pos->buf + in m_numaker_i2c_master_xfer_msg_end()
235 data->master_xfer.msgs_pos->len; in m_numaker_i2c_master_xfer_msg_end()
355 data->master_xfer.addr = addr; in i2c_numaker_transfer()
356 data->master_xfer.msgs_beg = msgs; in i2c_numaker_transfer()
357 data->master_xfer.msgs_pos = msgs; in i2c_numaker_transfer()
358 data->master_xfer.msgs_end = msgs + num_msgs; in i2c_numaker_transfer()
364 k_sem_take(&data->master_xfer.xfer_sync, K_FOREVER); in i2c_numaker_transfer()
368 if (data->master_xfer.msgs_pos != data->master_xfer.msgs_end) { in i2c_numaker_transfer()
372 is_read = (data->master_xfer.msgs_pos->flags & I2C_MSG_RW_MASK) == I2C_MSG_READ; in i2c_numaker_transfer()
373 is_10bit = data->master_xfer.msgs_pos->flags & I2C_MSG_ADDR_10_BITS; in i2c_numaker_transfer()
375 LOG_ERR("MSG IDX: %d", data->master_xfer.msgs_pos - data->master_xfer.msgs_beg); in i2c_numaker_transfer()
379 data->master_xfer.msgs_pos->len, in i2c_numaker_transfer()
380 data->master_xfer.buf_pos - data->master_xfer.buf_beg); in i2c_numaker_transfer()
538 data->master_xfer.buf_beg = data->master_xfer.msgs_pos->buf; in i2c_numaker_isr()
539 data->master_xfer.buf_pos = data->master_xfer.msgs_pos->buf; in i2c_numaker_isr()
540 data->master_xfer.buf_end = data->master_xfer.msgs_pos->buf + in i2c_numaker_isr()
541 data->master_xfer.msgs_pos->len; in i2c_numaker_isr()
544 struct i2c_msg *msgs_pos = data->master_xfer.msgs_pos; in i2c_numaker_isr()
546 uint16_t addr = data->master_xfer.addr; in i2c_numaker_isr()
554 __ASSERT_NO_MSG(data->master_xfer.buf_pos); in i2c_numaker_isr()
555 if (data->master_xfer.buf_pos < data->master_xfer.buf_end) { in i2c_numaker_isr()
556 I2C_SET_DATA(i2c_base, *data->master_xfer.buf_pos++); in i2c_numaker_isr()
571 __ASSERT_NO_MSG(data->master_xfer.buf_pos); in i2c_numaker_isr()
574 __ASSERT_NO_MSG(data->master_xfer.buf_pos < data->master_xfer.buf_end); in i2c_numaker_isr()
576 __ASSERT_NO_MSG((data->master_xfer.buf_end - in i2c_numaker_isr()
577 data->master_xfer.buf_pos) >= 1); in i2c_numaker_isr()
578 *data->master_xfer.buf_pos++ = I2C_GET_DATA(i2c_base); in i2c_numaker_isr()
584 __ASSERT_NO_MSG((data->master_xfer.buf_end - data->master_xfer.buf_pos) == 1); in i2c_numaker_isr()
585 *data->master_xfer.buf_pos++ = I2C_GET_DATA(i2c_base); in i2c_numaker_isr()
690 k_sem_init(&data->master_xfer.xfer_sync, 0, 1); in i2c_numaker_init()