|
Programmable Clock with RTOS 0.0.1
Implementaiton of a programmable clock using RTOS with STM32GO microcontroller.
|
Board Support Package. More...
#include "bsp.h"Go to the source code of this file.
Data Structures | |
| struct | _CAN_MsgTypeDef |
| struct store the element saved the messages of the module FDCAN for CAN Message Elements. More... | |
| struct | _CAN_TP_Header |
| struct store the element saved the messages of the module FDCAN for CAN_TP Header information. More... | |
Macros | |
| #define | MAX_ARRAY_SIZE 25 |
Typedefs | |
| typedef struct _CAN_MsgTypeDef | CAN_MsgTypeDef |
| struct store the element saved the messages of the module FDCAN for CAN Message Elements. | |
| typedef struct _CAN_TP_Header | CAN_TP_Header |
| struct store the element saved the messages of the module FDCAN for CAN_TP Header information. | |
Functions | |
| void | CAN_TP_Init (CAN_TP_Header *header) |
| Initializes the CAN_TP configuration for the CAN_TP_Periodic_Task. | |
| void | CAN_TP_Periodic_Task (CAN_TP_Header *header) |
| Task process for CAN_TP. | |
| void | CAN_TP_Tick (void) |
| Timing function for CAN_TP. | |
| void | CAN_TP_RxMessageBufferSet (CAN_TP_Header *header, uint8_t *buffer, uint32_t bufferSize) |
| Sets the received message buffer and its size. | |
| void | CAN_TP_RxSeparationTimeSet (CAN_TP_Header *header, uint8_t separationTime) |
| Sets the separation time between received messages. | |
| void | CAN_TP_RxBlockSizeSet (CAN_TP_Header *header, uint8_t blockSize) |
| Sets the block size for received messages. | |
| void | CAN_TP_TransmitMessage (CAN_TP_Header *header, const uint8_t *data, uint32_t length) |
| Initiates the transmission of a CAN_TP_Transmited message. | |
| uint8_t | CAN_TP_IsMessageReady (const CAN_TP_Header *header) |
| Checks if the message is ready to be processed. | |
| void | CAN_TP_MessageGet (CAN_TP_Header *header, uint8_t *data, uint8_t data_length) |
| Gets the processed message. | |
| void | CAN_TP_NewMessage (CAN_TP_Header *header, void *buffer) |
| Handles a new message received by CAN_TP. | |
| void | CAN_TP_TransmitInterruptMessage (CAN_TP_Header *header) |
| Message transmission with interruption. | |
Board Support Package.
File provides the neccesary drivers, libraries, and configurations for the CAN BUS.
| #define MAX_ARRAY_SIZE 25 |
Maximum allowed size for the array
| void CAN_TP_Init | ( | CAN_TP_Header * | header | ) |
Initializes the CAN_TP configuration for the CAN_TP_Periodic_Task.
Function necessary for work with normality
| header | CAN_TP header data structure. |
< The flag indicates when CAN TP is not ready to transmit a message
< The flag indicates when CAN TP is not ready to transmit a message
| uint8_t CAN_TP_IsMessageReady | ( | const CAN_TP_Header * | header | ) |
Checks if the message is ready to be processed.
Function that tells us if we can read the complete message received through CAN_TP
| header | CAN_TP header data structure. |
| void CAN_TP_MessageGet | ( | CAN_TP_Header * | header, |
| uint8_t * | data, | ||
| uint8_t | data_length ) |
Gets the processed message.
Function to extract all the message received by CAN TP into a variable and then delete all the message received in the Rx buffer.
| header | CAN_TP header data structure. |
| data | Pointer to the message data. |
| data_length | Length of the data to retrieve. |
| void CAN_TP_NewMessage | ( | CAN_TP_Header * | header, |
| void * | data ) |
Handles a new message received by CAN_TP.
Function to implement in HAL_FDCAN_RxFifo0Callback. This function tells us when to enter CAN_TP_RxReceive_Period_Task
| header | CAN_TP header data structure. |
| data | Pointer to the received message data. |
| void CAN_TP_Periodic_Task | ( | CAN_TP_Header * | header | ) |
Task process for CAN_TP.
Function switches the CAN TP periodically if it transmits or receives.
| header | CAN_TP header data structure. |
< The flag indicates when CAN TP is ready to transmit a message
< The flag indicates when CAN TP is not ready to transmit a message
| void CAN_TP_RxBlockSizeSet | ( | CAN_TP_Header * | header, |
| uint8_t | blockSize ) |
Sets the block size for received messages.
Function to indicate the blocks that will be received in the transmission of messages. If kept at 0, message limits will not be taken into account for transmission.
| header | CAN_TP header data structure. |
| blockSize | Block size. |
| void CAN_TP_RxMessageBufferSet | ( | CAN_TP_Header * | header, |
| uint8_t * | buffer, | ||
| uint32_t | bufferSize ) |
Sets the received message buffer and its size.
Function to indicate the size and memory space of the Rx buffer where the messages received from the data transmission will be saved.
| header | CAN_TP header data structure. |
| buffer | Received message buffer. |
| bufferSize | Size of the message buffer. |
| void CAN_TP_RxSeparationTimeSet | ( | CAN_TP_Header * | header, |
| uint8_t | separationTime ) |
Sets the separation time between received messages.
Function to indicate the separation time of message transmission for the Rx buffer. If kept at 0, no waiting limits will apply between received messages.
| header | CAN_TP header data structure. |
| separationTime | Separation time between messages. |
| void CAN_TP_Tick | ( | void | ) |
Timing function for CAN_TP.
Function that counts CAN TP ticks to ensure separation time and sending of a wait, overflow/abort.
| void CAN_TP_TransmitInterruptMessage | ( | CAN_TP_Header * | header | ) |
Message transmission with interruption.
Function that calls CAN_TP_TxTransmit_Period_Task when the flag_interruption is activated, this happens when a flowcontrol typeframe CTS is received.
| header | CAN_TP header data structure. |
< The flag indicates when CAN TP is ready to transmit a message
| void CAN_TP_TransmitMessage | ( | CAN_TP_Header * | header, |
| const uint8_t * | data, | ||
| uint32_t | length ) |
Initiates the transmission of a CAN_TP_Transmited message.
The function analyzes whether to send a single frame or multiple consecutive frames depending on the length of the data. In the case of multiple consecutive frames, the number of consecutive frames that will be sent is calculated.
| header | CAN_TP header data structure. |
| data | Pointer to the message data. |
| length | Length of the message. |
< The flag indicates when CAN TP is ready to transmit a message
< Offset data of the first frame because it transmitted 6 bytes of data
< Offset data of the first frame because it transmitted 6 bytes of data
< Offset data of the first frame because it transmitted 6 bytes of data
< Offset data of the first frame because it transmitted 6 bytes of data
< Offset data of the first frame because it transmitted 6 bytes of data
< The flag indicates when CAN TP is ready to transmit a message