56 lines
1.6 KiB
C
56 lines
1.6 KiB
C
|
#ifndef PDS_H__
|
||
|
#define PDS_H__
|
||
|
|
||
|
#include <stdint.h>
|
||
|
#include <stdbool.h>
|
||
|
#include <taskManager.h>
|
||
|
|
||
|
/**************************************************************************************************/
|
||
|
|
||
|
typedef struct{
|
||
|
uint8_t frameId;
|
||
|
uint8_t frameIsValid;
|
||
|
}FrameID_t;
|
||
|
|
||
|
/**************************************************************************************************/
|
||
|
/* lin parameters */
|
||
|
typedef union{
|
||
|
/* 16 + 32*2 = 80 */
|
||
|
struct{
|
||
|
uint16_t fwVersion; /* Reserved should be LINS_FW_VERSION */
|
||
|
uint16_t hwVersion; /* Reserved should be LINS_HW_VERSION */
|
||
|
uint32_t serialNo; /* Reserved should be LINS_SERIAL_NO */
|
||
|
uint16_t supplierID; /* Reserved should be LINS_SUPPLIER_ID */
|
||
|
uint16_t functionID; /* Reserved should be LINS_FUNCTION_ID */
|
||
|
uint8_t variant; /* Reserved should be LINS_VARIANT */
|
||
|
uint8_t nad;
|
||
|
uint8_t frameIDSize;
|
||
|
FrameID_t frameInfo[32];
|
||
|
};
|
||
|
uint8_t payload[96U];
|
||
|
}LINClusterParams_t;
|
||
|
/**************************************************************************************************/
|
||
|
|
||
|
typedef enum{
|
||
|
PDS_STATUS_USING_NORMAL,
|
||
|
PDS_STATUS_USING_BACKUP,
|
||
|
PDS_STATUS_USING_DEFAULT,
|
||
|
}PdsStatus_t;
|
||
|
|
||
|
|
||
|
typedef struct{
|
||
|
struct{
|
||
|
uint32_t crc32;
|
||
|
uint32_t index;
|
||
|
}head; /* size = 8 bytes */
|
||
|
struct{
|
||
|
LINClusterParams_t linParams; /* size = 96 bytes */
|
||
|
}info;
|
||
|
}SystemParams_t;
|
||
|
|
||
|
LINClusterParams_t *PDS_GetLINParam(void);
|
||
|
PdsStatus_t PDS_GetPdsStatus(void);
|
||
|
void PDS_Init(void);
|
||
|
void PDS_TaskHandler(void);
|
||
|
|
||
|
#endif
|