API to use ADC (Analog to Digital Converter) on exxotest devices.
More...
enum | AGHAF_ADC_Event { AGHAF_ADC_EVENT_NONE
, AGHAF_ADC_EVENT_TRIGGER
, AGHAF_ADC_EVENT_STANDARD
} |
| Possible event reporting. More...
|
|
enum | AGHAF_ADC_TriggerSlope { AGHAF_ADC_TRIG_SLOPE_RISING = 0
, AGHAF_ADC_TRIG_SLOPE_FALLING = 1
} |
| Trigger slope. More...
|
|
enum | AGHAF_ADC_TriggerState { AGHAF_ADC_TRIG_STATE_NONE = 0
, AGHAF_ADC_TRIG_STATE_LOW
, AGHAF_ADC_TRIG_STATE_HIGH
} |
| Trigger state. More...
|
|
enum | AGHAF_ADC_Param {
AGHAF_ADC_PARAM_EVENT
, AGHAF_ADC_PARAM_PERIOD
, AGHAF_ADC_PARAM_TRIGGER_INIT_SLOPE
, AGHAF_ADC_PARAM_TRIGGER_LOW_THRESHOLD
,
AGHAF_ADC_PARAM_TRIGGER_HIGH_THRESHOLD
} |
| List of parameters used to configure an ADC bus. More...
|
|
typedef void * | AGHAF_ADC |
| handle on a ADC
|
|
typedef void(* | AGHAF_ADC_onConversion) (uint64_t timestamp, int32_t value, AGHAF_ADC_TriggerState state, void *userContext) |
| callback called on a ADC event More...
|
|
void | AGHAF_ADC_setOnConversionCallback (AGHAF_ADC adc, AGHAF_ADC_onConversion callback, void *userContext) |
| Set the callback called on a ADC event. More...
|
|
AGHAF_ADC | AGHAF_ADC_get (AGHAF_Device device, uint8_t index) |
| return the KLine bus at the index specified More...
|
|
uint8_t | AGHAF_ADC_getIndex (AGHAF_ADC adc) |
| return the index from an ADC More...
|
|
uint8_t | AGHAF_ADC_getCount (AGHAF_Device device) |
| return the number of Adcs available on a device More...
|
|
AGHAF_Status | AGHAF_ADC_activate (AGHAF_ADC adc) |
| start the communication with the ADC More...
|
|
AGHAF_Status | AGHAF_ADC_deactivate (AGHAF_ADC adc) |
| stop the communication with the ADC More...
|
|
AGHAF_Status | AGHAF_ADC_isActivated (AGHAF_ADC adc, AGHAF_BOOL *isActivated) |
| allow to know if the communication on the ADC is started or not More...
|
|
AGHAF_Status | AGHAF_ADC_getParam (AGHAF_ADC adc, AGHAF_ADC_Param param, uint32_t *value) |
| get a parameter from a ADC More...
|
|
AGHAF_Status | AGHAF_ADC_setParam (AGHAF_ADC adc, AGHAF_ADC_Param param, uint32_t value) |
| set a parameter from a ADC More...
|
|
AGHAF_Status | AGHAF_ADC_getLastConversion (AGHAF_ADC adc, int32_t *value, AGHAF_ADC_TriggerState *triggerState) |
| Return the current state from the ADC trigger. More...
|
|
API to use ADC (Analog to Digital Converter) on exxotest devices.
Usage Example
Call order and priority
Device is in "init" state at startup.
The following section describes state management:
Symbol | Description |
| Forbidden |
| Authorized |
| Followed status |
◆ AGHAF_ADC_onConversion
typedef void(* AGHAF_ADC_onConversion) (uint64_t timestamp, int32_t value, AGHAF_ADC_TriggerState state, void *userContext) |
callback called on a ADC event
- Parameters
-
timestamp | timestamp of the event |
value | value in mV from the ADC |
state | state from the trigger: AGHAF_ADC_TriggerState |
userContext | context given when setting the callabck in the system |
◆ AGHAF_ADC_Event
Possible event reporting.
Enumerator |
---|
AGHAF_ADC_EVENT_NONE | Disable ADC events reporting. This will reduce the load on the USB bus if you don't need these events. Use function to read the last conversion value.
|
AGHAF_ADC_EVENT_TRIGGER | Reports conversion values only when a trigger has occurred.
|
AGHAF_ADC_EVENT_STANDARD | Reports conversion values at the configured period.
|
◆ AGHAF_ADC_Param
List of parameters used to configure an ADC bus.
Enumerator |
---|
AGHAF_ADC_PARAM_EVENT | Configure ADC events reporting.
Use: AGHAF_ADC_Event
Default: AGHAF_ADC_EVENT_STANDARD
|
AGHAF_ADC_PARAM_PERIOD | Defines the period at which conversion values are reported and/or the interval at which the trigger threshold is tested.
Min: 1 ms
Max: 60000 ms
Default: 1000 ms
|
AGHAF_ADC_PARAM_TRIGGER_INIT_SLOPE | Configures the initial trigger slope.\nThe slope will be inverted after each trigger.
Min: AGHAF_ADC_TriggerSlope
Default: AGHAF_ADC_TRIG_SLOPE_RISING
|
AGHAF_ADC_PARAM_TRIGGER_LOW_THRESHOLD | Sets the low trigger threshold.
Min: 0 mV
Max: 36000 mV
Default: 11000 mV
|
AGHAF_ADC_PARAM_TRIGGER_HIGH_THRESHOLD | Sets the high trigger threshold.
Min: 0 mV
Max: 36000 mV
Default: 12000 mV
|
◆ AGHAF_ADC_TriggerSlope
Trigger slope.
Enumerator |
---|
AGHAF_ADC_TRIG_SLOPE_RISING | The conversion value must be above the high threshold to cause a trigger.
|
AGHAF_ADC_TRIG_SLOPE_FALLING | The conversion value must be below the low threshold to cause a trigger.
|
◆ AGHAF_ADC_TriggerState
Trigger state.
Enumerator |
---|
AGHAF_ADC_TRIG_STATE_NONE | No triggering occurred.
|
AGHAF_ADC_TRIG_STATE_LOW | The conversion value has gone below the low threshold.
|
AGHAF_ADC_TRIG_STATE_HIGH | The conversion value has gone above the high threshold.
|
◆ AGHAF_ADC_activate()
start the communication with the ADC
- Parameters
-
- Returns
- status request information
- Examples
- ADC/main.cpp.
◆ AGHAF_ADC_deactivate()
stop the communication with the ADC
- Parameters
-
- Returns
- status request information
- Examples
- ADC/main.cpp.
◆ AGHAF_ADC_get()
return the KLine bus at the index specified
- Parameters
-
device | handle on the device |
index | index from the ADC |
- Returns
- handle on the uart (NULL if index invalid)
- Examples
- ADC/main.cpp.
◆ AGHAF_ADC_getCount()
return the number of Adcs available on a device
- Parameters
-
device | handle on the device |
- Returns
- number of ADCs available
- Examples
- ADC/main.cpp.
◆ AGHAF_ADC_getIndex()
return the index from an ADC
- Parameters
-
- Returns
- index from the ADC
◆ AGHAF_ADC_getLastConversion()
Return the current state from the ADC trigger.
- Parameters
-
adc | handle on the ADC |
value | pointer to fill the current conversion value in mV |
triggerState | pointer to fill the current trigger state |
- Returns
- request information
- Examples
- ADC/main.cpp.
◆ AGHAF_ADC_getParam()
get a parameter from a ADC
- Parameters
-
adc | handle on the ADC |
param | parameter to get |
value | value to get |
- Returns
- status request information
◆ AGHAF_ADC_isActivated()
allow to know if the communication on the ADC is started or not
- Parameters
-
adc | handle on the ADC |
isActivated | boolean to know if the communication is started or not |
- Returns
- status request information
◆ AGHAF_ADC_setOnConversionCallback()
Set the callback called on a ADC event.
- Parameters
-
adc | handle on the ADC |
callback | callback to be used for the event |
userContext | context provided by the user for custom datas |
- Examples
- ADC/main.cpp.
◆ AGHAF_ADC_setParam()
set a parameter from a ADC
- Parameters
-
adc | handle on the ADC |
param | parameter to set |
value | value to set |
- Returns
- status request information