libyggdrasil  v1.0.0
can.h File Reference

CAN abstraction implementation for Midgard. More...

#include <c/common/types.h>
#include <stm32f7xx_hal.h>
Include dependency graph for can.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  can_t
 CAN handle type. More...
 

Functions

C_LINKAGE bool yggdrasil_CAN_Init (can_t can)
 CAN init function. More...
 
C_LINKAGE bool yggdrasil_CAN_Deinit (can_t can)
 CAN init function. More...
 
C_LINKAGE bool yggdrasil_CAN_Enable (can_t can)
 CAN enable. More...
 
C_LINKAGE bool yggdrasil_CAN_Disable (can_t can)
 CAN disable. More...
 
C_LINKAGE void yggdrasil_CAN_Read (can_t can, u32 *id, void *data, size_t size)
 CAN receive. More...
 
C_LINKAGE u32 yggdrasil_CAN_Write (can_t can, u32 id, void *data, size_t size)
 CAN write. More...
 
C_LINKAGE bool yggdrasil_CAN_SetStdFilter (can_t can, u8 bank, u16 id, u16 mask)
 Standard ID filter configuration function. More...
 
C_LINKAGE bool yggdrasil_CAN_DisableFilter (can_t can, u8 bank)
 Filter bank disable. More...
 

Detailed Description

CAN abstraction implementation for Midgard.

Author
Fabian Weber, Nikolaij Saegesser

Function Documentation

◆ yggdrasil_CAN_Deinit()

C_LINKAGE bool yggdrasil_CAN_Deinit ( can_t  can)

CAN init function.

Parameters
canCAN handle
Returns
Success

◆ yggdrasil_CAN_Disable()

C_LINKAGE bool yggdrasil_CAN_Disable ( can_t  can)

CAN disable.

Parameters
canCAN handle
Returns
Success

◆ yggdrasil_CAN_DisableFilter()

C_LINKAGE bool yggdrasil_CAN_DisableFilter ( can_t  can,
u8  bank 
)

Filter bank disable.

Parameters
canCAN handle
bankFilterbank number
Returns
Success

◆ yggdrasil_CAN_Enable()

C_LINKAGE bool yggdrasil_CAN_Enable ( can_t  can)

CAN enable.

Parameters
canCAN handle
Returns
Success

◆ yggdrasil_CAN_Init()

C_LINKAGE bool yggdrasil_CAN_Init ( can_t  can)

CAN init function.

Note
Filter bank 0 will be set to 0 0 to accept all IDs
Parameters
canCAN handle
Returns
Success

◆ yggdrasil_CAN_Read()

C_LINKAGE void yggdrasil_CAN_Read ( can_t  can,
u32 id,
void *  data,
size_t  size 
)

CAN receive.

Parameters
canCAN handle
[out]idCAN ID
dataReceived data
sizeBuffer size

◆ yggdrasil_CAN_SetStdFilter()

C_LINKAGE bool yggdrasil_CAN_SetStdFilter ( can_t  can,
u8  bank,
u16  id,
u16  mask 
)

Standard ID filter configuration function.

Parameters
canCAN handle
bankFilterbank 0 to 28
idStandard ID 0 to 0x7FF
maskFiltermask 0 to 0x7FF
Returns
Success

◆ yggdrasil_CAN_Write()

C_LINKAGE u32 yggdrasil_CAN_Write ( can_t  can,
u32  id,
void *  data,
size_t  size 
)

CAN write.

Parameters
canCAN handle
idCAN ID
dataReceived data
sizeBuffer size
Returns
Tx mailbox number