-
Notifications
You must be signed in to change notification settings - Fork 5.4k
[bsp][imxrt1180-nxp-evk]add I2C adapter support #11510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -73,7 +73,7 @@ void BOARD_InitPins(void) { | |
| 0U); /* Software Input On Field: Input Path is determined by functionality */ | ||
| IOMUXC_SetPinMux( | ||
| IOMUXC_GPIO_AON_09_LPUART1_RX, /* GPIO_AON_09 is configured as LPUART1_RX */ | ||
| 0U); /* Software Input On Field: Input Path is determined by functionality */ | ||
| 1U); /* Software Input On Field: Force input path of pad GPIO_AON_09 */ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这边应该不需要修改 |
||
| IOMUXC_SetPinConfig( | ||
| IOMUXC_GPIO_AON_08_LPUART1_TX, /* GPIO_AON_08 PAD functional properties : */ | ||
| 0x02U); /* Slew Rate Field: Fast Slew Rate | ||
|
|
@@ -88,6 +88,25 @@ void BOARD_InitPins(void) { | |
| Pull / Keep Select Field: Pull Disable, Highz | ||
| Pull Up / Down Config. Field: Weak pull down | ||
| Open Drain Field: Disabled */ | ||
|
|
||
| IOMUXC_SetPinMux( | ||
| IOMUXC_GPIO_AON_16_LPI2C2_SCL, /* GPIO_AON_16 is configured as LPI2C2_SCL */ | ||
| 0U); /* Software Input On Field: Input Path is determined by functionality */ | ||
| IOMUXC_SetPinMux( | ||
| IOMUXC_GPIO_AON_15_LPI2C2_SDA, /* GPIO_AON_15 is configured as LPI2C2_SDA */ | ||
| 0U); /* Software Input On Field: Input Path is determined by functionality */ | ||
| IOMUXC_SetPinConfig( | ||
| IOMUXC_GPIO_AON_16_LPI2C2_SCL, /* GPIO_AON_16 PAD functional properties : */ | ||
| 0x1DU); /* Slew Rate Field: Slow Slew Rate | ||
| Pull Enable Field: Pull Enable | ||
| Pull Up / Down Config. Field: Weak pull up | ||
| Open Drain Field: Enabled */ | ||
| IOMUXC_SetPinConfig( | ||
| IOMUXC_GPIO_AON_15_LPI2C2_SDA, /* GPIO_AON_15 PAD functional properties : */ | ||
| 0x1DU); /* Slew Rate Field: Slow Slew Rate | ||
| Pull Enable Field: Pull Enable | ||
| Pull Up / Down Config. Field: Weak pull up | ||
| Open Drain Field: Enabled */ | ||
| } | ||
|
|
||
| void BOARD_InitLeds(void) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,10 @@ if rtconfig.PLATFORM in ['iccarm']: | |
| CPPDEFINES += ['NDEBUG'] | ||
| # CPPDEFINES += ['FSL_SDK_DRIVER_QUICK_ACCESS_ENABLE=1'] | ||
|
|
||
| if GetDepend(['BSP_USING_I2C']): | ||
| src += ['../packages/nxp-imxrt-sdk-latest/MIMXRT1180/MIMXRT1189/drivers/fsl_lpi2c.c'] | ||
| CPPPATH += [cwd + '/../packages/nxp-imxrt-sdk-latest/MIMXRT1180/MIMXRT1189/drivers'] | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这边麻烦更新package对应的repo:https://github.com/RT-Thread-packages/nxp-imxrt-sdk |
||
| group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES=CPPDEFINES) | ||
|
|
||
| Return('group') | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,7 +60,7 @@ void BOARD_InitPins(void) { | |
| 0U); /* Software Input On Field: Input Path is determined by functionality */ | ||
| IOMUXC_SetPinMux( | ||
| IOMUXC_GPIO_AON_09_LPUART1_RX, /* GPIO_AON_09 is configured as LPUART1_RX */ | ||
| 0U); /* Software Input On Field: Input Path is determined by functionality */ | ||
| 1U); /* Software Input On Field: Force input path of pad GPIO_AON_09 */ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这边应该也不用改 |
||
| IOMUXC_SetPinConfig( | ||
| IOMUXC_GPIO_AON_08_LPUART1_TX, /* GPIO_AON_08 PAD functional properties : */ | ||
| 0x02U); /* Slew Rate Field: Fast Slew Rate | ||
|
|
@@ -75,6 +75,25 @@ void BOARD_InitPins(void) { | |
| Pull / Keep Select Field: Pull Disable, Highz | ||
| Pull Up / Down Config. Field: Weak pull down | ||
| Open Drain Field: Disabled */ | ||
|
|
||
| IOMUXC_SetPinMux( | ||
| IOMUXC_GPIO_AON_16_LPI2C2_SCL, /* GPIO_AON_16 is configured as LPI2C2_SCL */ | ||
| 0U); /* Software Input On Field: Input Path is determined by functionality */ | ||
| IOMUXC_SetPinMux( | ||
| IOMUXC_GPIO_AON_15_LPI2C2_SDA, /* GPIO_AON_15 is configured as LPI2C2_SDA */ | ||
| 0U); /* Software Input On Field: Input Path is determined by functionality */ | ||
| IOMUXC_SetPinConfig( | ||
| IOMUXC_GPIO_AON_16_LPI2C2_SCL, /* GPIO_AON_16 PAD functional properties : */ | ||
| 0x1DU); /* Slew Rate Field: Slow Slew Rate | ||
| Pull Enable Field: Pull Enable | ||
| Pull Up / Down Config. Field: Weak pull up | ||
| Open Drain Field: Enabled */ | ||
| IOMUXC_SetPinConfig( | ||
| IOMUXC_GPIO_AON_15_LPI2C2_SDA, /* GPIO_AON_15 PAD functional properties : */ | ||
| 0x1DU); /* Slew Rate Field: Slow Slew Rate | ||
| Pull Enable Field: Pull Enable | ||
| Pull Up / Down Config. Field: Weak pull up | ||
| Open Drain Field: Enabled */ | ||
| } | ||
|
|
||
| /*********************************************************************************************************************** | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,10 @@ if rtconfig.PLATFORM in ['armcc', 'armclang']: | |
| if rtconfig.PLATFORM in ['iccarm']: | ||
| CPPDEFINES += ['NDEBUG'] | ||
|
|
||
| if GetDepend(['BSP_USING_I2C']): | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这段不应该添加到这里,这部分是软件包去添加的,要添加也要给这提交PR:https://github.com/RT-Thread-packages/nxp-imxrt-sdk/blob/master/MIMXRT1180/SConscript |
||
| src += ['../packages/nxp-imxrt-sdk-latest/MIMXRT1180/MIMXRT1189/drivers/fsl_lpi2c.c'] | ||
| CPPPATH += [cwd + '/../packages/nxp-imxrt-sdk-latest/MIMXRT1180/MIMXRT1189/drivers'] | ||
|
|
||
| group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES=CPPDEFINES) | ||
|
|
||
| Return('group') | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个文件不用修改添加用户代码