AGHAF
4.5.5
Annecy electronique Generic Hardware Access Framework
|
API to use CAN on exxotest devices. More...
typedef void * | AGHAF_CAN |
handle on CAN | |
typedef void(* | AGHAF_CAN_onMessageTx) (uint64_t timestamp, uint32_t ident, uint8_t flags, uint16_t dataLen, uint8_t const *data, void *userContext) |
callback function called when a message is transmitted on a CAN More... | |
typedef void(* | AGHAF_CAN_onMessageRx) (uint64_t timestamp, uint32_t ident, uint8_t flags, uint16_t dataLen, uint8_t const *data, void *userContext) |
callback function called when a message is received on a CAN More... | |
typedef void(* | AGHAF_CAN_onError) (uint64_t timestamp, AGHAF_CAN_Error error, void *userContext) |
callback function called when an error happens on a CAN More... | |
typedef void(* | AGHAF_CAN_onBusChange) (uint64_t timestamp, uint8_t chipState, void *userContext) |
callback function called when a bus change happens on a CAN More... | |
typedef void(* | AGHAF_CAN_onBusLoad) (uint64_t timestamp, uint8_t chipState, uint8_t busLoad, AGHAF_CAN_Error error, void *userContext) |
callback function called when a bus laod is from a CAN is transmitted More... | |
void | AGHAF_CAN_v2_useAPI () |
Inform the library tu use the V2 CAN API. | |
void | AGHAF_CAN_v2_setOnMessageTxCallback (AGHAF_CAN can, AGHAF_CAN_onMessageTx callback, void *userContext) |
set the callback called on a tx event More... | |
void | AGHAF_CAN_v2_setOnMessageRxCallback (AGHAF_CAN can, AGHAF_CAN_onMessageRx callback, void *userContext) |
set the callback called on a rx event More... | |
void | AGHAF_CAN_v2_setOnErrorCallback (AGHAF_CAN can, AGHAF_CAN_onError callback, void *userContext) |
set the callback called on error event More... | |
void | AGHAF_CAN_v2_setOnBusChangeCallback (AGHAF_CAN can, AGHAF_CAN_onBusChange callback, void *userContext) |
set the callback called on a bus change event More... | |
void | AGHAF_CAN_v2_setOnBusLoadCallback (AGHAF_CAN can, AGHAF_CAN_onBusLoad callback, void *userContext) |
set the callback called on a bus noad event More... | |
AGHAF_CAN | AGHAF_CAN_v2_get (AGHAF_Device device, uint8_t index) |
return the CAN bus at index in parameter More... | |
uint8_t | AGHAF_CAN_v2_getIndex (AGHAF_CAN can) |
return the index from a CAN bus More... | |
uint8_t | AGHAF_CAN_v2_getCount (AGHAF_Device device) |
return the number of CAN bus from a device More... | |
AGHAF_Status | AGHAF_CAN_v2_activate (AGHAF_CAN can) |
activate a CAN bus More... | |
AGHAF_Status | AGHAF_CAN_v2_deactivate (AGHAF_CAN can) |
deactivate a CAN bus More... | |
AGHAF_Status | AGHAF_CAN_v2_isActivated (AGHAF_CAN can, AGHAF_BOOL *isActivated) |
Request if a CAN bus is yet activated or not. More... | |
AGHAF_Status | AGHAF_CAN_v2_getParam (AGHAF_CAN can, AGHAF_CAN_Param param, uint32_t *value) |
Provide the value from a CAN parameter. More... | |
AGHAF_Status | AGHAF_CAN_v2_setParam (AGHAF_CAN can, AGHAF_CAN_Param param, uint32_t value) |
Set the value from a CAN parameter. More... | |
AGHAF_Status | AGHAF_CAN_v2_supportedModes (AGHAF_CAN can, AGHAF_CAN_Mode **modes, uint8_t *nbModes) |
Request the supported modes from the CAN bus in parameter. More... | |
void | AGHAF_CAN_v2_freeSupportedModes (AGHAF_CAN_Mode *modes) |
Free the memory allocated with AGHAF_CAN_Bus_supportedModes. More... | |
AGHAF_Status | AGHAF_CAN_v2_getChipSstate (AGHAF_CAN can, AGHAF_CAN_ChipState *chipState) |
Return the chip state from the bus. More... | |
AGHAF_Status | AGHAF_CAN_v2_BusOn (AGHAF_CAN can) |
reactivate the bus after an error More... | |
AGHAF_Status | AGHAF_CAN_v2_supportedTerminations (AGHAF_CAN can, uint32_t **terminations, uint32_t *nbTerminations) |
Request the supported terminations from a CAN bus. More... | |
AGHAF_Status | AGHAF_CAN_v2_supportedTerminationsLs (AGHAF_CAN can, uint32_t **terminations, uint32_t *nbTerminations) |
Request the supported low speed terminations from a CAN bus. More... | |
void | AGHAF_CAN_v2_freeSupportedTerminations (uint32_t *terminations) |
Free the memory allocated with AGHAF_CAN_Bus_supportedTerminations or AGHAF_CAN_Bus_supportedTerminationsLs. More... | |
uint8_t | AGHAF_CAN_v2_Periodic_getCount (AGHAF_CAN can) |
Return the number of periodic message available on a CAN bus. More... | |
AGHAF_Status | AGHAF_CAN_v2_Periodic_send (AGHAF_CAN can, uint8_t frameDatalen, uint8_t const *const frameData, uint8_t frameFlags, uint32_t frameIdent, uint8_t index, uint8_t flags, uint32_t period) |
Add a periodic message to send. More... | |
AGHAF_Status | AGHAF_CAN_v2_addFilter (AGHAF_CAN can, AGHAF_CAN_FilterId idType, AGHAF_CAN_FILTER_Type type, AGHAF_CAN_FilterMode mode, uint32_t id1, uint32_t id2) |
add a filter to the CAN bus More... | |
AGHAF_Status | AGHAF_CAN_v2_clearFilters (AGHAF_CAN can) |
clear the filters from a bus More... | |
AGHAF_Status | AGHAF_CAN_v2_filtersCount (AGHAF_CAN can, AGHAF_CAN_FilterId idType, uint16_t *count) |
Provide the current number of filters. More... | |
AGHAF_Status | AGHAF_CAN_v2_supportedFilters (AGHAF_CAN can, uint16_t *globalFilterCaps, AGHAF_CAN_FilterDesc **values, uint16_t *size) |
Provide the supported filters from a CAN bus. More... | |
void | AGHAF_CAN_v2_freeSupportedFilters (AGHAF_CAN_FilterDesc *values) |
Free the memory allocated with AGHAF_CAN_Bus_supportedFilters. More... | |
AGHAF_Status | AGHAF_CAN_v2_reject (AGHAF_CAN can, AGHAF_CAN_RejectType rejectType, AGHAF_BOOL rtr) |
Set a global filter. More... | |
AGHAF_Status | AGHAF_CAN_v2_sendMessage (AGHAF_CAN can, uint32_t ident, uint8_t flags, uint16_t dataLen, uint8_t const *data) |
send data on a CAN bus More... | |
API to use CAN on exxotest devices.
Device is in "init" state at startup.
The following section describes state management:
Symbol | Description |
---|---|
![]() | Forbidden |
![]() | Authorized |
![]() | Followed status |
typedef void(* AGHAF_CAN_onBusChange) (uint64_t timestamp, uint8_t chipState, void *userContext) |
callback function called when a bus change happens on a CAN
timestamp | timestamp of the event |
chipState | corresponding to AGHAF_CAN_ChipState |
userContext | context given when setting the callabck in the system |
typedef void(* AGHAF_CAN_onBusLoad) (uint64_t timestamp, uint8_t chipState, uint8_t busLoad, AGHAF_CAN_Error error, void *userContext) |
callback function called when a bus laod is from a CAN is transmitted
timestamp | timestamp of the event |
chipState | corresponding to AGHAF_CAN_ChipState |
busLoad | current bus load |
error | value of the error |
userContext | context given when setting the callabck in the system |
typedef void(* AGHAF_CAN_onError) (uint64_t timestamp, AGHAF_CAN_Error error, void *userContext) |
callback function called when an error happens on a CAN
timestamp | timestamp of the event |
error | value of the error |
userContext | context given when setting the callabck in the system |
typedef void(* AGHAF_CAN_onMessageRx) (uint64_t timestamp, uint32_t ident, uint8_t flags, uint16_t dataLen, uint8_t const *data, void *userContext) |
callback function called when a message is received on a CAN
timestamp | timestamp of the event |
ident | can identifier |
flags | corresponding to AGHAF_CAN_MSG_FLAGS |
dataLen | length of the datas received |
data | datas received |
userContext | context given when setting the callabck in the system |
typedef void(* AGHAF_CAN_onMessageTx) (uint64_t timestamp, uint32_t ident, uint8_t flags, uint16_t dataLen, uint8_t const *data, void *userContext) |
callback function called when a message is transmitted on a CAN
timestamp | timestamp of the event |
ident | can identifier |
flags | corresponding to AGHAF_CAN_MSG_FLAGS |
dataLen | length of the datas transmitted |
data | datas transmitted |
userContext | context given when setting the callabck in the system |
AGHAF_Status AGHAF_CAN_v2_activate | ( | AGHAF_CAN | can | ) |
activate a CAN bus
can | handle on the bus |
AGHAF_Status AGHAF_CAN_v2_addFilter | ( | AGHAF_CAN | can, |
AGHAF_CAN_FilterId | idType, | ||
AGHAF_CAN_FILTER_Type | type, | ||
AGHAF_CAN_FilterMode | mode, | ||
uint32_t | id1, | ||
uint32_t | id2 | ||
) |
add a filter to the CAN bus
can | handle on the bus |
idType | standard or extended CAN |
type | type from the filter |
mode | mode from the filter |
id1 | |
id2 |
AGHAF_Status AGHAF_CAN_v2_BusOn | ( | AGHAF_CAN | can | ) |
reactivate the bus after an error
can | handle on the bus |
AGHAF_Status AGHAF_CAN_v2_clearFilters | ( | AGHAF_CAN | can | ) |
clear the filters from a bus
can | handle on the bus |
AGHAF_Status AGHAF_CAN_v2_deactivate | ( | AGHAF_CAN | can | ) |
deactivate a CAN bus
can | handle on the bus |
AGHAF_Status AGHAF_CAN_v2_filtersCount | ( | AGHAF_CAN | can, |
AGHAF_CAN_FilterId | idType, | ||
uint16_t * | count | ||
) |
Provide the current number of filters.
can | handle on the bus |
idType | standard or extended CAN |
count | pointer to fill with the data |
void AGHAF_CAN_v2_freeSupportedFilters | ( | AGHAF_CAN_FilterDesc * | values | ) |
Free the memory allocated with AGHAF_CAN_Bus_supportedFilters.
values | array to free |
void AGHAF_CAN_v2_freeSupportedModes | ( | AGHAF_CAN_Mode * | modes | ) |
Free the memory allocated with AGHAF_CAN_Bus_supportedModes.
modes | array to free |
void AGHAF_CAN_v2_freeSupportedTerminations | ( | uint32_t * | terminations | ) |
Free the memory allocated with AGHAF_CAN_Bus_supportedTerminations or AGHAF_CAN_Bus_supportedTerminationsLs.
terminations | array to free |
AGHAF_CAN AGHAF_CAN_v2_get | ( | AGHAF_Device | device, |
uint8_t | index | ||
) |
return the CAN bus at index in parameter
device | device handle from the desired CAN bus |
index | index from the bus |
AGHAF_Status AGHAF_CAN_v2_getChipSstate | ( | AGHAF_CAN | can, |
AGHAF_CAN_ChipState * | chipState | ||
) |
Return the chip state from the bus.
can | handle on the bus |
chipState | pointer to fill |
uint8_t AGHAF_CAN_v2_getCount | ( | AGHAF_Device | device | ) |
return the number of CAN bus from a device
device | handle from the device |
uint8_t AGHAF_CAN_v2_getIndex | ( | AGHAF_CAN | can | ) |
return the index from a CAN bus
can | handle from the CAN bus |
AGHAF_Status AGHAF_CAN_v2_getParam | ( | AGHAF_CAN | can, |
AGHAF_CAN_Param | param, | ||
uint32_t * | value | ||
) |
Provide the value from a CAN parameter.
can | handle on the CAN bus |
param | parameter to request |
value | pointer to fill with the content |
AGHAF_Status AGHAF_CAN_v2_isActivated | ( | AGHAF_CAN | can, |
AGHAF_BOOL * | isActivated | ||
) |
Request if a CAN bus is yet activated or not.
can | handle on the bus |
isActivated | pointer to fill with the information |
uint8_t AGHAF_CAN_v2_Periodic_getCount | ( | AGHAF_CAN | can | ) |
Return the number of periodic message available on a CAN bus.
can | handle on the bus |
AGHAF_Status AGHAF_CAN_v2_Periodic_send | ( | AGHAF_CAN | can, |
uint8_t | frameDatalen, | ||
uint8_t const *const | frameData, | ||
uint8_t | frameFlags, | ||
uint32_t | frameIdent, | ||
uint8_t | index, | ||
uint8_t | flags, | ||
uint32_t | period | ||
) |
Add a periodic message to send.
can | handle on the bus |
frameDatalen | data length from the frame |
frameData | data from the frame |
frameFlags | CAN flags from the frame |
frameIdent | CAN identi from the frame |
index | index in which to save the frame |
flags | AGHAF_CAN_PERIODIC_FLAGS |
period | period at which sending the frame (ms) |
AGHAF_Status AGHAF_CAN_v2_reject | ( | AGHAF_CAN | can, |
AGHAF_CAN_RejectType | rejectType, | ||
AGHAF_BOOL | rtr | ||
) |
Set a global filter.
can | handle on the bus |
rejectType | type of reject desired |
rtr |
AGHAF_Status AGHAF_CAN_v2_sendMessage | ( | AGHAF_CAN | can, |
uint32_t | ident, | ||
uint8_t | flags, | ||
uint16_t | dataLen, | ||
uint8_t const * | data | ||
) |
send data on a CAN bus
can | handle on the CAN bus |
ident | CAN identifier |
flags | flags starting with AGHAF_CAN_MSG_ |
dataLen | length of data |
data | data to send |
void AGHAF_CAN_v2_setOnBusChangeCallback | ( | AGHAF_CAN | can, |
AGHAF_CAN_onBusChange | callback, | ||
void * | userContext | ||
) |
set the callback called on a bus change event
can | handle on the bus |
callback | callback to be used for the event |
userContext | context provided by the user for custom datas |
void AGHAF_CAN_v2_setOnBusLoadCallback | ( | AGHAF_CAN | can, |
AGHAF_CAN_onBusLoad | callback, | ||
void * | userContext | ||
) |
set the callback called on a bus noad event
can | handle on the bus |
callback | callback to be used for the event |
userContext | context provided by the user for custom datas |
void AGHAF_CAN_v2_setOnErrorCallback | ( | AGHAF_CAN | can, |
AGHAF_CAN_onError | callback, | ||
void * | userContext | ||
) |
set the callback called on error event
can | handle on the bus |
callback | callback to be used for the event |
userContext | context provided by the user for custom datas |
void AGHAF_CAN_v2_setOnMessageRxCallback | ( | AGHAF_CAN | can, |
AGHAF_CAN_onMessageRx | callback, | ||
void * | userContext | ||
) |
set the callback called on a rx event
can | handle on the bus |
callback | callback to be used for the event |
userContext | context provided by the user for custom datas |
void AGHAF_CAN_v2_setOnMessageTxCallback | ( | AGHAF_CAN | can, |
AGHAF_CAN_onMessageTx | callback, | ||
void * | userContext | ||
) |
set the callback called on a tx event
can | handle on the bus |
callback | callback to be used for the event |
userContext | context provided by the user for custom datas |
AGHAF_Status AGHAF_CAN_v2_setParam | ( | AGHAF_CAN | can, |
AGHAF_CAN_Param | param, | ||
uint32_t | value | ||
) |
Set the value from a CAN parameter.
can | handle on the CAN bus |
param | parameter to set |
value | value to set |
AGHAF_Status AGHAF_CAN_v2_supportedFilters | ( | AGHAF_CAN | can, |
uint16_t * | globalFilterCaps, | ||
AGHAF_CAN_FilterDesc ** | values, | ||
uint16_t * | size | ||
) |
Provide the supported filters from a CAN bus.
can | handle on the bus |
globalFilterCaps | pointer to fill with global cappabilites informations |
values | pointer to fill with the datas |
size | size from values arrays |
AGHAF_Status AGHAF_CAN_v2_supportedModes | ( | AGHAF_CAN | can, |
AGHAF_CAN_Mode ** | modes, | ||
uint8_t * | nbModes | ||
) |
Request the supported modes from the CAN bus in parameter.
can | handle on the bus |
modes | pointer on the datas |
nbModes | size from the modes array |
AGHAF_Status AGHAF_CAN_v2_supportedTerminations | ( | AGHAF_CAN | can, |
uint32_t ** | terminations, | ||
uint32_t * | nbTerminations | ||
) |
Request the supported terminations from a CAN bus.
can | handle on the bus |
terminations | pointer on the datas |
nbTerminations | size from the modes array |
AGHAF_Status AGHAF_CAN_v2_supportedTerminationsLs | ( | AGHAF_CAN | can, |
uint32_t ** | terminations, | ||
uint32_t * | nbTerminations | ||
) |
Request the supported low speed terminations from a CAN bus.
can | handle on the bus |
terminations | pointer on the datas |
nbTerminations | size from the modes array |