![]() |
libsigrok
0.5.2
sigrok hardware access and backend library
|
Conversion helper functions. More...
Include dependency graph for conversion.c:Go to the source code of this file.
Macros | |
| #define | LOG_PREFIX "conv" |
Functions | |
| int | sr_a2l_threshold (const struct sr_datafeed_analog *analog, float threshold, uint8_t *output, uint64_t count) |
| Convert analog values to logic values by using a fixed threshold. More... | |
| int | sr_a2l_schmitt_trigger (const struct sr_datafeed_analog *analog, float lo_thr, float hi_thr, uint8_t *state, uint8_t *output, uint64_t count) |
| Convert analog values to logic values by using a Schmitt-trigger algorithm. More... | |
Conversion helper functions.
Definition in file conversion.c.
| #define LOG_PREFIX "conv" |
Definition at line 29 of file conversion.c.
| int sr_a2l_schmitt_trigger | ( | const struct sr_datafeed_analog * | analog, |
| float | lo_thr, | ||
| float | hi_thr, | ||
| uint8_t * | state, | ||
| uint8_t * | output, | ||
| uint64_t | count | ||
| ) |
Convert analog values to logic values by using a Schmitt-trigger algorithm.
| analog | The analog input values. |
| lo_thr | The low threshold - result becomes 0 below it. |
| lo_thr | The high threshold - result becomes 1 above it. |
| state | The internal converter state. Must contain the state of logic sample n-1, will contain the state of logic sample n+count upon exit. |
| output | The converted output values; either 0 or 1. Must provide space for count bytes. |
| count | The number of samples to process. |
Definition at line 79 of file conversion.c.
References sr_datafeed_analog::data, sr_datafeed_analog::encoding, sr_analog_encoding::is_float, sr_analog_to_float(), SR_ERR, and SR_OK.
Here is the call graph for this function:| int sr_a2l_threshold | ( | const struct sr_datafeed_analog * | analog, |
| float | threshold, | ||
| uint8_t * | output, | ||
| uint64_t | count | ||
| ) |
Convert analog values to logic values by using a fixed threshold.
| [in] | analog | The analog input values. |
| [in] | threshold | The threshold to use. |
| [out] | output | The converted output values; either 0 or 1. Must provide space for count bytes. |
| [in] | count | The number of samples to process. |
Definition at line 42 of file conversion.c.
References sr_datafeed_analog::data, sr_datafeed_analog::encoding, sr_analog_encoding::is_float, sr_analog_to_float(), SR_ERR, and SR_OK.
Here is the call graph for this function:
1.8.10