Skip to content

Commit f7126bd

Browse files
committed
code cleanup
1 parent b5dcb08 commit f7126bd

File tree

23 files changed

+148
-80
lines changed

23 files changed

+148
-80
lines changed

drv/lib/src/lib_drv_spi_master/drv_spi_master.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,8 @@ err_t spi_master_transfer( spi_master_t *obj, uint8_t *write_data_buffer,
470470
}
471471

472472
hal_status = hal_spi_master_transfer( (handle_t *)&hal_handle, write_data_buffer,
473-
read_data_buffer,
474-
data_length );
473+
read_data_buffer,
474+
data_length );
475475

476476
if (hal_status == HAL_SPI_MASTER_MODULE_ERROR)
477477
{

hal/lib/include/hal_spi_master.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -488,8 +488,8 @@ err_t hal_spi_master_write_then_read( handle_t handle, uint8_t *write_data_buffe
488488

489489
/**
490490
* @brief Perform full-duplex SPI transfer.
491-
* @details Simultaneously writes and reads a sequence of bytes on the SPI bus in blocking mode.
492-
* For each transmitted byte, a byte is received.
491+
* @details Simultaneously writes and reads a sequence of bytes on the
492+
* SPI bus in blocking mode. For each transmitted byte, a byte is received.
493493
*
494494
* @param[in] handle SPI master handle.
495495
* See #hal_spi_master_t structure definition for detailed explanation.
@@ -515,10 +515,9 @@ err_t hal_spi_master_write_then_read( handle_t handle, uint8_t *write_data_buffe
515515
* hal_spi_master_transfer( handle, tx_data, rx_data, DATA_LENGTH );
516516
* @endcode
517517
*/
518-
err_t hal_spi_master_transfer( handle_t handle,
519-
uint8_t *write_data_buffer,
520-
uint8_t *read_data_buffer,
521-
size_t data_length );
518+
err_t hal_spi_master_transfer( handle_t handle, uint8_t *write_data_buffer,
519+
uint8_t *read_data_buffer,
520+
size_t data_length );
522521

523522
/**
524523
* @brief Close SPI Master HAL context object.

hal/lib/src/lib_hal_spi_master/hal_spi_master.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -388,10 +388,9 @@ err_t hal_spi_master_write_then_read( handle_t handle, uint8_t *write_data_buffe
388388
}
389389
}
390390

391-
err_t hal_spi_master_transfer( handle_t handle,
392-
uint8_t *write_data_buffer,
393-
uint8_t *read_data_buffer,
394-
size_t data_length )
391+
err_t hal_spi_master_transfer( handle_t handle, uint8_t *write_data_buffer,
392+
uint8_t *read_data_buffer,
393+
size_t data_length )
395394
{
396395
hal_spi_master_handle_register_t *hal_handle = ( hal_spi_master_handle_register_t* )hal_is_handle_null( handle );
397396
err_t hal_status = HAL_SPI_MASTER_SUCCESS;

targets/arm/mikroe/nxp/include/spi_master/hal_ll_spi_master.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,18 +205,20 @@ hal_ll_err_t hal_ll_spi_master_write_then_read( handle_t *handle, uint8_t *write
205205
*
206206
* Executes a full-duplex SPI transfer. While writing `write_data_buffer`,
207207
* the incoming bytes from the SPI slave are placed into `read_data_buffer`.
208-
* This function is suitable for devices that require simultaneous transmission and reception.
208+
* This function is suitable for devices that require simultaneous
209+
* transmission and reception.
209210
*
210211
* @param[in] handle HAL context object handle.
211212
* @param[in] write_data_buffer Pointer to data to be written to the bus.
212213
* @param[out] read_data_buffer Pointer to buffer where read data will be stored.
213214
* @param[in] data_length Number of bytes to transfer.
214215
*
215216
* @return hal_ll_err_t Returns #HAL_LL_SPI_MASTER_SUCCESS on success,
216-
* otherwise returns #HAL_LL_SPI_MASTER_MODULE_ERROR if handle is invalid or data_length is 0.
217+
* otherwise returns #HAL_LL_SPI_MASTER_MODULE_ERROR
218+
* if handle is invalid or data_length is 0.
217219
*
218-
* @note This function assumes the SPI module is already initialized via #hal_ll_spi_master_register_handle
219-
* and #hal_ll_module_configure_spi.
220+
* @note This function assumes the SPI module is already initialized via
221+
* #hal_ll_spi_master_register_handle and #hal_ll_module_configure_spi.
220222
*/
221223
hal_ll_err_t hal_ll_spi_master_transfer( handle_t *handle,
222224
uint8_t *write_data_buffer,

targets/arm/mikroe/nxp/src/spi_master/implementation_1/hal_ll_spi_master.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,10 @@ static void _hal_ll_spi_master_read_bare_metal(hal_ll_spi_master_hw_specifics_ma
360360
* If the read buffer is NULL, the received data will be discarded.
361361
*
362362
* @param[in] *map - Object specific context handler.
363-
* @param[in] *write_data_buffer - Pointer to write data buffer. If NULL, dummy data will be used.
364-
* @param[out] *read_data_buffer - Pointer to read data buffer. If NULL, received data will be discarded.
363+
* @param[in] *write_data_buffer - Pointer to write data buffer.
364+
* If NULL, dummy data will be used.
365+
* @param[out] *read_data_buffer - Pointer to read data buffer.
366+
* If NULL, received data will be discarded.
365367
* @param[in] data_length - Number of bytes to be transferred.
366368
*
367369
* @note TX FIFO is flushed and re-enabled on each byte transfer to ensure proper behavior.

targets/arm/mikroe/sam/include/spi_master/hal_ll_spi_master.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,18 +217,20 @@ hal_ll_err_t hal_ll_spi_master_write_then_read( handle_t *handle, uint8_t *write
217217
*
218218
* Executes a full-duplex SPI transfer. While writing `write_data_buffer`,
219219
* the incoming bytes from the SPI slave are placed into `read_data_buffer`.
220-
* This function is suitable for devices that require simultaneous transmission and reception.
220+
* This function is suitable for devices that require simultaneous
221+
* transmission and reception.
221222
*
222223
* @param[in] handle HAL context object handle.
223224
* @param[in] write_data_buffer Pointer to data to be written to the bus.
224225
* @param[out] read_data_buffer Pointer to buffer where read data will be stored.
225226
* @param[in] data_length Number of bytes to transfer.
226227
*
227228
* @return hal_ll_err_t Returns #HAL_LL_SPI_MASTER_SUCCESS on success,
228-
* otherwise returns #HAL_LL_SPI_MASTER_MODULE_ERROR if handle is invalid or data_length is 0.
229+
* otherwise returns #HAL_LL_SPI_MASTER_MODULE_ERROR
230+
* if handle is invalid or data_length is 0.
229231
*
230-
* @note This function assumes the SPI module is already initialized via #hal_ll_spi_master_register_handle
231-
* and #hal_ll_module_configure_spi.
232+
* @note This function assumes the SPI module is already initialized via
233+
* #hal_ll_spi_master_register_handle and #hal_ll_module_configure_spi.
232234
*/
233235
hal_ll_err_t hal_ll_spi_master_transfer( handle_t *handle,
234236
uint8_t *write_data_buffer,

targets/arm/mikroe/sam/src/spi_master/implementations/implementation_1/hal_ll_spi_master.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,14 +267,19 @@ static void hal_ll_spi_master_write_bare_metal( hal_ll_spi_master_base_handle_t
267267
* If the read buffer is NULL, the received data will be discarded.
268268
*
269269
* @param[in] *map - Object specific context handler.
270-
* @param[in] *write_data_buffer - Pointer to write data buffer. If NULL, dummy data will be used.
271-
* @param[out] *read_data_buffer - Pointer to read data buffer. If NULL, received data will be discarded.
270+
* @param[in] *write_data_buffer - Pointer to write data buffer.
271+
* If NULL, dummy data will be used.
272+
* @param[out] *read_data_buffer - Pointer to read data buffer.
273+
* If NULL, received data will be discarded.
272274
* @param[in] data_length - Number of bytes to be transferred.
273275
*
274276
* @note TX FIFO is flushed and re-enabled on each byte transfer to ensure proper behavior.
275277
* This implementation uses polling and is blocking.
276278
*/
277-
static void _hal_ll_spi_master_transfer_bare_metal ( hal_ll_spi_master_hw_specifics_map_t *map, uint8_t *write_data_buffer, uint8_t *read_data_buffer, size_t data_length );
279+
static void _hal_ll_spi_master_transfer_bare_metal ( hal_ll_spi_master_hw_specifics_map_t *map,
280+
uint8_t *write_data_buffer,
281+
uint8_t *read_data_buffer,
282+
size_t data_length );
278283

279284
/**
280285
* @brief Maps new-found module specific values.

targets/arm/mikroe/stm32/include/spi_master/hal_ll_spi_master.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,18 +217,20 @@ hal_ll_err_t hal_ll_spi_master_write_then_read( handle_t *handle, uint8_t *write
217217
*
218218
* Executes a full-duplex SPI transfer. While writing `write_data_buffer`,
219219
* the incoming bytes from the SPI slave are placed into `read_data_buffer`.
220-
* This function is suitable for devices that require simultaneous transmission and reception.
220+
* This function is suitable for devices that require simultaneous
221+
* transmission and reception.
221222
*
222223
* @param[in] handle HAL context object handle.
223224
* @param[in] write_data_buffer Pointer to data to be written to the bus.
224225
* @param[out] read_data_buffer Pointer to buffer where read data will be stored.
225226
* @param[in] data_length Number of bytes to transfer.
226227
*
227228
* @return hal_ll_err_t Returns #HAL_LL_SPI_MASTER_SUCCESS on success,
228-
* otherwise returns #HAL_LL_SPI_MASTER_MODULE_ERROR if handle is invalid or data_length is 0.
229+
* otherwise returns #HAL_LL_SPI_MASTER_MODULE_ERROR
230+
* if handle is invalid or data_length is 0.
229231
*
230-
* @note This function assumes the SPI module is already initialized via #hal_ll_spi_master_register_handle
231-
* and #hal_ll_module_configure_spi.
232+
* @note This function assumes the SPI module is already initialized via
233+
* #hal_ll_spi_master_register_handle and #hal_ll_module_configure_spi.
232234
*/
233235
hal_ll_err_t hal_ll_spi_master_transfer( handle_t *handle,
234236
uint8_t *write_data_buffer,

targets/arm/mikroe/stm32/src/spi_master/implementation_1/hal_ll_spi_master.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,14 +330,19 @@ hal_ll_err_t hal_ll_spi_master_write_then_read(handle_t *handle, uint8_t *write_
330330
* If the read buffer is NULL, the received data will be discarded.
331331
*
332332
* @param[in] *map - Object specific context handler.
333-
* @param[in] *write_data_buffer - Pointer to write data buffer. If NULL, dummy data will be used.
334-
* @param[out] *read_data_buffer - Pointer to read data buffer. If NULL, received data will be discarded.
333+
* @param[in] *write_data_buffer - Pointer to write data buffer.
334+
* If NULL, dummy data will be used.
335+
* @param[out] *read_data_buffer - Pointer to read data buffer.
336+
* If NULL, received data will be discarded.
335337
* @param[in] data_length - Number of bytes to be transferred.
336338
*
337339
* @note TX FIFO is flushed and re-enabled on each byte transfer to ensure proper behavior.
338340
* This implementation uses polling and is blocking.
339341
*/
340-
static void _hal_ll_spi_master_transfer_bare_metal ( hal_ll_spi_master_hw_specifics_map_t *map, uint8_t *write_data_buffer, uint8_t *read_data_buffer, size_t data_length );
342+
static void _hal_ll_spi_master_transfer_bare_metal ( hal_ll_spi_master_hw_specifics_map_t *map,
343+
uint8_t *write_data_buffer,
344+
uint8_t *read_data_buffer,
345+
size_t data_length );
341346

342347
/**
343348
* @brief Maps new-found module specific values.

targets/arm/mikroe/stm32/src/spi_master/implementation_2/hal_ll_spi_master.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,14 +377,19 @@ hal_ll_err_t hal_ll_spi_master_write_then_read(handle_t *handle, uint8_t *write_
377377
* If the read buffer is NULL, the received data will be discarded.
378378
*
379379
* @param[in] *map - Object specific context handler.
380-
* @param[in] *write_data_buffer - Pointer to write data buffer. If NULL, dummy data will be used.
381-
* @param[out] *read_data_buffer - Pointer to read data buffer. If NULL, received data will be discarded.
380+
* @param[in] *write_data_buffer - Pointer to write data buffer.
381+
* If NULL, dummy data will be used.
382+
* @param[out] *read_data_buffer - Pointer to read data buffer.
383+
* If NULL, received data will be discarded.
382384
* @param[in] data_length - Number of bytes to be transferred.
383385
*
384386
* @note TX FIFO is flushed and re-enabled on each byte transfer to ensure proper behavior.
385387
* This implementation uses polling and is blocking.
386388
*/
387-
static void _hal_ll_spi_master_transfer_bare_metal ( hal_ll_spi_master_hw_specifics_map_t *map, uint8_t *write_data_buffer, uint8_t *read_data_buffer, size_t data_length );
389+
static void _hal_ll_spi_master_transfer_bare_metal ( hal_ll_spi_master_hw_specifics_map_t *map,
390+
uint8_t *write_data_buffer,
391+
uint8_t *read_data_buffer,
392+
size_t data_length );
388393

389394
/**
390395
* @brief Maps new-found module specific values.

0 commit comments

Comments
 (0)