Skip to content

Commit

Permalink
modules: hal_nordic: nrfx: update API version to 3.3.0
Browse files Browse the repository at this point in the history
Update i2s nrfx driver to pass buffer size alongside buffer pointers.
No functional changes.

Signed-off-by: Tomasz Moń <[email protected]>
  • Loading branch information
tmon-nordic committed Jan 8, 2024
1 parent b64915e commit 30650ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions drivers/i2s/i2s_nrfx.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ static void free_rx_buffer(struct i2s_nrfx_drv_data *drv_data, void *buffer)
static bool supply_next_buffers(struct i2s_nrfx_drv_data *drv_data,
nrfx_i2s_buffers_t *next)
{
uint32_t block_size = (drv_data->active_dir == I2S_DIR_TX)
? drv_data->tx.cfg.block_size
: drv_data->rx.cfg.block_size;

drv_data->last_tx_buffer = next->p_tx_buffer;

if (drv_data->active_dir != I2S_DIR_TX) { /* -> RX active */
Expand All @@ -236,6 +240,8 @@ static bool supply_next_buffers(struct i2s_nrfx_drv_data *drv_data,
}
}

next->buffer_size = block_size / sizeof(uint32_t);

LOG_DBG("Next buffers: %p/%p", next->p_tx_buffer, next->p_rx_buffer);
nrfx_i2s_next_buffers_set(drv_data->p_i2s, next);
return true;
Expand Down Expand Up @@ -661,10 +667,10 @@ static int start_transfer(struct i2s_nrfx_drv_data *drv_data)
: drv_data->rx.cfg.block_size;
nrfx_err_t err;

initial_buffers.buffer_size = block_size / sizeof(uint32_t);
drv_data->last_tx_buffer = initial_buffers.p_tx_buffer;

err = nrfx_i2s_start(drv_data->p_i2s, &initial_buffers,
block_size / sizeof(uint32_t), 0);
err = nrfx_i2s_start(drv_data->p_i2s, &initial_buffers, 0);
if (err == NRFX_SUCCESS) {
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion modules/hal_nordic/nrfx/nrfx_config_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

/** @brief Symbol specifying minor version of the nrfx API to be used. */
#ifndef NRFX_CONFIG_API_VER_MINOR
#define NRFX_CONFIG_API_VER_MINOR 2
#define NRFX_CONFIG_API_VER_MINOR 3
#endif

/** @brief Symbol specifying micro version of the nrfx API to be used. */
Expand Down

0 comments on commit 30650ab

Please sign in to comment.