1 /* ST Microelectronics STMEMS hal i/f
2 *
3 * Copyright (c) 2021 STMicroelectronics
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 *
7 * zephyrproject-rtos/modules/hal/st/sensor/stmemsc/
8 */
9
10 #include "stmemsc.h"
11
stmemsc_i3c_read(void * stmemsc,uint8_t reg_addr,uint8_t * value,uint8_t len)12 int stmemsc_i3c_read(void *stmemsc,
13 uint8_t reg_addr, uint8_t *value, uint8_t len)
14 {
15 struct i3c_device_desc *target = **(struct i3c_device_desc ***)stmemsc;
16
17 return i3c_burst_read(target, reg_addr, value, len);
18 }
19
stmemsc_i3c_write(void * stmemsc,uint8_t reg_addr,uint8_t * value,uint8_t len)20 int stmemsc_i3c_write(void *stmemsc,
21 uint8_t reg_addr, uint8_t *value, uint8_t len)
22 {
23 struct i3c_device_desc *target = **(struct i3c_device_desc ***)stmemsc;
24
25 return i3c_burst_write(target, reg_addr, value, len);
26 }
27