38 lines
868 B
C
38 lines
868 B
C
/*
|
|
* AMS_CAN.h
|
|
*
|
|
* Created on: Mar 19, 2022
|
|
* Author: jasper
|
|
*/
|
|
|
|
#ifndef INC_AMS_CAN_H_
|
|
#define INC_AMS_CAN_H_
|
|
|
|
#include "main.h"
|
|
|
|
#include "stm32f3xx_hal.h"
|
|
#include "stm32f3xx_hal_can.h"
|
|
#include "stm32f3xx_hal_def.h"
|
|
#include <stdint.h>
|
|
typedef struct {
|
|
uint8_t pwrgndfans;
|
|
} rx_status_frame;
|
|
uint8_t txbuffer;
|
|
uint8_t rxbuffer;
|
|
void ams_can_init(CAN_HandleTypeDef* hcan);
|
|
void ams_can_handle_ams_msg(CAN_RxHeaderTypeDef* header, uint8_t* data);
|
|
void ams_can_send_status();
|
|
/**
|
|
* @brief Send an AMS Error via CAN.
|
|
*
|
|
* Data is taken from error_data
|
|
*/
|
|
void ams_can_send_error();
|
|
|
|
HAL_StatusTypeDef ams_can_wait_for_free_mailboxes(CAN_HandleTypeDef* handle,
|
|
int num_mailboxes,
|
|
uint32_t timeout);
|
|
void ams_can_send_log();
|
|
|
|
#endif /* INC_AMS_CAN_H_ */
|