33 lines
1.2 KiB
C
33 lines
1.2 KiB
C
#ifndef IVEC_BSW_DISPLAY_H
|
|
#define IVEC_BSW_DISPLAY_H
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
|
|
typedef enum
|
|
{
|
|
DISPLAY_STATUS_OK = 0,
|
|
DISPLAY_STATUS_INVALID_PARAM,
|
|
DISPLAY_STATUS_NOT_INITIALIZED,
|
|
DISPLAY_STATUS_WRITE_FAIL,
|
|
DISPLAY_STATUS_FRAME_TOO_LONG
|
|
} IVEC_BswDisplayStatus_e;
|
|
|
|
typedef struct
|
|
{
|
|
void *pvUart; /* ECU UART handle (any port) */
|
|
bool bInit;
|
|
bool bFlushBeforeWrite;
|
|
uint8_t u8WriteCmd;
|
|
} BswDisplayCtx_s;
|
|
|
|
IVEC_BswDisplayStatus_e IVEC_BswDisplay_Init(BswDisplayCtx_s *ctx, void *uart_handle, bool flush_before_write);
|
|
void IVEC_BswDisplay_SetHandle(BswDisplayCtx_s *ctx, void *uart_handle);
|
|
void IVEC_BswDisplay_Deinit(BswDisplayCtx_s *ctx);
|
|
IVEC_BswDisplayStatus_e IVEC_BswDisplay_WriteRaw(BswDisplayCtx_s *ctx, const uint8_t *buf, uint16_t len);
|
|
IVEC_BswDisplayStatus_e IVEC_BswDisplay_WriteFrame(BswDisplayCtx_s *ctx, uint8_t cmd, uint8_t addr_hi, uint8_t addr_lo, const uint8_t *payload, uint16_t payload_len);
|
|
IVEC_BswDisplayStatus_e IVEC_BswDisplay_WriteSOC(BswDisplayCtx_s *ctx, uint8_t slot, uint8_t soc);
|
|
IVEC_BswDisplayStatus_e IVEC_BswDisplay_WriteSOC9(BswDisplayCtx_s *ctx, const uint8_t soc9[9]);
|
|
|
|
#endif /* IVEC_BSW_DISPLAY_H */
|