55 lines
1.2 KiB
C
55 lines
1.2 KiB
C
//
|
|
// Created by cfif on 17.11.22.
|
|
//
|
|
|
|
#ifndef LIN_FLAGCHIP_H
|
|
#define LIN_FLAGCHIP_H
|
|
|
|
#include "LinIO.h"
|
|
#include "cmsis_os2.h"
|
|
#include "fc7xxx_driver_adc.h"
|
|
#include "fc7xxx_driver_pcc.h"
|
|
#include "interrupt_manager.h"
|
|
#include "fc7xxx_driver_lin.h"
|
|
|
|
// LIN protocol ID definition
|
|
#define LIN_MASTER_SEND_ID (0x01U)
|
|
#define LIN_MASTER_RECEIVE_ID (0x02U)
|
|
#define LIN_MASTER_GO_TO_SLEEP_ID (0x03U)
|
|
|
|
typedef struct {
|
|
|
|
uint8_t UART_INDEX;
|
|
FCUART_Type *UART;
|
|
|
|
osMessageQueueId_t rxDataQueue;
|
|
|
|
lin_config_t g_linMasterConfig;
|
|
lin_xfer_state_t g_xferMasterState;
|
|
|
|
uint8_t g_aTxBuffer[8];
|
|
uint8_t g_aRxBuffer[8];
|
|
|
|
} tLinFlagchip;
|
|
|
|
void LIN_Initial(
|
|
tLinFlagchip *env,
|
|
FCUART_Type *uart,
|
|
uint32_t BoundRate,
|
|
|
|
uint8 UART_INDEX, // UART0 = 0 ... UART7 = 7
|
|
IRQn_Type IRQ_UART, // FCUART0_IRQn ... FCUART7_IRQn
|
|
uint8 UART_PRIORITY,
|
|
|
|
lin_get_interval_time_t LIN_TimerGetTimeIntervalValue,
|
|
lin_callback_t LinCallbackHandler
|
|
);
|
|
|
|
void GetLinCallbackHandler(tLinFlagchip *env, uint8_t u8LinIndex, void *state);
|
|
|
|
void Get_LIN_Result(tLinFlagchip *env);
|
|
|
|
tLinIO vLinGetIo(tLinFlagchip *env);
|
|
|
|
#endif //LIN_FLAGCHIP_H
|