3#include "config/comms_config.h"
4#include "PBV_interface.h"
48 for (uint16_t i = 0, j = 0; i < (length * 2); i = i + 2, j++)
50 eightPtr[i] = (uint8_t) (sixteenPtr[j] >> 8);
51 eightPtr[i + 1] = (uint8_t) (sixteenPtr[j] & 0x00FF);
66 uint8_t length_odd = (uint8_t) (length & 0x01);
73 length_t = (length & 0xFFFE);
80 for (i = 0, j = 0; i < length_t; i = i + 2, j++)
82 sixteenPtr[j] = ((uint16_t) (eightPtr[i] << 8)) + eightPtr[i + 1];
86 sixteenPtr[++j] = ((uint16_t) (eightPtr[length-1] << 8));
106 appSystemToPbvAsciiPtr = boardToPpvAscii;
void App_PBV_Task_100us()
Task to be executed every 100 us.
void PBV_Change_from_Sixteen_to_Eight(uint16_t *sixteenPtr, uint8_t *eightPtr, uint16_t length)
This function changes 16 bit data to 8 bit data.
void App_PBV_Init(PBV_Datatype_TX_t *boardToPbv, PBV_Datatype_TX_t *boardToPpvAscii, PBV_Datatype_RX_t *pbvToBoard)
Initializes the PBV init, by linking the application object pointers from the application to CAN or U...
void App_PBV_Task_10ms()
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...
const APP_PBV_INTF_API_t appPbvFuncs
< Includes
static PBV_Datatype_RX_t * appPbvToSystemPtr
pointer to the PBV_Datatype_RX_t object that will be passed from the application.
static void App_PBV_Task(void)
Main application task for Power Board Visualizer.
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.
static PBV_Datatype_TX_t * appSystemToPbvPtr
pointer to the PBV_Datatype_TX_t object that will be passed from the application.
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...
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 *eightPtr, uint16_t *sixteenPtr, 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_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.
structure of API function pointers.
PBV_Intf_Link_Data_TX_t linkDataTX
PBV_Intf_Transmit_Ascii_to_GUI_t txGuiAscii
PBV_Intf_Link_Data_RX_t linkDataRX
PBV_Intf_Transmit_to_GUI_t txGui
PBV_Intf_Receive_from_GUI_t rxGui
PBV_MESSAGE_TX_STATE_t PBV_Message_State
State of the TX object.
PBV_MESSAGE_RX_STATE_t PBV_Message_State
State of the received message.