-
Notifications
You must be signed in to change notification settings - Fork 0
/
m_app_twi.h
59 lines (46 loc) · 1.61 KB
/
m_app_twi.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef __M_APP_TWI_H__
#define __M_APP_TWI_H__
#include "app_twi.h"
#define MAX_MULTI_DEVICE_NUM 5
void app_twi_schedule_multi_device_multi_read(app_twi_t *p_app_twi,
uint8_t ui8MultiDeviceI2cBase[],
uint8_t ui8MultiDeviceSlaveAddr[],
uint8_t ui8MultiDeviceRegStartAddr[],
uint8_t ui8MultiDeviceByteToRead[],
uint8_t ui8MultiDeviceNum,
uint8_t m_buffer[],
app_twi_callback_t cb_fcn,
void* p_user_data);
void app_twi_schedule_multi_read(app_twi_t *p_app_twi,
uint8_t dev_addr,
uint8_t reg_addr,
uint8_t m_buffer[],
uint8_t data_len,
app_twi_callback_t cb_fcn,
void* p_user_data);
void app_twi_schedule_multi_write(app_twi_t *p_app_twi,
uint8_t dev_addr,
uint8_t reg_addr,
uint8_t m_buffer[],
uint8_t data_len,
app_twi_callback_t cb_fcn,
void* p_user_data);
ret_code_t app_twi_perform_single_read(app_twi_t *p_app_twi,
uint8_t dev_addr,
uint8_t reg_addr,
uint8_t *p_reg_value);
ret_code_t app_twi_perform_multi_read(app_twi_t *p_app_twi,
uint8_t dev_addr,
uint8_t reg_addr,
uint8_t reg_values[],
uint8_t data_len);
ret_code_t app_twi_perform_single_write(app_twi_t *p_app_twi,
uint8_t dev_addr,
uint8_t reg_addr,
uint8_t reg_value);
ret_code_t app_twi_perform_multi_write(app_twi_t *p_app_twi,
uint8_t dev_addr,
uint8_t reg_addr,
uint8_t reg_values[],
uint8_t data_len);
#endif //__M_APP_TWI_H__