Skip to content

Commit b83f5eb

Browse files
Hieu Nguyennhutnguyenkc
authored andcommitted
hal: renesas: rz: Use r_transfer_api.h of rzv-fsp for the RZ series
Use r_transfer_api.h of rzv-fsp to support the callbackSet member of the transfer_api_t struct Signed-off-by: Hieu Nguyen <[email protected]> Signed-off-by: Nhut Nguyen <[email protected]>
1 parent d8ee5f1 commit b83f5eb

File tree

2 files changed

+27
-26
lines changed

2 files changed

+27
-26
lines changed

drivers/rz/README

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,7 @@ Patch List:
8888
Impacted files:
8989
drivers/rz/fsp/src/rzg/r_gtm/r_gtm.c
9090
drivers/rz/fsp/src/rzv/r_gtm/r_gtm.c
91+
92+
* Use r_transfer_api.h of rzv-fsp to support the callbackSet member of the transfer_api_t struct
93+
Impacted files:
94+
drivers/rz/fsp/inc/api/r_transfer_api.h

drivers/rz/fsp/inc/api/r_transfer_api.h

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@
55
*/
66

77
/*******************************************************************************************************************//**
8-
* @ingroup RENESAS_INTERFACES
8+
* @ingroup RENESAS_TRANSFER_INTERFACES
99
* @defgroup TRANSFER_API Transfer Interface
1010
*
1111
* @brief Interface for data transfer functions.
1212
*
1313
* @section TRANSFER_API_SUMMARY Summary
1414
* The transfer interface supports background data transfer (no CPU intervention).
1515
*
16-
* Implemented by:
17-
* - @ref DMAC_B
1816
*
1917
* @{
2018
**********************************************************************************************************************/
@@ -49,8 +47,6 @@ FSP_HEADER
4947
**********************************************************************************************************************/
5048

5149
/** Transfer control block. Allocate an instance specific control block to pass into the transfer API calls.
52-
* @par Implemented as
53-
* - dmac_b_instance_ctrl_t
5450
*/
5551
typedef void transfer_ctrl_t;
5652

@@ -95,7 +91,8 @@ typedef enum e_transfer_size
9591
{
9692
TRANSFER_SIZE_1_BYTE = 0, ///< Each transfer transfers a 8-bit value
9793
TRANSFER_SIZE_2_BYTE = 1, ///< Each transfer transfers a 16-bit value
98-
TRANSFER_SIZE_4_BYTE = 2 ///< Each transfer transfers a 32-bit value
94+
TRANSFER_SIZE_4_BYTE = 2, ///< Each transfer transfers a 32-bit value
95+
TRANSFER_SIZE_8_BYTE = 3 ///< Each transfer transfers a 64-bit value
9996
} transfer_size_t;
10097

10198
#endif
@@ -172,6 +169,16 @@ typedef enum e_transfer_irq
172169

173170
#endif
174171

