AFBR-S50 API Reference Manual  v1.6.5
AFBR-S50 Time-of-Flight Sensor SDK for Embedded Software
can_api.h
Go to the documentation of this file.
1 /*************************************************************************/
39 #ifndef CAN_API_H_
40 #define CAN_API_H_
41 
42 #include "argus.h"
43 
44 
45 /*!***************************************************************************
46  * @defgroup can_intf CAN API interface
47  * @ingroup can_app
48  *
49  * @brief CAN interface for the AFBR-S50 Reference Board CAN application.
50  *
51  * @details A simple CAN interface to demonstrate the basic usage of the
52  * CAN bus that comes with the AFBR-S50 Reference Board.
53  *
54  * @addtogroup can_intf
55  * @{
56  *****************************************************************************/
57 
58 /*!***************************************************************************
59  * @brief Initializes the CAN API module.
60  *****************************************************************************/
61 void CAN_Init(void);
62 
63 
64 /*!***************************************************************************
65  * @brief Deinitializes the CAN module.
66  *****************************************************************************/
67 void CAN_Deinit(void);
68 
69 
70 /*!***************************************************************************
71  * @brief Handles incoming CAN commands by invoking the corresponding methods.
72  *
73  * @details Checks the incomming data queue and handles/invokes commands
74  * accordingly.
75  *
76  * Note that this function must be called from thread level (not from
77  * interrupt service routines) in order to be executed correctly.
78  *****************************************************************************/
79 void CAN_HandleCommand(void);
80 
81 
82 /*!***************************************************************************
83  * @brief Prints measurement results via CAN bus.
84  *
85  * @details Prints 1D measurement data via CAN-bus as data frame with ID 28.
86  *
87  * The following values are included in the CAN data frame payload:
88  *
89  * - 0..2: 1D Range [mm] (24bit, unsigned, MSB first)
90  * - 3..4: 1D Amplitude [LSB] (16-bit, unsigned, MSB first)
91  * - 5: Signal Quality [%] (8-bit, 0%-100% )
92  * - 6-7: Status (16-bit, signed, MSB first, see #status_t for details)
93  * .
94  *
95  * @param res A pointer to the latest measurement results structure.
96  *****************************************************************************/
97 void CAN_Transmit1D(argus_results_t const * res);
98 
100 #endif /* CAN_API_H_ */
CAN_Init
void CAN_Init(void)
Initializes the CAN API module.
Definition: can_api.c:83
CAN_HandleCommand
void CAN_HandleCommand(void)
Handles incoming CAN commands by invoking the corresponding methods.
Definition: can_api.c:182
CAN_Deinit
void CAN_Deinit(void)
Deinitializes the CAN module.
Definition: can_api.c:93
argus.h
This file is part of the AFBR-S50 API.
argus_results_t
The measurement results data structure.
Definition: argus_res.h:215
CAN_Transmit1D
void CAN_Transmit1D(argus_results_t const *res)
Prints measurement results via CAN bus.
Definition: can_api.c:149