PER Firmware
Loading...
Searching...
No Matches
can_callback.c File Reference

CAN callback implementation. More...

#include <string.h>
#include "activity_leds.h"
#include "can_library/generated/SCAN.h"
#include "can_library/generated/VCAN.h"
#include "phal_G4/fdcan/fdcan.h"
#include "rtos/rtos.h"
#include "timestamped_frame/timestamped_frame.h"
#include "main.h"
Include dependency graph for can_callback.c:

Functions

static uint32_t get_bus_id (FDCAN_GlobalTypeDef *peripheral)
 
void PHAL_FDCAN_rxCallback (CanMsgTypeDef_t *msg)
 Weak callback fired once per received frame.
 

Variables

volatile uint32_t last_can_rx_time_ms = 0
 

Detailed Description

CAN callback implementation.

Author
Irving Wang (irvin.nosp@m.gw@p.nosp@m.urdue.nosp@m..edu)

Function Documentation

◆ get_bus_id()

static uint32_t get_bus_id ( FDCAN_GlobalTypeDef * peripheral)
inlinestatic
Here is the caller graph for this function:

◆ PHAL_FDCAN_rxCallback()

void PHAL_FDCAN_rxCallback ( CanMsgTypeDef_t * msg)

Weak callback fired once per received frame.

Called from FDCANx_IT0_IRQHandler (interrupt context) for every frame popped from RX FIFO0.

Default implementation does nothing.

Parameters
msgthe received frame (valid only for the duration of the call)
Here is the call graph for this function:

Variable Documentation

◆ last_can_rx_time_ms

volatile uint32_t last_can_rx_time_ms = 0