|  | Dual Active Bridge Development Board (Part-No. ) |
Content |  |  |  |  |  |

Loading...
Searching...
No Matches
PBV_interface.h
1
2/*
3 * @file PBV_interface.h
4 * @author M70027
5 * @ingroup APP_PBV_INTERFACE
6 * @brief Power Board Visualizer application interface
7 */
8
9#ifndef APP_PBV_INTERFACE_H
10#define APP_PBV_INTERFACE_H
11
13#include <xc.h> // include processor files - each processor file is guarded.
14#include "config/comms_config.h"
15
16
21 enum PBV_SIGNAL_ASCII_MODE
22{
23 PBV_SIGNAL_MODE = 0,
24 PBV_ASCII_MODE = 1
25} ;
26
27
33 enum PBV_MESSAGE_TX_STATE
34{
35 PBV_MESSAGE_TRANSMITTED = 0,
36 PBV_MESSAGE_INIT = 1,
37 PBV_MESSAGE_TRANSMIT_START = 2,
38 PBV_MESSAGE_TRANSMITTING = 3,
39 PBV_MESSAGE_TX_ERROR = 4
40};
41typedef enum PBV_MESSAGE_TX_STATE PBV_MESSAGE_TX_STATE_t;
42
43
49 enum PBV_MESSAGE_RX_STATE
50{
51 PBV_MESSAGE_RECEIVED = 0,
52 PBV_MESSAGE_READY_TO_RECEIVE = 1,
53 PBV_STATE_RECEIVING = 2,
54 PBV_MESSAGE_RX_ERROR = 3
55};
56typedef enum PBV_MESSAGE_RX_STATE PBV_MESSAGE_RX_STATE_t;
57
58
66typedef void (*func_p)(uint16_t, uint8_t *);
67
68
75 typedef struct {
76 uint16_t Length;
77 uint32_t PBV_Protcol_ID;
78 enum PBV_SIGNAL_ASCII_MODE PBV_Signal_Ascii;
79 PBV_MESSAGE_TX_STATE_t PBV_Message_State;
80 uint8_t * Data_Buffer;
81}PBV_Datatype_TX_t;
82
83
89 typedef struct {
90 uint16_t Length;
91 uint32_t PBV_Protcol_ID;
92 func_p Callback_Function ;
93 PBV_MESSAGE_RX_STATE_t PBV_Message_State;
94 uint8_t * Data_Buffer;
95}PBV_Datatype_RX_t;
96
98void App_PBV_Init(PBV_Datatype_TX_t * system_to_PBV, PBV_Datatype_TX_t * system_To_PBV_Ascii, PBV_Datatype_RX_t *App_PBV_To_System_Ptr);
99void App_Send_To_PBV (PBV_Datatype_TX_t * ptr);
100void App_Receive_From_PBV(PBV_Datatype_RX_t * ptr);
101int App_Read_Received_From_PBV(PBV_Datatype_RX_t * ptr);
102
103void PBV_Change_from_Sixteen_to_Eight(uint16_t * sixteen_ptr, uint8_t * eight_ptr, uint16_t length);
104void PBV_Change_from_Eight_to_Sixteen(uint8_t * eight_ptr, uint16_t * sixteen_ptr, uint16_t length);
105
106void App_PBV_Task_10ms(void);
107void App_PBV_Task_100us(void);
108
109void App_PBV_Re_Init(PBV_Datatype_TX_t * ptr);
110
111#endif /* APP_PBV_INTERFACE_H */
App_PBV_Task_100us
void App_PBV_Task_100us(void)
Task to be executed every 100 us.
Definition PBV_interface.c:244
PBV_Change_from_Sixteen_to_Eight
void PBV_Change_from_Sixteen_to_Eight(uint16_t *sixteen_ptr, uint8_t *eight_ptr, uint16_t length)
This function changes 16 bit data to 8 bit data.
Definition PBV_interface.c:46
App_PBV_Init
void App_PBV_Init(PBV_Datatype_TX_t *system_to_PBV, PBV_Datatype_TX_t *system_To_PBV_Ascii, PBV_Datatype_RX_t *App_PBV_To_System_Ptr)
Initializes the PBV init, by linking the application object pointers from the application to CAN or U...
Definition PBV_interface.c:103
PBV_MESSAGE_RX_STATE
PBV_MESSAGE_RX_STATE
Power Board Visualizer RX Object Receiving states.
Definition PBV_interface.h:50
App_PBV_Task_10ms
void App_PBV_Task_10ms(void)
task to be executed every 10ms
Definition PBV_interface.c:229
App_Send_To_PBV
void App_Send_To_PBV(PBV_Datatype_TX_t *ptr)
This function links the data from application object to the CAN or UART object and This function ch...
Definition PBV_interface.c:158
App_Read_Received_From_PBV
int App_Read_Received_From_PBV(PBV_Datatype_RX_t *ptr)
This function links the data received by CAN or UART objects to the application object.
Definition PBV_interface.c:182
App_PBV_Re_Init
void App_PBV_Re_Init(PBV_Datatype_TX_t *ptr)
Reinitializes the objects if any parameters( ID, length, etc) are to be changed to the CAN or UART ob...
Definition PBV_interface.c:122
PBV_SIGNAL_ASCII_MODE
PBV_SIGNAL_ASCII_MODE
< includes
Definition PBV_interface.h:22
PBV_MESSAGE_TX_STATE
PBV_MESSAGE_TX_STATE
Power Board Visualizer TX Object transmission states.
Definition PBV_interface.h:34
App_Receive_From_PBV
void App_Receive_From_PBV(PBV_Datatype_RX_t *ptr)
This function changes the state of the application object. this acts as a trigger for the periodic ta...
Definition PBV_interface.c:139
PBV_Change_from_Eight_to_Sixteen
void PBV_Change_from_Eight_to_Sixteen(uint8_t *eight_ptr, uint16_t *sixteen_ptr, uint16_t length)
This function changes 8 bit data to sixteen bit data.
Definition PBV_interface.c:64
PBV_MESSAGE_READY_TO_RECEIVE
@ PBV_MESSAGE_READY_TO_RECEIVE
Message Reception triggered.
Definition PBV_interface.h:52
PBV_STATE_RECEIVING
@ PBV_STATE_RECEIVING
Message beinf received.
Definition PBV_interface.h:53
PBV_MESSAGE_RECEIVED
@ PBV_MESSAGE_RECEIVED
Message Received.
Definition PBV_interface.h:51
PBV_MESSAGE_RX_ERROR
@ PBV_MESSAGE_RX_ERROR
if some error happens (CRC ?)
Definition PBV_interface.h:54
PBV_ASCII_MODE
@ PBV_ASCII_MODE
Object will transmit Ascii data.
Definition PBV_interface.h:24
PBV_SIGNAL_MODE
@ PBV_SIGNAL_MODE
Object will transmit/receive signals.
Definition PBV_interface.h:23
PBV_MESSAGE_TRANSMITTED
@ PBV_MESSAGE_TRANSMITTED
Message transmitted. successful transmit.
Definition PBV_interface.h:35
PBV_MESSAGE_INIT
@ PBV_MESSAGE_INIT
Init State. Only Send Messages in this State
Definition PBV_interface.h:36
PBV_MESSAGE_TX_ERROR
@ PBV_MESSAGE_TX_ERROR
if some error happens. unsuccessful transmit
Definition PBV_interface.h:39
PBV_MESSAGE_TRANSMIT_START
@ PBV_MESSAGE_TRANSMIT_START
Start Transmitting message.
Definition PBV_interface.h:37
PBV_MESSAGE_TRANSMITTING
@ PBV_MESSAGE_TRANSMITTING
Transmitting Message.
Definition PBV_interface.h:38
PBV_Datatype_TX_t
Definition PBV_interface.h:75
PBV_Datatype_TX_t::PBV_Protcol_ID
uint32_t PBV_Protcol_ID
Protocol ID.
Definition PBV_interface.h:77
PBV_Datatype_TX_t::Data_Buffer
uint8_t * Data_Buffer
Pointer to the data to be transmitted.
Definition PBV_interface.h:80
PBV_Datatype_TX_t::PBV_Signal_Ascii
enum PBV_SIGNAL_ASCII_MODE PBV_Signal_Ascii
Object will transmit Signals or ASCII.
Definition PBV_interface.h:78
PBV_Datatype_TX_t::PBV_Message_State
PBV_MESSAGE_TX_STATE_t PBV_Message_State
State of the TX object.
Definition PBV_interface.h:79
PBV_Datatype_TX_t::Length
uint16_t Length
Length of transmitted message in Bytes.
Definition PBV_interface.h:76
PBV_Datatype_RX_t
Definition PBV_interface.h:89
PBV_Datatype_RX_t::PBV_Protcol_ID
uint32_t PBV_Protcol_ID
Protocol ID of the received message.
Definition PBV_interface.h:91
PBV_Datatype_RX_t::PBV_Message_State
PBV_MESSAGE_RX_STATE_t PBV_Message_State
State of the received message.
Definition PBV_interface.h:93
PBV_Datatype_RX_t::Data_Buffer
uint8_t * Data_Buffer
Received Data pointer.
Definition PBV_interface.h:94
PBV_Datatype_RX_t::Length
uint16_t Length
Length of received message in Bytes.
Definition PBV_interface.h:90
PBV_Datatype_RX_t::Callback_Function
func_p Callback_Function
Callback function.
Definition PBV_interface.h:92