VSF Documented
|
Go to the source code of this file.
Data Structures | |
struct | vsf_adc_channel_cfg_t |
adc channel configuration More... | |
struct | vsf_adc_isr_t |
adc isr for api More... | |
struct | vsf_adc_cfg_t |
Configuration structure for ADC. More... | |
struct | vsf_adc_status_t |
Predefined VSF ADC status that can be reimplemented in specific HAL drivers. More... | |
struct | vsf_adc_capability_t |
Predefined VSF ADC capability that can be reimplemented in specific HAL drivers. More... | |
struct | vsf_adc_op_t |
struct | vsf_adc_t |
Macros | |
#define | VSF_ADC_CFG_MULTI_CLASS ENABLED |
Enable multi-class support by default for maximum availability. | |
#define | VSF_ADC_CFG_PREFIX vsf |
Define ADC hardware mask if count is defined. | |
#define | VSF_ADC_CFG_FUNCTION_RENAME ENABLED |
Disable VSF_ADC_CFG_FUNCTION_RENAME to use the original function names (e.g., vsf_adc_init()). | |
#define | VSF_ADC_CFG_REIMPLEMENT_TYPE_MODE DISABLED |
Enable VSF_ADC_CFG_REIMPLEMENT_TYPE_MODE to reimplement mode type vsf_adc_mode_t in specific hardware drivers. | |
#define | VSF_ADC_CFG_REIMPLEMENT_TYPE_CHANNEL_MODE DISABLED |
Enable VSF_ADC_CFG_REIMPLEMENT_TYPE_CHANNEL_MODE to reimplement channel mode type vsf_adc_channel_mode_t in specific hardware drivers. | |
#define | VSF_ADC_CFG_REIMPLEMENT_TYPE_IRQ_MASK DISABLED |
Enable VSF_ADC_CFG_REIMPLEMENT_TYPE_IRQ_MASK to reimplement interrupt mask type vsf_adc_irq_mask_t in specific hardware drivers. | |
#define | VSF_ADC_CFG_REIMPLEMENT_TYPE_CHANNEL_CFG DISABLED |
Enable VSF_ADC_CFG_REIMPLEMENT_TYPE_CHANNEL_CFG to reimplement channel configuration type vsf_adc_channel_cfg_t in specific hardware drivers For compatibility, do not delete members when redefining vsf_adc_channel_cfg_t. | |
#define | VSF_ADC_CFG_REIMPLEMENT_TYPE_CFG DISABLED |
Enable VSF_ADC_CFG_REIMPLEMENT_TYPE_CFG to reimplement ADC configuration type vsf_adc_cfg_t in specific hardware drivers For compatibility, do not delete members when redefining vsf_adc_cfg_t The vsf_adc_isr_handler_t type also needs to be redefined. | |
#define | VSF_ADC_CFG_REIMPLEMENT_TYPE_CAPABILITY DISABLED |
Enable the option to reimplement capability type. For compatibility, do not delete members when redefining vsf_adc_capability_t. | |
#define | VSF_ADC_CFG_INHERIT_HAL_CAPABILITY ENABLED |
In specific hardware driver, we can enable macro VSF_ADC_CFG_INHERIT_HAL_CAPABILITY to inherit structure vsf_peripheral_capability_t. | |
#define | VSF_ADC_APIS(__PREFIX_NAME) |
ADC API template, used to generate ADC type, specific prefix function declarations, etc. | |
Typedefs | |
typedef enum vsf_adc_mode_t | vsf_adc_mode_t |
Predefined VSF ADC modes that can be reimplemented in specific HAL drivers. | |
typedef enum vsf_adc_channel_mode_t | vsf_adc_channel_mode_t |
Predefined VSF ADC channel modes that can be reimplemented in specific HAL drivers. | |
typedef enum vsf_adc_irq_mask_t | vsf_adc_irq_mask_t |
Predefined VSF ADC interrupt that can be reimplemented in specific HAL drivers. | |
typedef struct vsf_adc_channel_cfg_t | vsf_adc_channel_cfg_t |
adc channel configuration | |
typedef struct vsf_adc_t | vsf_adc_t |
typedef void | vsf_adc_isr_handler_t(void *target_ptr, vsf_adc_t *adc_ptr, vsf_adc_irq_mask_t irq_mask) |
typedef struct vsf_adc_isr_t | vsf_adc_isr_t |
adc isr for api | |
typedef struct vsf_adc_cfg_t | vsf_adc_cfg_t |
Configuration structure for ADC. | |
typedef struct vsf_adc_status_t | vsf_adc_status_t |
Predefined VSF ADC status that can be reimplemented in specific HAL drivers. | |
typedef struct vsf_adc_capability_t | vsf_adc_capability_t |
Predefined VSF ADC capability that can be reimplemented in specific HAL drivers. | |
typedef struct vsf_adc_op_t | vsf_adc_op_t |
Functions | |
vsf_err_t | vsf_adc_init (vsf_adc_t *adc_ptr, vsf_adc_cfg_t *cfg_ptr) |
Initialize an ADC instance. | |
void | vsf_adc_fini (vsf_adc_t *adc_ptr) |
Finalize an ADC instance. | |
fsm_rt_t | vsf_adc_enable (vsf_adc_t *adc_ptr) |
Enable an ADC instance. | |
fsm_rt_t | vsf_adc_disable (vsf_adc_t *adc_ptr) |
Disable an ADC instance. | |
void | vsf_adc_irq_enable (vsf_adc_t *adc_ptr, vsf_adc_irq_mask_t irq_mask) |
Enable interrupt masks of ADC instance. | |
void | vsf_adc_irq_disable (vsf_adc_t *adc_ptr, vsf_adc_irq_mask_t irq_mask) |
Disable interrupt masks of ADC instance. | |
vsf_adc_status_t | vsf_adc_status (vsf_adc_t *adc_ptr) |
Get the status of ADC instance. | |
vsf_adc_capability_t | vsf_adc_capability (vsf_adc_t *adc_ptr) |
Get the capability of ADC instance. | |
vsf_err_t | vsf_adc_channel_request_once (vsf_adc_t *adc_ptr, vsf_adc_channel_cfg_t *channel_cfg, void *buffer_ptr) |
ADC request sampling once. | |
vsf_err_t | vsf_adc_channel_config (vsf_adc_t *adc_ptr, vsf_adc_channel_cfg_t *cfgs_ptr, uint32_t cnt) |
ADC channel configuration. | |
vsf_err_t | vsf_adc_channel_request (vsf_adc_t *adc_ptr, void *buffer_ptr, uint_fast32_t count) |
ADC channel request. | |
#define VSF_ADC_CFG_MULTI_CLASS ENABLED |
Enable multi-class support by default for maximum availability.
#define VSF_ADC_CFG_PREFIX vsf |
Define ADC hardware mask if count is defined.
Define ADC hardware count if mask is defined
We can redefine macro VSF_ADC_CFG_PREFIX to specify a prefix to call a specific driver directly in the application code.
#define VSF_ADC_CFG_FUNCTION_RENAME ENABLED |
Disable VSF_ADC_CFG_FUNCTION_RENAME to use the original function names (e.g., vsf_adc_init()).
#define VSF_ADC_CFG_REIMPLEMENT_TYPE_MODE DISABLED |
Enable VSF_ADC_CFG_REIMPLEMENT_TYPE_MODE to reimplement mode type vsf_adc_mode_t in specific hardware drivers.
#define VSF_ADC_CFG_REIMPLEMENT_TYPE_CHANNEL_MODE DISABLED |
Enable VSF_ADC_CFG_REIMPLEMENT_TYPE_CHANNEL_MODE to reimplement channel mode type vsf_adc_channel_mode_t in specific hardware drivers.
#define VSF_ADC_CFG_REIMPLEMENT_TYPE_IRQ_MASK DISABLED |
Enable VSF_ADC_CFG_REIMPLEMENT_TYPE_IRQ_MASK to reimplement interrupt mask type vsf_adc_irq_mask_t in specific hardware drivers.
#define VSF_ADC_CFG_REIMPLEMENT_TYPE_CHANNEL_CFG DISABLED |
Enable VSF_ADC_CFG_REIMPLEMENT_TYPE_CHANNEL_CFG to reimplement channel configuration type vsf_adc_channel_cfg_t in specific hardware drivers For compatibility, do not delete members when redefining vsf_adc_channel_cfg_t.
#define VSF_ADC_CFG_REIMPLEMENT_TYPE_CFG DISABLED |
Enable VSF_ADC_CFG_REIMPLEMENT_TYPE_CFG to reimplement ADC configuration type vsf_adc_cfg_t in specific hardware drivers For compatibility, do not delete members when redefining vsf_adc_cfg_t The vsf_adc_isr_handler_t type also needs to be redefined.
#define VSF_ADC_CFG_REIMPLEMENT_TYPE_CAPABILITY DISABLED |
Enable the option to reimplement capability type. For compatibility, do not delete members when redefining vsf_adc_capability_t.
#define VSF_ADC_CFG_INHERIT_HAL_CAPABILITY ENABLED |
In specific hardware driver, we can enable macro VSF_ADC_CFG_INHERIT_HAL_CAPABILITY to inherit structure vsf_peripheral_capability_t.
#define VSF_ADC_APIS | ( | __PREFIX_NAME | ) |
ADC API template, used to generate ADC type, specific prefix function declarations, etc.
[in] | __PREFIX_NAME | The prefix used for generating ADC functions. |
typedef enum vsf_adc_mode_t vsf_adc_mode_t |
Predefined VSF ADC modes that can be reimplemented in specific HAL drivers.
Even if the hardware doesn't support these modes, the following modes must be kept, If the hardware supports more modes, e.g. more reference voltage, more data alignment, we can implement it in the hardware driver:
If more new modes are added to the driver, then the corresponding MASK macros need to be defined to include the values of the new modes. For example, Adding the new reference voltage option requires that the macro VSF_ADC_REF_VDD_MASK be defined.
Optional mode require one or more enumeration options and a macro with the same name to determine if they are supported at runtime. If the feature supports more than one option, it is recommended to provide the corresponding MASK option, so that the user can switch to different modes at compile-time.
typedef enum vsf_adc_channel_mode_t vsf_adc_channel_mode_t |
Predefined VSF ADC channel modes that can be reimplemented in specific HAL drivers.
Even if the hardware doesn't support these modes, the following modes must be kept, If the hardware supports more modes, e.g. more gain, more reference voltage, we can implement it in the hardware driver:
If more new modes are added to the driver, then the corresponding MASK macros need to be defined to include the values of the new modes. For example, Adding the new gain option requires that the macro VSF_ADC_CHANNEL_GAIN_MASK be defined.
Optional mode require one or more enumeration options and a macro with the same name to determine if they are supported at runtime. If the feature supports more than one option, it is recommended to provide the corresponding MASK option, so that the user can switch to different modes at compile-time.
typedef enum vsf_adc_irq_mask_t vsf_adc_irq_mask_t |
Predefined VSF ADC interrupt that can be reimplemented in specific HAL drivers.
Even if the hardware doesn't support these features, these interrupt must be kept.
Optional interrupt require one or more enumeration options and a macro with the same, so that the user can check if the interrupt is supported at compile-time.
typedef struct vsf_adc_channel_cfg_t vsf_adc_channel_cfg_t |
adc channel configuration
Configuration structure for ADC channel.
typedef void vsf_adc_isr_handler_t(void *target_ptr, vsf_adc_t *adc_ptr, vsf_adc_irq_mask_t irq_mask) |
typedef struct vsf_adc_isr_t vsf_adc_isr_t |
adc isr for api
typedef struct vsf_adc_cfg_t vsf_adc_cfg_t |
Configuration structure for ADC.
typedef struct vsf_adc_status_t vsf_adc_status_t |
Predefined VSF ADC status that can be reimplemented in specific HAL drivers.
Even if the hardware doesn't support these features, these status must be kept.
typedef struct vsf_adc_capability_t vsf_adc_capability_t |
Predefined VSF ADC capability that can be reimplemented in specific HAL drivers.
Even if the hardware doesn't support these features, these capabilities must be kept.
typedef struct vsf_adc_op_t vsf_adc_op_t |
enum vsf_adc_mode_t |
Predefined VSF ADC modes that can be reimplemented in specific HAL drivers.
Even if the hardware doesn't support these modes, the following modes must be kept, If the hardware supports more modes, e.g. more reference voltage, more data alignment, we can implement it in the hardware driver:
If more new modes are added to the driver, then the corresponding MASK macros need to be defined to include the values of the new modes. For example, Adding the new reference voltage option requires that the macro VSF_ADC_REF_VDD_MASK be defined.
Optional mode require one or more enumeration options and a macro with the same name to determine if they are supported at runtime. If the feature supports more than one option, it is recommended to provide the corresponding MASK option, so that the user can switch to different modes at compile-time.
anonymous enum |
Predefined VSF ADC channel modes that can be reimplemented in specific HAL drivers.
Even if the hardware doesn't support these modes, the following modes must be kept, If the hardware supports more modes, e.g. more gain, more reference voltage, we can implement it in the hardware driver:
If more new modes are added to the driver, then the corresponding MASK macros need to be defined to include the values of the new modes. For example, Adding the new gain option requires that the macro VSF_ADC_CHANNEL_GAIN_MASK be defined.
Optional mode require one or more enumeration options and a macro with the same name to determine if they are supported at runtime. If the feature supports more than one option, it is recommended to provide the corresponding MASK option, so that the user can switch to different modes at compile-time.
anonymous enum |
enum vsf_adc_irq_mask_t |
Predefined VSF ADC interrupt that can be reimplemented in specific HAL drivers.
Even if the hardware doesn't support these features, these interrupt must be kept.
Optional interrupt require one or more enumeration options and a macro with the same, so that the user can check if the interrupt is supported at compile-time.
Enumerator | |
---|---|
VSF_ADC_IRQ_MASK_CPL | Conversion complete interrupt. |
|
extern |
Initialize an ADC instance.
[in] | adc_ptr | a pointer to structure vsf_adc_t |
[in] | cfg_ptr | a pointer to structure vsf_adc_cfg_t |
|
extern |
Enable an ADC instance.
[in] | adc_ptr | a pointer to structure vsf_adc_t |
Disable an ADC instance.
[in] | adc_ptr | a pointer to structure vsf_adc_t |
|
extern |
Enable interrupt masks of ADC instance.
[in] | adc_ptr | a pointer to structure vsf_adc_t |
[in] | irq_mask | one or more values of enum vsf_adc_irq_mask_t |
|
extern |
Disable interrupt masks of ADC instance.
[in] | adc_ptr | a pointer to structure vsf_adc_t |
[in] | irq_mask | one or more values of enum vsf_adc_irq_mask_t |
|
extern |
Get the status of ADC instance.
[in] | adc_ptr | a pointer to structure vsf_adc_t |
|
extern |
Get the capability of ADC instance.
[in] | adc_ptr | a pointer to structure vsf_adc_t |
|
extern |
ADC request sampling once.
[in] | adc_ptr | a pointer to structure vsf_adc_t |
[in] | channel_cfg | a pointer to convert channel configuration |
[in] | buffer_ptr | value to be converted |
|
extern |
ADC channel configuration.
[in] | adc_ptr | a pointer to structure vsf_adc_t |
[in] | cfgs_ptr | convert channel configuration array |
[in] | cnt | the length of convert channel configuration array |
|
extern |
ADC channel request.
[in] | adc_ptr | a pointer to structure vsf_adc_t |
[out] | buffer_ptr | convert channel data array |
[in] | count | the length of convert channel configuration data array |