-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Testing YAML * Install libncurses * Install libncurses * everything * can hw initial draft. Comments r soon to come * Master tasks setup * added interrupts, can comments, notify, flash library * Formatting * mastker tasks implementation * Updated UART * Updated master tasks to use 1000hz 10 hz and 1hz * FWXVI --------- Co-authored-by: vagrant <vagrant@midsunbox>
- Loading branch information
Showing
67 changed files
with
1,538 additions
and
380 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
#pragma once | ||
|
||
/************************************************************************************************ | ||
* @file can.h | ||
* | ||
* @brief Header file for CAN Application code | ||
* | ||
* @date 2024-11-23 | ||
* @author Midnight Sun Team #24 - MSXVI | ||
************************************************************************************************/ | ||
|
||
/* Standard library headers */ | ||
#include <stdbool.h> | ||
#include <stddef.h> | ||
#include <stdint.h> | ||
|
||
/* Inter-component Headers */ | ||
#include "status.h" | ||
|
||
/* Intra-component Headers */ | ||
#include "can_hw.h" | ||
#include "can_queue.h" | ||
|
||
typedef struct CanStorage { | ||
volatile CanQueue rx_queue; | ||
uint16_t device_id; | ||
} CanStorage; | ||
|
||
/** | ||
* @brief Initialize the CAN interface | ||
* @param storage Pointer to the CAN storage | ||
* @param settings Pointer to the CAN settings | ||
* @return STATUS_CODE_OK if initialization succeeded | ||
* STATUS_CODE_INVALID_ARGS if one of the parameters are incorrect | ||
* STATUS_CODE_INTERNAL_ERROR if initialization fails | ||
*/ | ||
StatusCode can_init(CanStorage *storage, const CanSettings *settings); | ||
|
||
/** | ||
* @brief Initialize the CAN interface | ||
* @param rx_queue Pointer to the CAN RX queue | ||
* @param settings Pointer to the CAN settings | ||
* @return STATUS_CODE_OK if initialization succeeded | ||
* STATUS_CODE_INVALID_ARGS if one of the parameters are incorrect | ||
* STATUS_CODE_INTERNAL_ERROR if HAL initialization fails | ||
*/ | ||
StatusCode can_add_filter_in(); | ||
|
||
/** | ||
* @brief Initialize the CAN interface | ||
* @param rx_queue Pointer to the CAN RX queue | ||
* @param settings Pointer to the CAN settings | ||
* @return STATUS_CODE_OK if initialization succeeded | ||
* STATUS_CODE_INVALID_ARGS if one of the parameters are incorrect | ||
* STATUS_CODE_INTERNAL_ERROR if HAL initialization fails | ||
*/ | ||
StatusCode can_transmit(); | ||
|
||
/** | ||
* @brief Initialize the CAN interface | ||
* @param rx_queue Pointer to the CAN RX queue | ||
* @param settings Pointer to the CAN settings | ||
* @return STATUS_CODE_OK if initialization succeeded | ||
* STATUS_CODE_INVALID_ARGS if one of the parameters are incorrect | ||
* STATUS_CODE_INTERNAL_ERROR if HAL initialization fails | ||
*/ | ||
StatusCode can_receive(); | ||
|
||
/** | ||
* @brief Initialize the CAN interface | ||
* @param rx_queue Pointer to the CAN RX queue | ||
* @param settings Pointer to the CAN settings | ||
* @return STATUS_CODE_OK if initialization succeeded | ||
* STATUS_CODE_INVALID_ARGS if one of the parameters are incorrect | ||
* STATUS_CODE_INTERNAL_ERROR if HAL initialization fails | ||
*/ | ||
StatusCode cache_can_tx(); | ||
|
||
/** | ||
* @brief Initialize the CAN interface | ||
* @param rx_queue Pointer to the CAN RX queue | ||
* @param settings Pointer to the CAN settings | ||
* @return STATUS_CODE_OK if initialization succeeded | ||
* STATUS_CODE_INVALID_ARGS if one of the parameters are incorrect | ||
* STATUS_CODE_INTERNAL_ERROR if HAL initialization fails | ||
*/ | ||
StatusCode cache_can_rx(); | ||
|
||
/** | ||
* @brief Initialize the CAN interface | ||
* @param rx_queue Pointer to the CAN RX queue | ||
* @param settings Pointer to the CAN settings | ||
* @return STATUS_CODE_OK if initialization succeeded | ||
* STATUS_CODE_INVALID_ARGS if one of the parameters are incorrect | ||
* STATUS_CODE_INTERNAL_ERROR if HAL initialization fails | ||
*/ | ||
StatusCode clear_rx_cache(); | ||
|
||
/** | ||
* @brief Initialize the CAN interface | ||
* @param rx_queue Pointer to the CAN RX queue | ||
* @param settings Pointer to the CAN settings | ||
* @return STATUS_CODE_OK if initialization succeeded | ||
* STATUS_CODE_INVALID_ARGS if one of the parameters are incorrect | ||
* STATUS_CODE_INTERNAL_ERROR if HAL initialization fails | ||
*/ | ||
StatusCode clear_tx_cache(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.