libyggdrasil  v1.0.0
can.h
Go to the documentation of this file.
1  /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  * _____.___. .___ .__.__ *
3  * \__ | | ____ ____ __| _/___________ _____|__| | *
4  * / | |/ ___\ / ___\ / __ |\_ __ \__ \ / ___/ | | *
5  * \____ / /_/ > /_/ > /_/ | | | \// __ \_\___ \| | |__ *
6  * / ______\___ /\___ /\____ | |__| (____ /____ >__|____/ *
7  * \/ /_____//_____/ \/ \/ \/ *
8  * - Midgard - *
9  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
10  * This software can be used by students and other personal of the *
11  * Bern University of Applied Sciences under the terms of the MIT *
12  * license. *
13  * For other persons this software is under the terms of the GNU *
14  * General Public License version 2. *
15  * *
16  * Copyright © 2021, Bern University of Applied Sciences. *
17  * All rights reserved. *
18  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
26 #include <c/common/types.h>
27 
28 #include <stm32f7xx_hal.h>
29 
33 typedef struct {
34  CAN_HandleTypeDef *interface;
35 } can_t;
36 
45 
53 
61 
69 
78 C_LINKAGE void yggdrasil_CAN_Read(can_t can, u32 *id, void *data, size_t size);
79 
89 C_LINKAGE u32 yggdrasil_CAN_Write(can_t can, u32 id, void *data, size_t size);
90 
100 C_LINKAGE bool yggdrasil_CAN_SetStdFilter(can_t can, u8 bank, u16 id, u16 mask);
101 
110 
111 
yggdrasil_CAN_Init
C_LINKAGE bool yggdrasil_CAN_Init(can_t can)
CAN init function.
Definition: can.cpp:38
types.h
Commonly used type definitions and helper templates.
u16
uint16_t u16
Definition: types.h:37
u8
uint8_t u8
Unsigned integer definitions.
Definition: types.h:36
yggdrasil_CAN_SetStdFilter
C_LINKAGE bool yggdrasil_CAN_SetStdFilter(can_t can, u8 bank, u16 id, u16 mask)
Standard ID filter configuration function.
Definition: can.cpp:89
can_t
CAN handle type.
Definition: can.h:33
yggdrasil_CAN_Enable
C_LINKAGE bool yggdrasil_CAN_Enable(can_t can)
CAN enable.
Definition: can.cpp:47
u32
uint32_t u32
Definition: types.h:38
yggdrasil_CAN_Disable
C_LINKAGE bool yggdrasil_CAN_Disable(can_t can)
CAN disable.
Definition: can.cpp:51
can_t::interface
CAN_HandleTypeDef * interface
Definition: can.h:34
yggdrasil_CAN_DisableFilter
C_LINKAGE bool yggdrasil_CAN_DisableFilter(can_t can, u8 bank)
Filter bank disable.
Definition: can.cpp:110
yggdrasil_CAN_Deinit
C_LINKAGE bool yggdrasil_CAN_Deinit(can_t can)
CAN init function.
Definition: can.cpp:43
yggdrasil_CAN_Write
C_LINKAGE u32 yggdrasil_CAN_Write(can_t can, u32 id, void *data, size_t size)
CAN write.
Definition: can.cpp:67
C_LINKAGE
#define C_LINKAGE
Definition: attributes.h:43
yggdrasil_CAN_Read
C_LINKAGE void yggdrasil_CAN_Read(can_t can, u32 *id, void *data, size_t size)
CAN receive.
Definition: can.cpp:55