AGHAF 4.5.7
Annecy electronique Generic Hardware Access Framework
|
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 | |
void | AGHAF_ADC_setOnConversionCallback (AGHAF_ADC adc, AGHAF_ADC_onConversion callback, void *userContext) |
Set the callback called on a ADC event. | |
AGHAF_ADC | AGHAF_ADC_get (AGHAF_Device device, uint8_t index) |
return the KLine bus at the index specified | |
uint8_t | AGHAF_ADC_getIndex (AGHAF_ADC adc) |
return the index from an ADC | |
uint8_t | AGHAF_ADC_getCount (AGHAF_Device device) |
return the number of Adcs available on a device | |
AGHAF_Status | AGHAF_ADC_activate (AGHAF_ADC adc) |
start the communication with the ADC | |
AGHAF_Status | AGHAF_ADC_deactivate (AGHAF_ADC adc) |
stop the communication with the ADC | |
AGHAF_Status | AGHAF_ADC_isActivated (AGHAF_ADC adc, AGHAF_BOOL *isActivated) |
allow to know if the communication on the ADC is started or not | |
AGHAF_Status | AGHAF_ADC_getParam (AGHAF_ADC adc, AGHAF_ADC_Param param, uint32_t *value) |
get a parameter from a ADC | |
AGHAF_Status | AGHAF_ADC_setParam (AGHAF_ADC adc, AGHAF_ADC_Param param, uint32_t value) |
set a parameter from a ADC | |
AGHAF_Status | AGHAF_ADC_getLastConversion (AGHAF_ADC adc, int32_t *value, AGHAF_ADC_TriggerState *triggerState) |
Return the current state from the ADC trigger. | |
API to use ADC (Analog to Digital Converter) on exxotest devices.
Device is in "init" state at startup.
The following section describes state management:
Symbol | Description |
---|---|
![]() | Forbidden |
![]() | Authorized |
![]() | Followed status |
Function | Config | Active |
---|---|---|
AGHAF_ADC_setOnConversionCallback | ![]() | ![]() |
AGHAF_ADC_get | ![]() | ![]() |
AGHAF_ADC_getIndex | ![]() | ![]() |
AGHAF_ADC_getCount | ![]() | ![]() |
AGHAF_ADC_activate | ![]() | ![]() |
AGHAF_ADC_deactivate | ![]() | ![]() |
AGHAF_ADC_isActivated | ![]() | ![]() |
AGHAF_ADC_getParam | ![]() | ![]() |
AGHAF_ADC_setParam | ![]() | ![]() |
AGHAF_ADC_getLastConversion | ![]() | image html snok.png |
typedef void(* AGHAF_ADC_onConversion) (uint64_t timestamp, int32_t value, AGHAF_ADC_TriggerState state, void *userContext) |
callback called on a ADC event
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 |
enum AGHAF_ADC_Event |
Possible event reporting.
enum AGHAF_ADC_Param |
List of parameters used to configure an ADC bus.
Enumerator | |
---|---|
AGHAF_ADC_PARAM_EVENT | Configure ADC events reporting. |
AGHAF_ADC_PARAM_PERIOD | Defines the period at which conversion values are reported and/or the interval at which the trigger threshold is tested. |
AGHAF_ADC_PARAM_TRIGGER_INIT_SLOPE | Configures the initial trigger slope.\nThe slope will be inverted after each trigger. |
AGHAF_ADC_PARAM_TRIGGER_LOW_THRESHOLD | Sets the low trigger threshold. |
AGHAF_ADC_PARAM_TRIGGER_HIGH_THRESHOLD | Sets the high trigger threshold. |
AGHAF_Status AGHAF_ADC_activate | ( | AGHAF_ADC | adc | ) |
start the communication with the ADC
adc | handle on the ADC |
AGHAF_Status AGHAF_ADC_deactivate | ( | AGHAF_ADC | adc | ) |
stop the communication with the ADC
adc | handle on the ADC |
AGHAF_ADC AGHAF_ADC_get | ( | AGHAF_Device | device, |
uint8_t | index | ||
) |
return the KLine bus at the index specified
device | handle on the device |
index | index from the ADC |
uint8_t AGHAF_ADC_getCount | ( | AGHAF_Device | device | ) |
return the number of Adcs available on a device
device | handle on the device |
uint8_t AGHAF_ADC_getIndex | ( | AGHAF_ADC | adc | ) |
return the index from an ADC
adc | handle on the ADC |
AGHAF_Status AGHAF_ADC_getLastConversion | ( | AGHAF_ADC | adc, |
int32_t * | value, | ||
AGHAF_ADC_TriggerState * | triggerState | ||
) |
Return the current state from the ADC trigger.
adc | handle on the ADC |
value | pointer to fill the current conversion value in mV |
triggerState | pointer to fill the current trigger state |
AGHAF_Status AGHAF_ADC_getParam | ( | AGHAF_ADC | adc, |
AGHAF_ADC_Param | param, | ||
uint32_t * | value | ||
) |
get a parameter from a ADC
adc | handle on the ADC |
param | parameter to get |
value | value to get |
AGHAF_Status AGHAF_ADC_isActivated | ( | AGHAF_ADC | adc, |
AGHAF_BOOL * | isActivated | ||
) |
allow to know if the communication on the ADC is started or not
adc | handle on the ADC |
isActivated | boolean to know if the communication is started or not |
void AGHAF_ADC_setOnConversionCallback | ( | AGHAF_ADC | adc, |
AGHAF_ADC_onConversion | callback, | ||
void * | userContext | ||
) |
Set the callback called on a ADC event.
adc | handle on the ADC |
callback | callback to be used for the event |
userContext | context provided by the user for custom datas |
AGHAF_Status AGHAF_ADC_setParam | ( | AGHAF_ADC | adc, |
AGHAF_ADC_Param | param, | ||
uint32_t | value | ||
) |
set a parameter from a ADC
adc | handle on the ADC |
param | parameter to set |
value | value to set |