Programmable Clock with RTOS 0.0.1
Implementaiton of a programmable clock using RTOS with STM32GO microcontroller.
Loading...
Searching...
No Matches
can_tp.h
Go to the documentation of this file.
1
8#ifndef CAN_TP_H_
9#define CAN_TP_H_
10
11#include "bsp.h"
12
13#define MAX_ARRAY_SIZE 25
14
18typedef struct _CAN_MsgTypeDef
19{
20
21 uint8_t Messagetype;
22 uint8_t Data[ 7 ];
23
25
29typedef struct _CAN_TP_Header
30{
31
32 FDCAN_HandleTypeDef *CANHandler;
33 FDCAN_TxHeaderTypeDef *CANTxHeader;
34
35 // Struct for Received
36 uint32_t bufferSize;
37 uint16_t data_length;
39 uint8_t blockSize;
40 uint8_t flag_ready;
41
43
44 // Struct for Transmitted
45 uint32_t length;
52
55
56
58
59void CAN_TP_Init( CAN_TP_Header *header );
61void CAN_TP_Tick( void );
62void CAN_TP_RxMessageBufferSet( CAN_TP_Header *header, uint8_t *buffer, uint32_t bufferSize );
63void CAN_TP_RxSeparationTimeSet( CAN_TP_Header *header, uint8_t separationTime );
64void CAN_TP_RxBlockSizeSet( CAN_TP_Header *header, uint8_t blockSize );
65void CAN_TP_TransmitMessage( CAN_TP_Header *header, const uint8_t *data, uint32_t length );
66uint8_t CAN_TP_IsMessageReady( const CAN_TP_Header *header );
67void CAN_TP_MessageGet( CAN_TP_Header *header, uint8_t *data, uint8_t data_length );
68void CAN_TP_NewMessage( CAN_TP_Header *header, void *buffer );
70
71#endif
Init the structs Inicialization of structs with Data, Time and Alarm values.
void CAN_TP_Periodic_Task(CAN_TP_Header *header)
Task process for CAN_TP.
Definition can_tp.c:169
#define MAX_ARRAY_SIZE
Definition can_tp.h:13
void CAN_TP_MessageGet(CAN_TP_Header *header, uint8_t *data, uint8_t data_length)
Gets the processed message.
Definition can_tp.c:704
void CAN_TP_NewMessage(CAN_TP_Header *header, void *buffer)
Handles a new message received by CAN_TP.
Definition can_tp.c:672
uint8_t CAN_TP_IsMessageReady(const CAN_TP_Header *header)
Checks if the message is ready to be processed.
Definition can_tp.c:687
void CAN_TP_TransmitInterruptMessage(CAN_TP_Header *header)
Message transmission with interruption.
Definition can_tp.c:731
void CAN_TP_RxSeparationTimeSet(CAN_TP_Header *header, uint8_t separationTime)
Sets the separation time between received messages.
Definition can_tp.c:570
void CAN_TP_RxBlockSizeSet(CAN_TP_Header *header, uint8_t blockSize)
Sets the block size for received messages.
Definition can_tp.c:585
struct _CAN_MsgTypeDef CAN_MsgTypeDef
struct store the element saved the messages of the module FDCAN for CAN Message Elements.
void CAN_TP_TransmitMessage(CAN_TP_Header *header, const uint8_t *data, uint32_t length)
Initiates the transmission of a CAN_TP_Transmited message.
Definition can_tp.c:601
void CAN_TP_Tick(void)
Timing function for CAN_TP.
Definition can_tp.c:657
void CAN_TP_Init(CAN_TP_Header *header)
Initializes the CAN_TP configuration for the CAN_TP_Periodic_Task.
Definition can_tp.c:156
struct _CAN_TP_Header CAN_TP_Header
struct store the element saved the messages of the module FDCAN for CAN_TP Header information.
void CAN_TP_RxMessageBufferSet(CAN_TP_Header *header, uint8_t *buffer, uint32_t bufferSize)
Sets the received message buffer and its size.
Definition can_tp.c:553
struct store the element saved the messages of the module FDCAN for CAN Message Elements.
Definition can_tp.h:19
uint8_t Messagetype
Definition can_tp.h:21
uint8_t Data[7]
Definition can_tp.h:22
struct store the element saved the messages of the module FDCAN for CAN_TP Header information.
Definition can_tp.h:30
uint8_t separationTime
Definition can_tp.h:38
uint32_t counter_newmessage
Definition can_tp.h:53
uint32_t length
Definition can_tp.h:45
uint32_t sequencenumber_index_counter
Definition can_tp.h:47
uint8_t blockSize
Definition can_tp.h:39
uint16_t data_length
Definition can_tp.h:37
FDCAN_HandleTypeDef * CANHandler
Definition can_tp.h:32
uint32_t sequencenumber_index
Definition can_tp.h:46
uint8_t flag_interruption
Definition can_tp.h:51
uint8_t flag_transmitted
Definition can_tp.h:50
uint8_t message[25]
Definition can_tp.h:54
uint32_t last_sequencenumber_short_bytes
Definition can_tp.h:48
CAN_MsgTypeDef * buffer_received
Definition can_tp.h:42
FDCAN_TxHeaderTypeDef * CANTxHeader
Definition can_tp.h:33
uint32_t bufferSize
Definition can_tp.h:36
uint8_t * buffer_transmited
Definition can_tp.h:49
uint8_t flag_ready
Definition can_tp.h:40