File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
ports/nrf/modules/machine Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change 31
31
#include "py/runtime.h"
32
32
#include "py/mperrno.h"
33
33
#include "py/mphal.h"
34
+
35
+ #if MICROPY_PY_MACHINE_I2C
36
+
34
37
#include "extmod/machine_i2c.h"
35
38
#include "i2c.h"
39
+ #if NRFX_TWI_ENABLED
36
40
#include "nrfx_twi.h"
41
+ #else
42
+ #include "nrfx_twim.h"
43
+ #endif
37
44
38
- #if MICROPY_PY_MACHINE_I2C
45
+ #if NRFX_TWIM_ENABLED
46
+
47
+ #define nrfx_twi_t nrfx_twim_t
48
+ #define nrfx_twi_config_t nrfx_twim_config_t
49
+
50
+ #define nrfx_twi_init nrfx_twim_init
51
+ #define nrfx_twi_enable nrfx_twim_enable
52
+ #define nrfx_twi_rx nrfx_twim_rx
53
+ #define nrfx_twi_tx nrfx_twim_tx
54
+ #define nrfx_twi_disable nrfx_twim_disable
55
+
56
+ #define NRFX_TWI_INSTANCE NRFX_TWIM_INSTANCE
57
+
58
+ #define NRF_TWI_FREQ_400K NRF_TWIM_FREQ_400K
59
+
60
+ #endif
39
61
40
62
STATIC const mp_obj_type_t machine_hard_i2c_type ;
41
63
You can’t perform that action at this time.
0 commit comments