-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnrf_drv_mpu.h
65 lines (45 loc) · 1.6 KB
/
nrf_drv_mpu.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
60
61
62
63
64
/*
* The library is not extensively tested and only
* meant as a simple explanation and for inspiration.
* NO WARRANTY of ANY KIND is provided.
*/
#ifndef NRF_DRV_MPU__
#define NRF_DRV_MPU__
#include <stdbool.h>
#include <stdint.h>
/**@brief Function to initiate TWI drivers
*
* @retval uint32_t Error code
*/
uint32_t nrf_drv_mpu_init(void);
void nrf_drv_spi_disable(void);
void nrf_drv_spi_enable(void);
/**@brief Function for reading an arbitrary register
*
* @param[in] reg Register to write
* @param[in] data Value
* @param[in] length Number of bytes to write
* @retval uint32_t Error code
*/
uint32_t nrf_drv_mpu_write_registers(uint8_t reg, uint8_t * p_data, uint32_t length);
/**@brief Function for reading an arbitrary register
*
* @param[in] reg Register to write
* @param[in] data Value
* @retval uint32_t Error code
*/
uint32_t nrf_drv_mpu_write_single_register(uint8_t reg, uint8_t data);
/**@brief Function for reading arbitrary register(s)
*
* @param[in] reg Register to read
* @param[in] p_data Pointer to place to store value(s)
* @param[in] length Number of registers to read
* @retval uint32_t Error code
*/
uint32_t nrf_drv_mpu_read_registers(uint8_t reg, uint8_t * p_data, uint32_t length);
uint32_t nrf_drv_mpu_read_magnetometer_registers(uint8_t reg, uint8_t * p_data, uint32_t length);
uint32_t nrf_drv_mpu_write_magnetometer_register(uint8_t reg, uint8_t data);
#endif /* NRF_DRV_MPU__ */
/**
@}
*/