18#ifndef __VSF_TEMPLATE_RNG_H__
19#define __VSF_TEMPLATE_RNG_H__
33#ifndef VSF_RNG_CFG_MULTI_CLASS
34# define VSF_RNG_CFG_MULTI_CLASS ENABLED
37#if defined(VSF_HW_RNG_COUNT) && !defined(VSF_HW_RNG_MASK)
38# define VSF_HW_RNG_MASK VSF_HAL_COUNT_TO_MASK(VSF_HW_RNG_COUNT)
41#if defined(VSF_HW_RNG_MASK) && !defined(VSF_HW_RNG_COUNT)
42# define VSF_HW_RNG_COUNT VSF_HAL_MASK_TO_COUNT(VSF_HW_RNG_MASK)
46#ifndef VSF_RNG_CFG_PREFIX
47# if VSF_RNG_CFG_MULTI_CLASS == ENABLED
48# define VSF_RNG_CFG_PREFIX vsf
49# elif defined(VSF_HW_RNG_COUNT) && (VSF_HW_RNG_COUNT != 0)
50# define VSF_RNG_CFG_PREFIX vsf_hw
52# define VSF_RNG_CFG_PREFIX vsf
56#ifndef VSF_RNG_CFG_FUNCTION_RENAME
57# define VSF_RNG_CFG_FUNCTION_RENAME ENABLED
63#if VSF_RNG_CFG_REIMPLEMENT_TYPE_CFG == DISABLED
64# define VSF_RNG_CFG_REIMPLEMENT_TYPE_CFG DISABLED
70#if VSF_RNG_CFG_REIMPLEMENT_TYPE_CAPABILITY == DISABLED
71# define VSF_RNG_CFG_REIMPLEMENT_TYPE_CAPABILITY DISABLED
74#ifndef VSF_RNG_CFG_INHERT_HAL_CAPABILITY
75# define VSF_RNG_CFG_INHERT_HAL_CAPABILITY ENABLED
80#define VSF_RNG_APIS(__prefix_name) \
81 __VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, rng, init, VSF_MCONNECT(__prefix_name, _rng_t) *rng_ptr) \
82 __VSF_HAL_TEMPLATE_API(__prefix_name, void, rng, fini, VSF_MCONNECT(__prefix_name, _rng_t) *rng_ptr) \
83 __VSF_HAL_TEMPLATE_API(__prefix_name, vsf_rng_capability_t, rng, capability, VSF_MCONNECT(__prefix_name, _rng_t) *rng_ptr) \
84 __VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, rng, generate_request, VSF_MCONNECT(__prefix_name, _rng_t) *rng_ptr, \
85 uint32_t *buffer, uint32_t num, void *param, vsf_rng_on_ready_callback_t * on_ready_cb)
93#if VSF_RNG_CFG_INHERT_HAL_CAPABILITY == ENABLED
99#undef __VSF_HAL_TEMPLATE_API
100#define __VSF_HAL_TEMPLATE_API VSF_HAL_TEMPLATE_API_FP
105#if VSF_RNG_CFG_MULTI_CLASS == ENABLED
183#if VSF_RNG_CFG_FUNCTION_RENAME == ENABLED
184# define __vsf_rng_t VSF_MCONNECT(VSF_RNG_CFG_PREFIX, _rng_t)
185# define vsf_rng_init(__RNG, ...) VSF_MCONNECT(VSF_RNG_CFG_PREFIX, _rng_init) ((__vsf_rng_t *)(__RNG), ##__VA_ARGS__)
186# define vsf_rng_fini(__RNG) VSF_MCONNECT(VSF_RNG_CFG_PREFIX, _rng_fini) ((__vsf_rng_t *)(__RNG))
187# define vsf_rng_capability(__RNG) VSF_MCONNECT(VSF_RNG_CFG_PREFIX, _rng_capability) ((__vsf_rng_t *)(__RNG))
188# define vsf_rng_generate_request(__RNG, ...) VSF_MCONNECT(VSF_RNG_CFG_PREFIX, _rng_generate_request) ((__vsf_rng_t *)(__RNG), ##__VA_ARGS__)
vsf_err_t
Definition __type.h:42
unsigned int uint32_t
Definition lvgl.h:43
Definition vsf_template_hal_driver.h:203
Definition vsf_template_rng.h:92
Definition vsf_template_rng.h:98
Definition vsf_template_rng.h:106
const vsf_rng_op_t * op
Definition vsf_template_rng.h:107
void vsf_rng_on_ready_callback_t(void *param, uint32_t *buffer, uint32_t num)
Definition vsf_template_rng.h:90
#define VSF_RNG_APIS(__prefix_name)
Definition vsf_template_rng.h:80
#define vsf_rng_fini(__RNG)
Definition vsf_template_rng.h:186
#define vsf_rng_capability(__RNG)
Definition vsf_template_rng.h:187
#define vsf_rng_init(__RNG,...)
Definition vsf_template_rng.h:185
#define vsf_rng_generate_request(__RNG,...)
Definition vsf_template_rng.h:188