Bar Logo 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
26
27
41typedef enum PBV_MESSAGE_TX_STATE PBV_MESSAGE_TX_STATE_t;
42
43
56typedef enum PBV_MESSAGE_RX_STATE PBV_MESSAGE_RX_STATE_t;
57
58
66typedef void (*func_p)(uint16_t, uint8_t *);
67
68
75typedef struct {
76 uint16_t Length;
77 uint32_t PBV_Protcol_ID;
79 PBV_MESSAGE_TX_STATE_t PBV_Message_State;
80 uint8_t * Data_Buffer;
82
83
89typedef struct {
90 uint16_t Length;
91 uint32_t PBV_Protcol_ID;
93 PBV_MESSAGE_RX_STATE_t PBV_Message_State;
94 uint8_t * Data_Buffer;
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);
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
110
111#endif /* APP_PBV_INTERFACE_H */
void App_PBV_Task_100us(void)
Task to be executed every 100 us.
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.
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...
PBV_MESSAGE_RX_STATE
Power Board Visualizer RX Object Receiving states.
void App_PBV_Task_10ms(void)
task to be executed every 10ms
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...
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.
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...
PBV_SIGNAL_ASCII_MODE
< includes
PBV_MESSAGE_TX_STATE
Power Board Visualizer TX Object transmission states.
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...
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.
@ PBV_MESSAGE_READY_TO_RECEIVE
Message Reception triggered.
@ PBV_STATE_RECEIVING
Message beinf received.
@ PBV_MESSAGE_RECEIVED
Message Received.
@ PBV_MESSAGE_RX_ERROR
if some error happens (CRC ?)
@ PBV_ASCII_MODE
Object will transmit Ascii data.
@ PBV_SIGNAL_MODE
Object will transmit/receive signals.
@ PBV_MESSAGE_TRANSMITTED
Message transmitted. successful transmit.
@ PBV_MESSAGE_INIT
Init State. Only Send Messages in this State
@ PBV_MESSAGE_TX_ERROR
if some error happens. unsuccessful transmit
@ PBV_MESSAGE_TRANSMIT_START
Start Transmitting message.
@ PBV_MESSAGE_TRANSMITTING
Transmitting Message.
uint32_t PBV_Protcol_ID
Protocol ID.
uint8_t * Data_Buffer
Pointer to the data to be transmitted.
enum PBV_SIGNAL_ASCII_MODE PBV_Signal_Ascii
Object will transmit Signals or ASCII.
PBV_MESSAGE_TX_STATE_t PBV_Message_State
State of the TX object.
uint16_t Length
Length of transmitted message in Bytes.
uint32_t PBV_Protcol_ID
Protocol ID of the received message.
PBV_MESSAGE_RX_STATE_t PBV_Message_State
State of the received message.
uint8_t * Data_Buffer
Received Data pointer.
uint16_t Length
Length of received message in Bytes.
func_p Callback_Function
Callback function.