172+
#ifndef BSP_OVERRIDE_TRANSFER_CALLBACK_ARGS_T
173+
174+
/** Callback function parameter data. */
175+
typedef struct st_transfer_callback_args_t
176+
{
177+
void const * p_context; ///< Placeholder for user data. Set in @ref transfer_api_t::open function in ::transfer_cfg_t.
178+
} transfer_callback_args_t;
179+
180+
#endif
181+
175182
/** Driver specific information. */
176183
typedef struct st_transfer_properties
177184
{
@@ -266,8 +273,6 @@ typedef enum e_transfer_start_mode
266273
typedef struct st_transfer_api
267274
{
268275
/** Initial configuration.
269-
* @par Implemented as
270-
* - @ref R_DMAC_B_Open()
271276
*
272277
* @param[in,out] p_ctrl Pointer to control block. Must be declared by user. Elements set here.
273278
* @param[in] p_cfg Pointer to configuration structure. All elements of this structure
@@ -277,8 +282,6 @@ typedef struct st_transfer_api
277282

278283
/** Reconfigure the transfer.
279284
* Enable the transfer if p_info is valid.
280-
* @par Implemented as
281-
* - @ref R_DMAC_B_Reconfigure()
282285
*
283286
* @param[in,out] p_ctrl Pointer to control block. Must be declared by user. Elements set here.
284287
* @param[in] p_info Pointer to a new transfer info structure.
@@ -287,8 +290,6 @@ typedef struct st_transfer_api
287290

288291
/** Reset source address pointer, destination address pointer, and/or length, keeping all other settings the same.
289292
* Enable the transfer if p_src, p_dest, and length are valid.
290-
* @par Implemented as
291-
* - @ref R_DMAC_B_Reset()
292293
*
293294
* @param[in] p_ctrl Control block set in @ref transfer_api_t::open call for this transfer.
294295
* @param[in] p_src Pointer to source. Set to NULL if source pointer should not change.
@@ -302,8 +303,6 @@ typedef struct st_transfer_api
302303

303304
/** Enable transfer. Transfers occur after the activation source event (or when
304305
* @ref transfer_api_t::softwareStart is called if no peripheral event is chosen as activation source).
305-
* @par Implemented as
306-
* - @ref R_DMAC_B_Enable()
307306
*
308307
* @param[in] p_ctrl Control block set in @ref transfer_api_t::open call for this transfer.
309308
*/
@@ -313,8 +312,6 @@ typedef struct st_transfer_api
313312
* @ref transfer_api_t::softwareStart is called if no peripheral event is chosen as the DMAC activation source).
314313
* @note If a transfer is in progress, it will be completed. Subsequent transfer requests do not cause a
315314
* transfer.
316-
* @par Implemented as
317-
* - @ref R_DMAC_B_Disable()
318315
*
319316
* @param[in] p_ctrl Control block set in @ref transfer_api_t::open call for this transfer.
320317
*/
@@ -323,8 +320,6 @@ typedef struct st_transfer_api
323320
/** Start transfer in software.
324321
* @warning Only works if no peripheral event is chosen as the DMAC activation source.
325322
* @note Not supported for DTC.
326-
* @par Implemented as
327-
* - @ref R_DMAC_B_SoftwareStart()
328323
*
329324
* @param[in] p_ctrl Control block set in @ref transfer_api_t::open call for this transfer.
330325
* @param[in] mode Select mode from @ref transfer_start_mode_t.
@@ -335,34 +330,26 @@ typedef struct st_transfer_api
335330
* @note Not supported for DTC.
336331
* @note Only applies for transfers started with TRANSFER_START_MODE_REPEAT.
337332
* @warning Only works if no peripheral event is chosen as the DMAC activation source.
338-
* @par Implemented as
339-
* - @ref R_DMAC_B_SoftwareStop()
340333
*
341334
* @param[in] p_ctrl Control block set in @ref transfer_api_t::open call for this transfer.
342335
*/
343336
fsp_err_t (* softwareStop)(transfer_ctrl_t * const p_ctrl);
344337

345338
/** Provides information about this transfer.
346-
* @par Implemented as
347-
* - @ref R_DMAC_B_InfoGet()
348339
*
349340
* @param[in] p_ctrl Control block set in @ref transfer_api_t::open call for this transfer.
350341
* @param[out] p_properties Driver specific information.
351342
*/
352343
fsp_err_t (* infoGet)(transfer_ctrl_t * const p_ctrl, transfer_properties_t * const p_properties);
353344

354345
/** Releases hardware lock. This allows a transfer to be reconfigured using @ref transfer_api_t::open.
355-
* @par Implemented as
356-
* - @ref R_DMAC_B_Close()
357346
*
358347
* @param[in] p_ctrl Control block set in @ref transfer_api_t::open call for this transfer.
359348
*/
360349
fsp_err_t (* close)(transfer_ctrl_t * const p_ctrl);
361350

362351
/** To update next transfer information without interruption during transfer.
363352
* Allow further transfer continuation.
364-
* @par Implemented as
365-
* - @ref R_DMAC_B_Reload()
366353
*
367354
* @param[in] p_ctrl Control block set in @ref transfer_api_t::open call for this transfer.
368355
* @param[in] p_src Pointer to source. Set to NULL if source pointer should not change.
@@ -372,6 +359,16 @@ typedef struct st_transfer_api
372359
fsp_err_t (* reload)(transfer_ctrl_t * const p_ctrl, void const * p_src, void * p_dest,
373360
uint32_t const num_transfers);
374361

362+
/** Specify callback function and optional context pointer and working memory pointer.
363+
*
364+
* @param[in] p_ctrl Control block set in @ref transfer_api_t::open call for this transfer.
365+
* @param[in] p_callback Callback function to register
366+
* @param[in] p_context Pointer to send to callback function
367+
* @param[in] p_callback_memory Pointer to volatile memory where callback structure can be allocated.
368+
* Callback arguments allocated here are only valid during the callback.
369+
*/
370+
fsp_err_t (* callbackSet)(transfer_ctrl_t * const p_ctrl, void (* p_callback)(transfer_callback_args_t *),
371+
void const * const p_context, transfer_callback_args_t * const p_callback_memory);
375372
} transfer_api_t;
376373

377374
/** This structure encompasses everything that is needed to use an instance of this interface. */

0 commit comments

Comments
 (0)