82
82
NRF_GPIO_PIN_S0D1, \
83
83
NRF_GPIO_PIN_NOSENSE)
84
84
85
- #define HW_TIMEOUT 10000
85
+ #define HW_TIMEOUT 100000
86
86
87
87
// Control block - driver instance local data.
88
88
typedef struct
@@ -93,13 +93,13 @@ typedef struct
93
93
nrfx_twi_xfer_desc_t xfer_desc ;
94
94
uint32_t flags ;
95
95
uint8_t * p_curr_buf ;
96
- uint8_t curr_length ;
96
+ size_t curr_length ;
97
97
bool curr_no_stop ;
98
98
nrfx_drv_state_t state ;
99
99
bool error ;
100
100
volatile bool busy ;
101
101
bool repeated ;
102
- uint8_t bytes_transferred ;
102
+ size_t bytes_transferred ;
103
103
bool hold_bus_uninit ;
104
104
} twi_control_block_t ;
105
105
@@ -254,8 +254,8 @@ void nrfx_twi_disable(nrfx_twi_t const * p_instance)
254
254
255
255
static bool twi_send_byte (NRF_TWI_Type * p_twi ,
256
256
uint8_t const * p_data ,
257
- uint8_t length ,
258
- uint8_t * p_bytes_transferred ,
257
+ size_t length ,
258
+ size_t * p_bytes_transferred ,
259
259
bool no_stop )
260
260
{
261
261
if (* p_bytes_transferred < length )
@@ -280,8 +280,8 @@ static bool twi_send_byte(NRF_TWI_Type * p_twi,
280
280
281
281
static void twi_receive_byte (NRF_TWI_Type * p_twi ,
282
282
uint8_t * p_data ,
283
- uint8_t length ,
284
- uint8_t * p_bytes_transferred )
283
+ size_t length ,
284
+ size_t * p_bytes_transferred )
285
285
{
286
286
if (* p_bytes_transferred < length )
287
287
{
@@ -304,9 +304,9 @@ static void twi_receive_byte(NRF_TWI_Type * p_twi,
304
304
305
305
static bool twi_transfer (NRF_TWI_Type * p_twi ,
306
306
bool * p_error ,
307
- uint8_t * p_bytes_transferred ,
307
+ size_t * p_bytes_transferred ,
308
308
uint8_t * p_data ,
309
- uint8_t length ,
309
+ size_t length ,
310
310
bool no_stop )
311
311
{
312
312
bool do_stop_check = ((* p_error ) || ((* p_bytes_transferred ) == length ));
@@ -376,7 +376,7 @@ static bool twi_transfer(NRF_TWI_Type * p_twi,
376
376
static nrfx_err_t twi_tx_start_transfer (twi_control_block_t * p_cb ,
377
377
NRF_TWI_Type * p_twi ,
378
378
uint8_t const * p_data ,
379
- uint8_t length ,
379
+ size_t length ,
380
380
bool no_stop )
381
381
{
382
382
nrfx_err_t ret_code = NRFX_SUCCESS ;
@@ -444,7 +444,7 @@ static nrfx_err_t twi_tx_start_transfer(twi_control_block_t * p_cb,
444
444
static nrfx_err_t twi_rx_start_transfer (twi_control_block_t * p_cb ,
445
445
NRF_TWI_Type * p_twi ,
446
446
uint8_t const * p_data ,
447
- uint8_t length )
447
+ size_t length )
448
448
{
449
449
nrfx_err_t ret_code = NRFX_SUCCESS ;
450
450
volatile int32_t hw_timeout ;
0 commit comments