|
Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
|
Infineon AutAnalog SAR ADC extended API. More...
Typedefs | |
| typedef void(* | adc_ifx_autanalog_sar_fifo_callback_t) (const struct device *dev, uint32_t fifo_status, void *user_data) |
| FIFO watermark interrupt callback type. | |
Functions | |
| int | adc_ifx_autanalog_sar_fir_read_result (const struct device *dev, uint8_t fir_idx, int32_t *result) |
| Read the FIR filter output result. | |
| int | adc_ifx_autanalog_sar_fir_get_limit_status (const struct device *dev, uint8_t fir_idx, uint8_t *status) |
| Get the FIR range-detection (limit) status bitmap. | |
| int | adc_ifx_autanalog_sar_fir_clear_limit_status (const struct device *dev, uint8_t fir_idx) |
| Clear FIR range-detection (limit) status bits. | |
| int | adc_ifx_autanalog_sar_fir_load_coefficients (const struct device *dev, uint8_t fir_idx, const int16_t *coefficients, uint8_t num_coefficients) |
| Load FIR filter coefficients at runtime. | |
| int | adc_ifx_autanalog_sar_fifo_read (const struct device *dev, uint8_t buf_idx, int32_t *data_out, uint16_t max_words) |
| Read data from a FIFO buffer. | |
| int | adc_ifx_autanalog_sar_fifo_read_all (const struct device *dev, uint8_t buf_idx, int32_t *data_out) |
| Read all data from a FIFO buffer. | |
| int | adc_ifx_autanalog_sar_fifo_read_chan_id (const struct device *dev, uint8_t buf_idx, uint8_t input, int32_t *data_out, uint8_t *chan_id_out) |
| Read data and channel IDs from a FIFO buffer. | |
| int | adc_ifx_autanalog_sar_fifo_get_size (const struct device *dev, uint8_t buf_idx, uint16_t *size) |
| Get the current fill level of a FIFO buffer. | |
| int | adc_ifx_autanalog_sar_fifo_set_callback (const struct device *dev, adc_ifx_autanalog_sar_fifo_callback_t callback, void *user_data) |
| Register a callback for FIFO watermark interrupts. | |
Infineon AutAnalog SAR ADC extended API.
| typedef void(* adc_ifx_autanalog_sar_fifo_callback_t) (const struct device *dev, uint32_t fifo_status, void *user_data) |
#include <zephyr/drivers/adc/infineon_autanalog_sar.h>
FIFO watermark interrupt callback type.
Called from ISR context when a FIFO watermark interrupt fires.
| dev | ADC device. |
| fifo_status | FIFO interrupt status bitmask (CY_AUTANALOG_INT_FIFO_*). |
| user_data | User data passed to adc_ifx_autanalog_sar_fifo_set_callback(). |
| int adc_ifx_autanalog_sar_fifo_get_size | ( | const struct device * | dev, |
| uint8_t | buf_idx, | ||
| uint16_t * | size ) |
#include <zephyr/drivers/adc/infineon_autanalog_sar.h>
Get the current fill level of a FIFO buffer.
Returns the number of data words currently stored in the specified FIFO buffer.
| dev | ADC device (infineon,autanalog-sar-adc instance). |
| buf_idx | FIFO buffer index (0 to 7, depending on split config). |
| size | Pointer to store the number of words in the buffer. |
| 0 | on success. |
| -EINVAL | if parameters are invalid. |
| int adc_ifx_autanalog_sar_fifo_read | ( | const struct device * | dev, |
| uint8_t | buf_idx, | ||
| int32_t * | data_out, | ||
| uint16_t | max_words ) |
#include <zephyr/drivers/adc/infineon_autanalog_sar.h>
Read data from a FIFO buffer.
Reads up to max_words conversion results from the specified FIFO buffer.
| dev | ADC device (infineon,autanalog-sar-adc instance). |
| buf_idx | FIFO buffer index (0 to 7, depending on split config). |
| data_out | Pointer to the output buffer for 32-bit signed results. |
| max_words | Maximum number of words to read. |
| >=0 | Number of words actually read. |
| -EINVAL | if parameters are invalid. |
| int adc_ifx_autanalog_sar_fifo_read_all | ( | const struct device * | dev, |
| uint8_t | buf_idx, | ||
| int32_t * | data_out ) |
#include <zephyr/drivers/adc/infineon_autanalog_sar.h>
Read all data from a FIFO buffer.
Drains the entire contents of the specified FIFO buffer into the output array. The caller must ensure that data_out is large enough to hold the maximum buffer size (determined by the FIFO split configuration).
| dev | ADC device (infineon,autanalog-sar-adc instance). |
| buf_idx | FIFO buffer index (0 to 7, depending on split config). |
| data_out | Pointer to the output buffer for 32-bit signed results. |
| >=0 | Number of words actually read. |
| -EINVAL | if parameters are invalid. |
| int adc_ifx_autanalog_sar_fifo_read_chan_id | ( | const struct device * | dev, |
| uint8_t | buf_idx, | ||
| uint8_t | input, | ||
| int32_t * | data_out, | ||
| uint8_t * | chan_id_out ) |
#include <zephyr/drivers/adc/infineon_autanalog_sar.h>
Read data and channel IDs from a FIFO buffer.
Reads all data from the specified FIFO buffer together with the associated channel identifiers. The fifo-chan-id property must be enabled on the parent SAR ADC node for channel IDs to be present in the FIFO data.
| dev | ADC device (infineon,autanalog-sar-adc instance). |
| buf_idx | FIFO buffer index (0 to 7, depending on split config). |
| input | ADC input type (0 = GPIO, 1 = MUX) for channel ID decoding. |
| data_out | Pointer to the output buffer for 32-bit signed results. |
| chan_id_out | Pointer to the output buffer for channel ID values. |
| >=0 | Number of words actually read. |
| -EINVAL | if parameters are invalid. |
| int adc_ifx_autanalog_sar_fifo_set_callback | ( | const struct device * | dev, |
| adc_ifx_autanalog_sar_fifo_callback_t | callback, | ||
| void * | user_data ) |
#include <zephyr/drivers/adc/infineon_autanalog_sar.h>
Register a callback for FIFO watermark interrupts.
When a FIFO buffer fill level reaches its configured threshold, the registered callback is invoked from ISR context with the FIFO interrupt status bitmask.
| dev | ADC device (infineon,autanalog-sar-adc instance). |
| callback | Callback function, or NULL to unregister. |
| user_data | Opaque pointer passed to the callback. |
| 0 | on success. |
#include <zephyr/drivers/adc/infineon_autanalog_sar.h>
Clear FIR range-detection (limit) status bits.
| dev | ADC device (infineon,autanalog-sar-adc instance). |
| fir_idx | FIR filter index (0 or 1). |
| 0 | on success. |
| -EINVAL | if fir_idx is invalid. |
| int adc_ifx_autanalog_sar_fir_get_limit_status | ( | const struct device * | dev, |
| uint8_t | fir_idx, | ||
| uint8_t * | status ) |
#include <zephyr/drivers/adc/infineon_autanalog_sar.h>
Get the FIR range-detection (limit) status bitmap.
Returns a bitmask indicating which FIR filters have triggered their range-detection condition. Bit 0 corresponds to FIR 0, bit 1 to FIR 1.
| dev | ADC device (infineon,autanalog-sar-adc instance). |
| fir_idx | FIR filter index (0 or 1). |
| status | Pointer to the returned status bitmask. |
| 0 | on success. |
| -EINVAL | if parameters are invalid. |
| int adc_ifx_autanalog_sar_fir_load_coefficients | ( | const struct device * | dev, |
| uint8_t | fir_idx, | ||
| const int16_t * | coefficients, | ||
| uint8_t | num_coefficients ) |
#include <zephyr/drivers/adc/infineon_autanalog_sar.h>
Load FIR filter coefficients at runtime.
Replaces the coefficient set for the specified FIR filter. The FIR filter must have been configured during initialization via the devicetree binding.
| dev | ADC device (infineon,autanalog-sar-adc instance). |
| fir_idx | FIR filter index (0 or 1). |
| coefficients | Pointer to the coefficient array (Q1.15 format). |
| num_coefficients | Number of coefficients (1 to 64). |
| 0 | on success. |
| -EINVAL | if parameters are invalid. |
| -EIO | if the PDL operation failed. |
| int adc_ifx_autanalog_sar_fir_read_result | ( | const struct device * | dev, |
| uint8_t | fir_idx, | ||
| int32_t * | result ) |
#include <zephyr/drivers/adc/infineon_autanalog_sar.h>
Read the FIR filter output result.
| dev | ADC device (infineon,autanalog-sar-adc instance). |
| fir_idx | FIR filter index (0 or 1). |
| result | Pointer to store the 32-bit signed FIR output value. |
| 0 | on success. |
| -EINVAL | if parameters are invalid. |
| -EBUSY | if no FIR result is available yet. |