/*!
 * @file     Usart_Cfg.c
 *
 * @version  1.0.0
 *
 * @brief    The source file of the UART driver.
 *
 * @details  This source file contains the API specification and other variables of the Common UART driver.
 *
 */
/**********************************************************************************************************************
* Project Name      : AUTOSAR MCAL
* Platform          : Arm
* Autosar Standard  : Classic Platform 4.4.0
* Revision Number   :
* Compiled Version  : G32A10xx_MCAL_1_0_0_01-Otc-25
*
* Copyright (C) 2026 Geehy Semiconductor
*
* You may not use this file except in compliance with the GEEHY COPYRIGHT NOTICE
* (Geehy Semiconductor Software License Agreement).
*
* The program is only for reference, which is distributed in the hope that it
* will be useful and instructional for customers to develop their software.
* Unless required by applicable law or agreed to in writing, the program is
* distributed on an "AS IS" BASIS, WITHOUT ANY WARRANTY OR CONDITIONS OF ANY
* KIND, either express or implied. See the Geehy Semiconductor Software License Agreement for
* the governing permissions and limitations under the License.
*
***********************************************************************************************************************/

#ifdef __cplusplus
extern "C"{
#endif  /* ifdef __cplusplus */

#include "Std_Types.h"
#include "Usart_Reg.h"
#include "CDD_Usart.h"
#include "Mcu_RcmTypes.h"
#include "CDD_Usart_Cfg.h"
 

#if (STD_ON == USART_DMA_SUPPORT)
#include "Pdl_DmaTypes.h"
#endif

/***********************************************************************************************************************
                                    VENDOR ID & AUTOSAR VERSION INFO
***********************************************************************************************************************/
/** Vendor ID (vendorId) of the dedicated implementation of this module according to the AUTOSAR vendor list. */
#define USART_CFG_VENDOR_ID                              0x00C1U
/** Major version number of AUTOSAR release on which the appropriate implementation is based on. */
#define USART_CFG_AR_RELEASE_MAJOR_VERSION               0x04U
/** Minor version number of AUTOSAR release on which the appropriate implementation is based on. */
#define USART_CFG_AR_RELEASE_MINOR_VERSION               0x04U
/** Revision version number of AUTOSAR release on which the appropriate implementation is based on. */
#define USART_CFG_AR_RELEASE_REVISION_VERSION            0x00U
/** Major version number of the vendor specific implementation of the module. The numbering is vendor specific. */ 
#define USART_CFG_SW_MAJOR_VERSION                       0x01U
/** Minor version number of the vendor specific implementation of the module. The numbering is vendor specific. */
#define USART_CFG_SW_MINOR_VERSION                       0x00U
/** Patch level version number of the vendor specific implementation of the module. The numbering is vendor specific. */
#define USART_CFG_SW_PATCH_VERSION                       0x00U

/**********************************************************************************************************************
                                        VERSION INFOMATION VERIFICATION
***********************************************************************************************************************/


/**********************************************************************************************************************
                                             GLOBAL VARIABLE
***********************************************************************************************************************/
/* Pointer to lpuart runtime state structure */
const Usart_SyncConfigType g_usartSyncConfg[USART_CHANNEL_NUM] = 
{
#if (STD_ON == USART1_ENABLE)
    {
        .clkPol = USART_CPOL_LOW,
        .clkPha = USART_CPHA_1EDGE,
        .lastBitOutput = TRUE,
    },
#endif
#if (STD_ON == USART2_ENABLE)
    {
        .clkPol = USART_CPOL_LOW,
        .clkPha = USART_CPHA_1EDGE,
        .lastBitOutput = TRUE,
    }
#endif
};


/* Pointer to lpuart runtime state structure */
const Usart_ConfigType g_usartConfg[USART_CHANNEL_NUM] = 
{
#if (STD_ON == USART1_ENABLE)
    {
        .usartId = USART1_ID,
        .transferType = USART_USE_INTERRUPTS,
        .modeSelect = USART_FULL_DUPLEX_ASYN,
        .baudRate = 115200,
        .wordLength = USART_WORD_LEN_8B,
        .stopBits = USART_STOP_BIT_1,
        .parity = USART_PARITY_NONE,
        .mode = USART_MODE_TX_RX,
        .hardwareFlowCtrl = USART_FLOW_CTRL_NONE,
        .txDmaChannel = 2,
        .rxDmaChannel = 3,

    },
#endif
#if (STD_ON == USART2_ENABLE)
    {
        .usartId = USART2_ID,
        .transferType = USART_USE_INTERRUPTS,
        .modeSelect = USART_FULL_DUPLEX_ASYN,
        .baudRate = 115200,
        .wordLength = USART_WORD_LEN_8B,
        .stopBits = USART_STOP_BIT_1,
        .parity = USART_PARITY_NONE,
        .mode = USART_MODE_TX_RX,
        .hardwareFlowCtrl = USART_FLOW_CTRL_NONE,
        .txDmaChannel = 4,
        .rxDmaChannel = 5,
    }
#endif
};

#ifdef __cplusplus
}
#endif  /* ifdef __cplusplus */

