Обновление платы на V2
This commit is contained in:
parent
20cc027f2e
commit
3df9b83c7e
98
Lins.c
98
Lins.c
|
|
@ -385,16 +385,27 @@ tLinData *Lin5_Init(lin_callback_ext_t Lin_ExtCallbackHandler) {
|
|||
tGpioInitStruct.ePinLevel = GPIO_HIGH;
|
||||
GPIO_InitPins(GPIO_A, &tGpioInitStruct);
|
||||
|
||||
// Port A6: MUX = GPIO output ENABLE
|
||||
tInitStruct.u32PortPins = PORT_PIN_6;
|
||||
// Port A6: MUX = GPIO output ENABLE Fix V2
|
||||
//tInitStruct.u32PortPins = PORT_PIN_6;
|
||||
//tInitStruct.uPortPinMux.u32PortPinMode = PORT_GPIO_MODE;
|
||||
//PORT_InitPins(PORT_A, &tInitStruct);
|
||||
|
||||
//tGpioInitStruct.u32GpioPins = GPIO_PIN_6;
|
||||
//tGpioInitStruct.ePinDirection = GPIO_OUT;
|
||||
//tGpioInitStruct.ePinLevel = GPIO_HIGH;
|
||||
//GPIO_InitPins(GPIO_A, &tGpioInitStruct);
|
||||
|
||||
// Port A7: MUX = GPIO output ENABLE
|
||||
tInitStruct.u32PortPins = PORT_PIN_7;
|
||||
tInitStruct.uPortPinMux.u32PortPinMode = PORT_GPIO_MODE;
|
||||
PORT_InitPins(PORT_A, &tInitStruct);
|
||||
|
||||
tGpioInitStruct.u32GpioPins = GPIO_PIN_6;
|
||||
tGpioInitStruct.u32GpioPins = GPIO_PIN_7;
|
||||
tGpioInitStruct.ePinDirection = GPIO_OUT;
|
||||
tGpioInitStruct.ePinLevel = GPIO_HIGH;
|
||||
GPIO_InitPins(GPIO_A, &tGpioInitStruct);
|
||||
|
||||
|
||||
LIN_Initial(
|
||||
&env->lin5,
|
||||
FCUART0,
|
||||
|
|
@ -421,4 +432,83 @@ tLinData *Lin5_Init(lin_callback_ext_t Lin_ExtCallbackHandler) {
|
|||
|
||||
//конец--------------------------LIN 5-------------------------------------------------
|
||||
//конец--------------------------LIN 5-------------------------------------------------
|
||||
//конец--------------------------LIN 5-------------------------------------------------
|
||||
//конец--------------------------LIN 5-------------------------------------------------
|
||||
|
||||
|
||||
//начало--------------------------LIN 6-------------------------------------------------
|
||||
//начало--------------------------LIN 6-------------------------------------------------
|
||||
//начало--------------------------LIN 6-------------------------------------------------
|
||||
static void Lin6CallbackHandler(uint8_t u8LinIndex, void *state) {
|
||||
LIN_PORTS.lin6.LinExtCallbackHandler(LIN_PORTS.lin6.envCallExtBack, u8LinIndex, state);
|
||||
}
|
||||
|
||||
void FCUART6_RxTx_IRQHandler(void) {
|
||||
LIN_DrvIRQHandler(LIN_PORTS.lin6.UART_INDEX);
|
||||
}
|
||||
|
||||
tLinData *Lin6_Init(lin_callback_ext_t Lin_ExtCallbackHandler) {
|
||||
|
||||
tLinPorts *env = &LIN_PORTS;
|
||||
|
||||
PORT_InitType tInitStruct = {0};
|
||||
GPIO_InitType tGpioInitStruct = {0};
|
||||
|
||||
// Port C10: MUX = ALT4, UART6_RX
|
||||
tInitStruct.u32PortPins = PORT_PIN_10;
|
||||
tInitStruct.uPortPinMux.u32PortPinMode = PORTC_10_FCUART6_RX;
|
||||
tInitStruct.bPullEn = true;
|
||||
tInitStruct.ePullSel = PORT_PULL_UP;
|
||||
PORT_InitPins(PORT_C, &tInitStruct);
|
||||
|
||||
tGpioInitStruct.u32GpioPins = GPIO_PIN_10;
|
||||
tGpioInitStruct.ePinDirection = GPIO_IN;
|
||||
GPIO_InitPins(GPIO_C, &tGpioInitStruct);
|
||||
|
||||
// Port C11: MUX = ALT4, UART6_TX
|
||||
tInitStruct.u32PortPins = PORT_PIN_11;
|
||||
tInitStruct.uPortPinMux.u32PortPinMode = PORTC_11_FCUART6_TX;
|
||||
PORT_InitPins(PORT_C, &tInitStruct);
|
||||
|
||||
tGpioInitStruct.u32GpioPins = GPIO_PIN_11;
|
||||
tGpioInitStruct.ePinDirection = GPIO_OUT;
|
||||
tGpioInitStruct.ePinLevel = GPIO_HIGH;
|
||||
GPIO_InitPins(GPIO_C, &tGpioInitStruct);
|
||||
|
||||
// Port C9: MUX = GPIO output ENABLE
|
||||
tInitStruct.u32PortPins = PORT_PIN_9;
|
||||
tInitStruct.uPortPinMux.u32PortPinMode = PORT_GPIO_MODE;
|
||||
PORT_InitPins(PORT_C, &tInitStruct);
|
||||
|
||||
tGpioInitStruct.u32GpioPins = GPIO_PIN_9;
|
||||
tGpioInitStruct.ePinDirection = GPIO_OUT;
|
||||
tGpioInitStruct.ePinLevel = GPIO_HIGH;
|
||||
GPIO_InitPins(GPIO_C, &tGpioInitStruct);
|
||||
|
||||
|
||||
LIN_Initial(
|
||||
&env->lin6,
|
||||
FCUART6,
|
||||
9600,
|
||||
|
||||
0, // UART0 = 0 ... UART7 = 7
|
||||
FCUART6_IRQn, // FCUART0_IRQn ... FCUART7_IRQn
|
||||
0xFF,
|
||||
|
||||
NULL,
|
||||
Lin6CallbackHandler,
|
||||
Lin_ExtCallbackHandler,
|
||||
&env->lin6.linData,
|
||||
|
||||
NULL,
|
||||
0
|
||||
|
||||
);
|
||||
|
||||
env->lin6_Io = vLinGetIo(&env->lin6);
|
||||
|
||||
return &env->lin6.linData;
|
||||
}
|
||||
|
||||
//конец--------------------------LIN 6-------------------------------------------------
|
||||
//конец--------------------------LIN 6-------------------------------------------------
|
||||
//конец--------------------------LIN 6---------------------------------------------
|
||||
4
Lins.h
4
Lins.h
|
|
@ -44,6 +44,9 @@ typedef struct {
|
|||
tLinFlagchip lin5;
|
||||
tLinIO lin5_Io;
|
||||
|
||||
tLinFlagchip lin6;
|
||||
tLinIO lin6_Io;
|
||||
|
||||
} tLinPorts;
|
||||
|
||||
extern tLinPorts LIN_PORTS;
|
||||
|
|
@ -53,5 +56,6 @@ tLinData *Lin2_Init(lin_callback_ext_t Lin_ExtCallbackHandler);
|
|||
tLinData *Lin3_Init(lin_callback_ext_t Lin_ExtCallbackHandler);
|
||||
tLinData *Lin4_Init(lin_callback_ext_t Lin_ExtCallbackHandler);
|
||||
tLinData *Lin5_Init(lin_callback_ext_t Lin_ExtCallbackHandler);
|
||||
tLinData *Lin6_Init(lin_callback_ext_t Lin_ExtCallbackHandler);
|
||||
|
||||
#endif //FLAG_LINS_H
|
||||
|
|
|
|||
Loading…
Reference in New Issue