Skip to content

Commit

Permalink
can init and send function devved
Browse files Browse the repository at this point in the history
  • Loading branch information
Dylan Donahue committed Dec 7, 2023
1 parent 08364b9 commit f7fe56f
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 359 deletions.
12 changes: 7 additions & 5 deletions platforms/stm32f405/include/can.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,22 @@
#include <stdbool.h>
#include <stddef.h>

#include "stm32f4xx_hal.h"
#include "stm32f4xx_hal_can.h"
typedef struct{
CAN_HandleTypeDef *hcan;
uint16_t *id_list;
uint8_t size;
HAL_CAN_RxFifo0MsgPendingCallback RxCallback;
} can_t;

/* desired behavior varies by app - so implement this at app level */
void (*can_callback)(CAN_HandleTypeDef *hcan);
} can_t;

void can_init(can_t *can);
void can_send_msg(can_t *can, uint16_t id, uint8_t *data, uint8_t size);


#include "stm32f4xx_hal.h"
#include "stm32f4xx_hal_can.h"

void can_init(can_t *can);



Expand Down
Loading

0 comments on commit f7fe56f

Please sign in to comment.