AGHAF 4.5.7
Annecy electronique Generic Hardware Access Framework
Loading...
Searching...
No Matches
aghaf_docan_v2.h
Go to the documentation of this file.
1// Copyright (c) 2019 by ANNECY ELECTRONIQUE, Chavanod, France
2
6
7#ifndef EXXOTEST_AGHAF_DOCAN_V2_H
8#define EXXOTEST_AGHAF_DOCAN_V2_H
9
11
12#include "aghaf_can_v2.h"
13#include "aghaf_global.h"
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
21
24
35typedef void (*AGHAF_DoCAN_onMessageTx)(uint64_t timestamp, uint32_t canIdent,
36 uint8_t canFlags, uint32_t dataLen,
37 uint8_t const *data, void *userContext);
38
46typedef void (*AGHAF_DoCAN_onMessageTxError)(uint64_t timestamp,
48 void *userContext);
49
60typedef void (*AGHAF_DoCAN_onMessageRx)(uint64_t timestamp, uint32_t canIdent,
61 uint8_t canFlags, uint32_t dataLen,
62 uint8_t const *data, void *userContext);
63
72typedef void (*AGHAF_DoCAN_onMessageRxFF)(uint64_t timestamp, uint32_t canIdent,
73 uint8_t canFlags, void *userContext);
74
82typedef void (*AGHAF_DoCAN_onMessageRxError)(uint64_t timestamp,
84 void *userContext);
85
86AGHAF_PUBLIC_FUNCTION(void, AGHAF_DoCAN_v2_setOnMessageTxCallback,
88 AGHAF_DoCAN_onMessageTx callback, void *userContext));
89AGHAF_PUBLIC_FUNCTION(void, AGHAF_DoCAN_v2_setOnMessageTxErrorCallback,
92 void *userContext));
93AGHAF_PUBLIC_FUNCTION(void, AGHAF_DoCAN_v2_setOnMessageRxCallback,
95 AGHAF_DoCAN_onMessageRx callback, void *userContext));
96AGHAF_PUBLIC_FUNCTION(void, AGHAF_DoCAN_v2_setOnMessageRxFFCallback,
98 AGHAF_DoCAN_onMessageRxFF callback, void *userContext));
99AGHAF_PUBLIC_FUNCTION(void, AGHAF_DoCAN_v2_setOnMessageRxErrorCallback,
100 (AGHAF_DoCAN_v2_Channel channel,
102 void *userContext));
103
104AGHAF_PUBLIC_FUNCTION(AGHAF_Status, AGHAF_DoCAN_v2_getChannelCount,
105 (AGHAF_CAN bus, uint8_t *count));
107 (AGHAF_CAN bus, uint8_t *count));
109 (AGHAF_CAN bus));
110AGHAF_PUBLIC_FUNCTION(AGHAF_Status, AGHAF_DoCAN_v2_releaseChannel,
111 (AGHAF_DoCAN_v2_Channel channel));
112
113AGHAF_PUBLIC_FUNCTION(AGHAF_Status, AGHAF_DoCAN_v2_Channel_setParam,
114 (AGHAF_DoCAN_v2_Channel channel,
115 AGHAF_DoCAN_ChannelParam param, uint32_t value));
116AGHAF_PUBLIC_FUNCTION(AGHAF_Status, AGHAF_DoCAN_v2_Channel_getParam,
117 (AGHAF_DoCAN_v2_Channel channel,
118 AGHAF_DoCAN_ChannelParam param, uint32_t *value));
119AGHAF_PUBLIC_FUNCTION(AGHAF_Status, AGHAF_DoCAN_v2_Channel_start,
120 (AGHAF_DoCAN_v2_Channel channel));
121AGHAF_PUBLIC_FUNCTION(AGHAF_Status, AGHAF_DoCAN_v2_Channel_stop,
122 (AGHAF_DoCAN_v2_Channel channel));
123AGHAF_PUBLIC_FUNCTION(AGHAF_Status, AGHAF_DoCAN_v2_Channel_send,
124 (AGHAF_DoCAN_v2_Channel channel, uint32_t dataLen,
125 uint8_t const *data));
126AGHAF_PUBLIC_FUNCTION(void, AGHAF_DoCAN_v2_Channel_activateTrace,
127 (AGHAF_DoCAN_v2_Channel channel, AGHAF_BOOL value));
128
130
131#ifdef __cplusplus
132}
133#endif
134
135#endif // EXXOTEST_AGHAF_DOCAN_H
void * AGHAF_CAN
handle on CAN
Definition aghaf_can_v2.h:15
void AGHAF_DoCAN_v2_setOnMessageRxErrorCallback(AGHAF_DoCAN_v2_Channel channel, AGHAF_DoCAN_onMessageRxError callback, void *userContext)
set the callback called on a reception error event
Definition aghaf_docan_v2.cpp:70
AGHAF_Status AGHAF_DoCAN_v2_Channel_start(AGHAF_DoCAN_v2_Channel channel)
Start a channel.
Definition aghaf_docan_v2.cpp:182
AGHAF_Status AGHAF_DoCAN_v2_Channel_setParam(AGHAF_DoCAN_v2_Channel channel, AGHAF_DoCAN_ChannelParam param, uint32_t value)
Set the parameter from a channel.
Definition aghaf_docan_v2.cpp:154
AGHAF_Status AGHAF_DoCAN_v2_getChannelCount(AGHAF_CAN bus, uint8_t *count)
Provide the number of channels available on the bus.
Definition aghaf_docan_v2.cpp:84
void AGHAF_DoCAN_v2_Channel_activateTrace(AGHAF_DoCAN_v2_Channel channel, AGHAF_BOOL value)
Activate the CAN trace.
Definition aghaf_docan_v2.cpp:219
void(* AGHAF_DoCAN_onMessageRxError)(uint64_t timestamp, AGHAF_DoCan_Error error, void *userContext)
callback function called when an error happens on the reception from a DoCAN channel
Definition aghaf_docan_v2.h:82
void * AGHAF_DoCAN_v2_Channel
Handle to a DoCAN channel.
Definition aghaf_docan_v2.h:23
AGHAF_Status AGHAF_DoCAN_v2_Channel_send(AGHAF_DoCAN_v2_Channel channel, uint32_t dataLen, uint8_t const *data)
Send on the DoCAN channel in parameter.
Definition aghaf_docan_v2.cpp:206
void AGHAF_DoCAN_v2_setOnMessageTxErrorCallback(AGHAF_DoCAN_v2_Channel channel, AGHAF_DoCAN_onMessageTxError callback, void *userContext)
set the callback called on a transmission error event
Definition aghaf_docan_v2.cpp:28
void(* AGHAF_DoCAN_onMessageTx)(uint64_t timestamp, uint32_t canIdent, uint8_t canFlags, uint32_t dataLen, uint8_t const *data, void *userContext)
callback function called when a message is transmitted on a DoCAN channel
Definition aghaf_docan_v2.h:35
void AGHAF_DoCAN_v2_setOnMessageRxFFCallback(AGHAF_DoCAN_v2_Channel channel, AGHAF_DoCAN_onMessageRxFF callback, void *userContext)
set the callback called on the reception from a first frame event
Definition aghaf_docan_v2.cpp:56
AGHAF_Status AGHAF_DoCAN_v2_releaseChannel(AGHAF_DoCAN_v2_Channel channel)
Release the channel.
Definition aghaf_docan_v2.cpp:115
AGHAF_Status AGHAF_DoCAN_v2_Channel_getParam(AGHAF_DoCAN_v2_Channel channel, AGHAF_DoCAN_ChannelParam param, uint32_t *value)
Provide the value from a channel parameter.
Definition aghaf_docan_v2.cpp:169
void AGHAF_DoCAN_v2_setOnMessageTxCallback(AGHAF_DoCAN_v2_Channel channel, AGHAF_DoCAN_onMessageTx callback, void *userContext)
set the callback called on a transmission event
Definition aghaf_docan_v2.cpp:14
void(* AGHAF_DoCAN_onMessageTxError)(uint64_t timestamp, AGHAF_DoCan_Error error, void *userContext)
callback function called when an error happens on the transmission from a DoCAN channel
Definition aghaf_docan_v2.h:46
void(* AGHAF_DoCAN_onMessageRx)(uint64_t timestamp, uint32_t canIdent, uint8_t canFlags, uint32_t dataLen, uint8_t const *data, void *userContext)
callback function called when a message is received on a DoCAN channel
Definition aghaf_docan_v2.h:60
AGHAF_Status AGHAF_DoCAN_v2_getFreeChannelCount(AGHAF_CAN bus, uint8_t *count)
Return the number of free channels still available.
Definition aghaf_docan_v2.cpp:95
void AGHAF_DoCAN_v2_setOnMessageRxCallback(AGHAF_DoCAN_v2_Channel channel, AGHAF_DoCAN_onMessageRx callback, void *userContext)
set the callback called on a reception event
Definition aghaf_docan_v2.cpp:42
void(* AGHAF_DoCAN_onMessageRxFF)(uint64_t timestamp, uint32_t canIdent, uint8_t canFlags, void *userContext)
callback function called when a first frame is received on a DoCAN channel
Definition aghaf_docan_v2.h:72
AGHAF_Status AGHAF_DoCAN_v2_Channel_stop(AGHAF_DoCAN_v2_Channel channel)
Stop a channel.
Definition aghaf_docan_v2.cpp:193
AGHAF_DoCAN_v2_Channel AGHAF_DoCAN_v2_createChannel(AGHAF_CAN bus)
Create a channel.
Definition aghaf_docan_v2.cpp:105
AGHAF_DoCan_Error
enumerator to describe the error on the bus
Definition aghaf_docan_enums.h:16
AGHAF_DoCAN_ChannelParam
List of parameters used to configure a DoCAN channel.
Definition aghaf_docan_enums.h:86
AGHAF_Status
enumerator to define the error type in aghaf functions
Definition aghaf_global.h:120
AGHAF_BOOL
enumerator to get a bool definition
Definition aghaf_global.h:114