• G
    imxrt:uart: Add PINs init for each uart port · 9791c31c
    Gavin Liu 提交于
    Add PINs init function based on the selected UART port.
    
    In general, user should configure all necessary PINs based on
    the specific imxrt board in:
        bsp/imxrt/xxxx/board/MCUX_Config/pin_mux.c
    There is a convenient GUI tool named MCUXpresso Config Tools,
    it's free and can be obtained from NXP offical website. Open
    the file:
        bsp/imxrt/imxrt1052-nxp-evk/board/MCUX_Config/MCUX_Config.mex
    with MCUXpresso Config Tools, set the necessary PINs (or clocks)
    and generate the new code of pin_mux.c (or clock_config.c), the
    project can get right configurations based on specific imxrt
    board.
    
    But, there is no relation between RT-Thread Kconfig and MCUXpresso
    Config Tools. User selects one driver in RT-Thread menuconfig, then
    the ping_mux.c should be udpated by MCUXpresso Config Tools to set
    the right PIN configurations for the selected driver. It's clear
    but a little complex.
    
    We add the PIN init functions for some drivers in the board.c file,
    1. It's convenient to usr a driver in RT-Thread. Just select the
       driver, then the code will include all necessary parts, and the
       driver can work well.
    2. User can also configure the PINs with MCUXpresso Config Tools.
    3. The drivers in bsp/imxrt/libraries/drivers are common for all
       imxrt boards. They may have different PIN configurations based
       on different hardware design. So we put the PIN init functions
       in each board.c file following each different imxrt board.
    Signed-off-by: NGavin Liu <gavin-liugang@outlook.com>
    9791c31c
board.c 9.1 KB