Lines Matching refs:dev
135 enum mhu_v2_x_error_t mhu_v2_x_driver_init(struct mhu_v2_x_dev_t *dev, in mhu_v2_x_driver_init() argument
141 assert(dev != NULL); in mhu_v2_x_driver_init()
143 p_mhu = (union mhu_v2_x_frame *)dev->base; in mhu_v2_x_driver_init()
145 if (dev->is_initialized) { in mhu_v2_x_driver_init()
151 if (dev->frame == MHU_V2_X_RECEIVER_FRAME) { in mhu_v2_x_driver_init()
164 dev->subversion = AIDR & 0b1111; in mhu_v2_x_driver_init()
166 if (dev->subversion != MHU_MINOR_REV_2_0 && in mhu_v2_x_driver_init()
167 dev->subversion != MHU_MINOR_REV_2_1) { in mhu_v2_x_driver_init()
174 dev->subversion = MHU_MINOR_REV_2_0; in mhu_v2_x_driver_init()
176 dev->subversion = MHU_MINOR_REV_2_1; in mhu_v2_x_driver_init()
183 dev->is_initialized = true; in mhu_v2_x_driver_init()
188 uint32_t mhu_v2_x_get_num_channel_implemented(const struct mhu_v2_x_dev_t *dev) in mhu_v2_x_get_num_channel_implemented() argument
192 assert(dev != NULL); in mhu_v2_x_get_num_channel_implemented()
194 p_mhu = (union mhu_v2_x_frame *)dev->base; in mhu_v2_x_get_num_channel_implemented()
196 if (!(dev->is_initialized)) { in mhu_v2_x_get_num_channel_implemented()
200 if (dev->frame == MHU_V2_X_SENDER_FRAME) { in mhu_v2_x_get_num_channel_implemented()
203 assert(dev->frame == MHU_V2_X_RECEIVER_FRAME); in mhu_v2_x_get_num_channel_implemented()
208 enum mhu_v2_x_error_t mhu_v2_x_channel_send(const struct mhu_v2_x_dev_t *dev, in mhu_v2_x_channel_send() argument
213 assert(dev != NULL); in mhu_v2_x_channel_send()
215 p_mhu = (union mhu_v2_x_frame *)dev->base; in mhu_v2_x_channel_send()
217 if (!(dev->is_initialized)) { in mhu_v2_x_channel_send()
221 if (dev->frame == MHU_V2_X_SENDER_FRAME) { in mhu_v2_x_channel_send()
229 enum mhu_v2_x_error_t mhu_v2_x_channel_poll(const struct mhu_v2_x_dev_t *dev, in mhu_v2_x_channel_poll() argument
234 assert(dev != NULL); in mhu_v2_x_channel_poll()
236 p_mhu = (union mhu_v2_x_frame *)dev->base; in mhu_v2_x_channel_poll()
238 if (!(dev->is_initialized)) { in mhu_v2_x_channel_poll()
242 if (dev->frame == MHU_V2_X_SENDER_FRAME) { in mhu_v2_x_channel_poll()
250 enum mhu_v2_x_error_t mhu_v2_x_channel_clear(const struct mhu_v2_x_dev_t *dev, in mhu_v2_x_channel_clear() argument
255 assert(dev != NULL); in mhu_v2_x_channel_clear()
257 p_mhu = (union mhu_v2_x_frame *)dev->base; in mhu_v2_x_channel_clear()
259 if (!(dev->is_initialized)) { in mhu_v2_x_channel_clear()
263 if (dev->frame == MHU_V2_X_RECEIVER_FRAME) { in mhu_v2_x_channel_clear()
272 const struct mhu_v2_x_dev_t *dev, uint32_t channel, uint32_t *value) in mhu_v2_x_channel_receive() argument
276 assert(dev != NULL); in mhu_v2_x_channel_receive()
278 p_mhu = (union mhu_v2_x_frame *)dev->base; in mhu_v2_x_channel_receive()
280 if (!(dev->is_initialized)) { in mhu_v2_x_channel_receive()
284 if (dev->frame == MHU_V2_X_RECEIVER_FRAME) { in mhu_v2_x_channel_receive()
293 const struct mhu_v2_x_dev_t *dev, uint32_t channel, uint32_t mask) in mhu_v2_x_channel_mask_set() argument
297 assert(dev != NULL); in mhu_v2_x_channel_mask_set()
299 p_mhu = (union mhu_v2_x_frame *)dev->base; in mhu_v2_x_channel_mask_set()
301 if (!(dev->is_initialized)) { in mhu_v2_x_channel_mask_set()
305 if (dev->frame == MHU_V2_X_RECEIVER_FRAME) { in mhu_v2_x_channel_mask_set()
314 const struct mhu_v2_x_dev_t *dev, uint32_t channel, uint32_t mask) in mhu_v2_x_channel_mask_clear() argument
318 assert(dev != NULL); in mhu_v2_x_channel_mask_clear()
320 p_mhu = (union mhu_v2_x_frame *)dev->base; in mhu_v2_x_channel_mask_clear()
322 if (!(dev->is_initialized)) { in mhu_v2_x_channel_mask_clear()
326 if (dev->frame == MHU_V2_X_RECEIVER_FRAME) { in mhu_v2_x_channel_mask_clear()
334 const struct mhu_v2_x_dev_t *dev) in mhu_v2_x_initiate_transfer() argument
338 assert(dev != NULL); in mhu_v2_x_initiate_transfer()
340 p_mhu = (union mhu_v2_x_frame *)dev->base; in mhu_v2_x_initiate_transfer()
342 if (!(dev->is_initialized)) { in mhu_v2_x_initiate_transfer()
346 if (dev->frame != MHU_V2_X_SENDER_FRAME) { in mhu_v2_x_initiate_transfer()
360 enum mhu_v2_x_error_t mhu_v2_x_close_transfer(const struct mhu_v2_x_dev_t *dev) in mhu_v2_x_close_transfer() argument
364 assert(dev != NULL); in mhu_v2_x_close_transfer()
366 p_mhu = (union mhu_v2_x_frame *)dev->base; in mhu_v2_x_close_transfer()
368 if (!(dev->is_initialized)) { in mhu_v2_x_close_transfer()
372 if (dev->frame != MHU_V2_X_SENDER_FRAME) { in mhu_v2_x_close_transfer()