mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-10-02 14:23:19 +08:00
[bsp][nxp] Add RTduino support for FRDM-MCXA366 (#11594)
* 在FRDM-MCXA366工程内 修改main函数 添加uart_int_sample程序,实现串口的交互。在BOARD_InitPins函数内添加串口3的引脚初始化代码 * 根据 FRDM-MCXA366 的 Arduino 接口定义(J1/J2),完成了 RTduino 引脚映射表的编写。完成RTduino的D13(对应板子的P3_10)引脚控制测试,串口测试 * 已删除 RTE 文件夹,已恢复原始 main.c 的 LED 闪烁功能 * 完成ci * remove RTE folder from tracking
This commit is contained in:
@@ -52,7 +52,18 @@ Peripheral.slcd:
|
||||
utest.pin:
|
||||
<<: *scons
|
||||
kconfig:
|
||||
- CONFIG_RT_USING_UTESTCASES=y
|
||||
- CONFIG_RT_CONSOLEBUF_SIZE=256
|
||||
- CONFIG_RT_UTEST_PIN=y
|
||||
|
||||
# 原有配置
|
||||
- CONFIG_BSP_USING_ARDUINO=y
|
||||
# RTduino core
|
||||
- CONFIG_RT_USING_RTDUINO=y
|
||||
# UART for Serial (console) - D0/D1
|
||||
- CONFIG_BSP_USING_UART2=y
|
||||
- CONFIG_RTDUINO_SERIAL2_DEVICE_NAME="uart2"
|
||||
# I2C for Wire - D18/D19
|
||||
- CONFIG_BSP_USING_I2C2=y
|
||||
# SPI for SPI - D10-D13
|
||||
- CONFIG_BSP_USING_SPI1=y
|
||||
# PWM support - D3/D5/D6/D9
|
||||
- CONFIG_BSP_USING_PWM=y
|
||||
# ADC support - A0-A5
|
||||
- CONFIG_BSP_USING_ADC=y
|
||||
File diff suppressed because it is too large
Load Diff
@@ -46,4 +46,4 @@ const pin_map_t pin_map_table[]=
|
||||
{A4, GET_PINS(1,0),"i2c1"}, /* I2C-SDA (Wire) */
|
||||
{A5, GET_PINS(1,1),"i2c1"}, /* I2C-SCL (Wire) */
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
static rt_bool_t led_state = RT_FALSE; /* Current LED state */
|
||||
|
||||
|
||||
|
||||
/* Button interrupt callback function */
|
||||
void button_irq_callback(void *args)
|
||||
{
|
||||
@@ -48,6 +49,7 @@ int main(void)
|
||||
|
||||
/* Configure button pin as input with pull-up */
|
||||
rt_pin_mode(BUTTON_PIN, PIN_MODE_INPUT_PULLUP);
|
||||
|
||||
|
||||
/* Attach interrupt to button pin */
|
||||
rt_pin_attach_irq(BUTTON_PIN, PIN_IRQ_MODE_FALLING, button_irq_callback, RT_NULL);
|
||||
|
||||
@@ -113,7 +113,55 @@ void BOARD_InitPins(void)
|
||||
/* PORT2_3 (pin 36) is configured as LPUART2_RXD */
|
||||
PORT_SetPinConfig(PORT2, 3U, &port2_3_pin36_config);
|
||||
|
||||
const port_pin_config_t port4_2_pin_config = {/* Internal pull-up resistor is enabled */
|
||||
.pullSelect = kPORT_PullUp,
|
||||
/* Low internal pull resistor value is selected. */
|
||||
.pullValueSelect = kPORT_LowPullResistor,
|
||||
/* Fast slew rate is configured */
|
||||
.slewRate = kPORT_FastSlewRate,
|
||||
/* Passive input filter is disabled */
|
||||
.passiveFilterEnable = kPORT_PassiveFilterDisable,
|
||||
/* Open drain output is disabled */
|
||||
.openDrainEnable = kPORT_OpenDrainDisable,
|
||||
/* Low drive strength is configured */
|
||||
.driveStrength = kPORT_LowDriveStrength,
|
||||
/* Normal drive strength is configured */
|
||||
.driveStrength1 = kPORT_NormalDriveStrength,
|
||||
/* Pin is configured as LPUART2_TXD */
|
||||
.mux = kPORT_MuxAlt3,
|
||||
/* Digital input enabled */
|
||||
.inputBuffer = kPORT_InputBufferEnable,
|
||||
/* Digital input is not inverted */
|
||||
.invertInput = kPORT_InputNormal,
|
||||
/* Pin Control Register fields [15:0] are not locked */
|
||||
.lockRegister = kPORT_UnlockRegister};
|
||||
/* PORT2_2 (pin 35) is configured as LPUART2_TXD */
|
||||
PORT_SetPinConfig(PORT4, 2U, &port4_2_pin_config);
|
||||
|
||||
const port_pin_config_t port4_5_pin_config = {/* Internal pull-up resistor is enabled */
|
||||
.pullSelect = kPORT_PullUp,
|
||||
/* Low internal pull resistor value is selected. */
|
||||
.pullValueSelect = kPORT_LowPullResistor,
|
||||
/* Fast slew rate is configured */
|
||||
.slewRate = kPORT_FastSlewRate,
|
||||
/* Passive input filter is disabled */
|
||||
.passiveFilterEnable = kPORT_PassiveFilterDisable,
|
||||
/* Open drain output is disabled */
|
||||
.openDrainEnable = kPORT_OpenDrainDisable,
|
||||
/* Low drive strength is configured */
|
||||
.driveStrength = kPORT_LowDriveStrength,
|
||||
/* Normal drive strength is configured */
|
||||
.driveStrength1 = kPORT_NormalDriveStrength,
|
||||
/* Pin is configured as LPUART2_RXD */
|
||||
.mux = kPORT_MuxAlt3,
|
||||
/* Digital input enabled */
|
||||
.inputBuffer = kPORT_InputBufferEnable,
|
||||
/* Digital input is not inverted */
|
||||
.invertInput = kPORT_InputNormal,
|
||||
/* Pin Control Register fields [15:0] are not locked */
|
||||
.lockRegister = kPORT_UnlockRegister};
|
||||
/* PORT2_3 (pin 36) is configured as LPUART2_RXD */
|
||||
PORT_SetPinConfig(PORT4, 5U, &port4_5_pin_config);
|
||||
const port_pin_config_t LED_RED = {/* Internal pull-up/down resistor is disabled */
|
||||
.pullSelect = kPORT_PullDisable,
|
||||
/* Low internal pull resistor value is selected. */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -10,13 +10,13 @@
|
||||
<TargetName>rtthread-frdm-mcxa366</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>6230000::V6.23::ARMCLANG</pCCUsed>
|
||||
<pCCUsed>6240000::V6.24::ARMCLANG</pCCUsed>
|
||||
<uAC6>1</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
<Device>MCXA366VLQ</Device>
|
||||
<Vendor>NXP</Vendor>
|
||||
<PackID>NXP.MCXA366_DFP.25.12.00</PackID>
|
||||
<PackID>NXP.MCXA366_DFP.26.03.00</PackID>
|
||||
<PackURL>https://mcuxpresso.nxp.com/cmsis_pack/repo/</PackURL>
|
||||
<Cpu>IRAM(0x20000000,0x03c000) IRAM2(0x04000000,0x2000) IROM(0x03000000,0x2000) IROM2(0x00000000,0x0fe000) XRAM(0x04002000,0x2000) CPUTYPE("Cortex-M33") FPU3(SFPU) DSP CLOCK(12000000) ELITTLE</Cpu>
|
||||
<FlashUtilSpec></FlashUtilSpec>
|
||||
@@ -52,7 +52,7 @@
|
||||
<OutputName>rtthread</OutputName>
|
||||
<CreateExecutable>1</CreateExecutable>
|
||||
<CreateLib>0</CreateLib>
|
||||
<CreateHexFile>0</CreateHexFile>
|
||||
<CreateHexFile>1</CreateHexFile>
|
||||
<DebugInformation>1</DebugInformation>
|
||||
<BrowseInformation>1</BrowseInformation>
|
||||
<ListingPath>.\build\</ListingPath>
|
||||
@@ -314,7 +314,7 @@
|
||||
</ArmAdsMisc>
|
||||
<Cads>
|
||||
<interw>1</interw>
|
||||
<Optim>1</Optim>
|
||||
<Optim>2</Optim>
|
||||
<oTime>0</oTime>
|
||||
<SplitLS>0</SplitLS>
|
||||
<OneElfS>1</OneElfS>
|
||||
@@ -329,18 +329,18 @@
|
||||
<uC99>1</uC99>
|
||||
<uGnu>0</uGnu>
|
||||
<useXO>0</useXO>
|
||||
<v6Lang>0</v6Lang>
|
||||
<v6LangP>0</v6LangP>
|
||||
<v6Lang>3</v6Lang>
|
||||
<v6LangP>3</v6LangP>
|
||||
<vShortEn>1</vShortEn>
|
||||
<vShortWch>1</vShortWch>
|
||||
<v6Lto>0</v6Lto>
|
||||
<v6WtE>0</v6WtE>
|
||||
<v6Rtti>0</v6Rtti>
|
||||
<VariousControls>
|
||||
<MiscControls>--target=arm-arm-none-eabi</MiscControls>
|
||||
<MiscControls>--target=arm-arm-none-eabi -Wno-implicit-function-declaration -Wno-incompatible-pointer-types</MiscControls>
|
||||
<Define>__RTTHREAD__, CPU_MCXA366VLQ, __STDC_LIMIT_MACROS, RT_USING_ARMLIBC, RT_USING_LIBC, __CLK_TCK=RT_TICK_PER_SECOND, DEBUG</Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath>..\..\..\..\..\include;..\..\..\..\..\components\drivers\include;..\..\..\..\..\components\drivers\include;..\..\..\..\..\components\drivers\spi;..\..\..\..\..\components\drivers\include;..\..\..\..\..\components\libc\posix\io\eventfd;..\..\..\..\..\components\drivers\include;..\..\..\..\..\components\libc\posix\ipc;..\..\..\..\..\libcpu\arm\cortex-m33;packages\nxp-mcx-series-latest\MCXA366\components\codec;packages\nxp-mcx-series-latest\MCXA366\periph2;..\..\..\..\..\components\finsh;board;..\..\..\..\..\components\libc\posix\io\poll;..\..\..\..\..\components\drivers\phy;packages\nxp-mcx-cmsis-latest\Core\Include;.;..\..\..\..\..\components\drivers\include;..\..\..\..\..\components\libc\compilers\common\extension\fcntl\octal;..\..\..\..\..\components\drivers\smp_call;..\..\..\..\..\components\drivers\include;packages\nxp-mcx-series-latest\MCXA366;..\..\..\..\..\components\libc\compilers\common\extension;packages\nxp-mcx-series-latest\MCXA366\drivers;..\..\..\..\..\components\drivers\include;..\..\..\..\..\components\libc\compilers\common\include;applications;..\libraries\drivers;..\..\..\..\..\libcpu\arm\common;..\..\..\..\..\components\libc\posix\io\epoll;..\..\..\..\..\components\drivers\include;..\..\..\..\..\components\net\utest;..\..\..\..\..\components\drivers\include;..\..\..\..\..\components\drivers\include;board\MCUX_Config\board;..\libraries\drivers\config</IncludePath>
|
||||
<IncludePath>..\..\..\..\..\include;..\..\..\..\..\components\drivers\include;..\..\..\..\..\components\drivers\include;..\..\..\..\..\components\drivers\spi;..\..\..\..\..\components\drivers\include;..\..\..\..\..\components\libc\posix\io\eventfd;..\..\..\..\..\components\drivers\include;..\..\..\..\..\components\libc\posix\ipc;..\..\..\..\..\libcpu\arm\cortex-m33;packages\nxp-mcx-series-latest\MCXA366\components\codec;packages\nxp-mcx-series-latest\MCXA366\periph2;..\..\..\..\..\components\finsh;board;..\..\..\..\..\components\libc\posix\io\poll;..\..\..\..\..\components\drivers\phy;packages\nxp-mcx-cmsis-latest\Core\Include;.;..\..\..\..\..\components\drivers\include;..\..\..\..\..\components\libc\compilers\common\extension\fcntl\octal;..\..\..\..\..\components\drivers\smp_call;..\..\..\..\..\components\drivers\include;packages\nxp-mcx-series-latest\MCXA366;..\..\..\..\..\components\libc\compilers\common\extension;packages\nxp-mcx-series-latest\MCXA366\drivers;..\..\..\..\..\components\drivers\include;..\..\..\..\..\components\libc\compilers\common\include;applications;..\Libraries\drivers;..\..\..\..\..\libcpu\arm\common;..\..\..\..\..\components\libc\posix\io\epoll;..\..\..\..\..\components\drivers\include;..\..\..\..\..\components\net\utest;..\..\..\..\..\components\drivers\include;..\..\..\..\..\components\drivers\include;board\MCUX_Config\board;..\Libraries\drivers\config;.\applications;.\packages\RTduino-latest\core;.\applications\arduino_pinout;.\packages\RTduino-latest\core\avr</IncludePath>
|
||||
</VariousControls>
|
||||
</Cads>
|
||||
<Aads>
|
||||
@@ -394,6 +394,21 @@
|
||||
<FileType>1</FileType>
|
||||
<FilePath>applications\main.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>rtconfig.h</FileName>
|
||||
<FileType>5</FileType>
|
||||
<FilePath>.\rtconfig.h</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>pins_arduino.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\applications\arduino_pinout\pins_arduino.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>arduino_main.cpp</FileName>
|
||||
<FileType>8</FileType>
|
||||
<FilePath>.\applications\arduino_main.cpp</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
@@ -1170,7 +1185,7 @@
|
||||
<File>
|
||||
<FileName>adc.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>..\..\..\..\..\components\drivers\misc\adc.c</FilePath>
|
||||
<FilePath>..\..\..\..\..\components\drivers\adc\adc.c</FilePath>
|
||||
<FileOption>
|
||||
<CommonProperty>
|
||||
<UseCPPCompiler>2</UseCPPCompiler>
|
||||
@@ -2670,6 +2685,86 @@
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
<Group>
|
||||
<GroupName>RTduino</GroupName>
|
||||
<Files>
|
||||
<File>
|
||||
<FileName>HardwareSerial.cpp</FileName>
|
||||
<FileType>8</FileType>
|
||||
<FilePath>.\packages\RTduino-latest\core\HardwareSerial.cpp</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>IPAddress.cpp</FileName>
|
||||
<FileType>8</FileType>
|
||||
<FilePath>.\packages\RTduino-latest\core\IPAddress.cpp</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>Print.cpp</FileName>
|
||||
<FileType>8</FileType>
|
||||
<FilePath>.\packages\RTduino-latest\core\Print.cpp</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>RTduino.cpp</FileName>
|
||||
<FileType>8</FileType>
|
||||
<FilePath>.\packages\RTduino-latest\core\RTduino.cpp</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>Stream.cpp</FileName>
|
||||
<FileType>8</FileType>
|
||||
<FilePath>.\packages\RTduino-latest\core\Stream.cpp</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>Tone.cpp</FileName>
|
||||
<FileType>8</FileType>
|
||||
<FilePath>.\packages\RTduino-latest\core\Tone.cpp</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>WMath.cpp</FileName>
|
||||
<FileType>8</FileType>
|
||||
<FilePath>.\packages\RTduino-latest\core\WMath.cpp</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>WString.cpp</FileName>
|
||||
<FileType>8</FileType>
|
||||
<FilePath>.\packages\RTduino-latest\core\WString.cpp</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>WInterrupts.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\packages\RTduino-latest\core\WInterrupts.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>wiring.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\packages\RTduino-latest\core\wiring.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>wiring_analog.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\packages\RTduino-latest\core\wiring_analog.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>wiring_digital.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\packages\RTduino-latest\core\wiring_digital.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>wiring_pulse.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\packages\RTduino-latest\core\wiring_pulse.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>wiring_shift.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\packages\RTduino-latest\core\wiring_shift.c</FilePath>
|
||||
</File>
|
||||
<File>
|
||||
<FileName>avr_stdlib.c</FileName>
|
||||
<FileType>1</FileType>
|
||||
<FilePath>.\packages\RTduino-latest\core\avr\avr_stdlib.c</FilePath>
|
||||
</File>
|
||||
</Files>
|
||||
</Group>
|
||||
</Groups>
|
||||
</Target>
|
||||
</Targets>
|
||||
|
||||
@@ -247,7 +247,11 @@
|
||||
/* end of security packages */
|
||||
|
||||
/* language packages */
|
||||
|
||||
#define PKG_USING_RTDUINO
|
||||
#define RTDUINO_THREAD_SIZE 2048
|
||||
#define RTDUINO_THREAD_PRIO 30
|
||||
#define RTDUINO_SUPPORT_HIGH_PRECISION_MICROS
|
||||
#define PKG_USING_RTDUINO_LATEST_VERSION
|
||||
/* JSON: JavaScript Object Notation, a lightweight data-interchange format */
|
||||
|
||||
/* end of JSON: JavaScript Object Notation, a lightweight data-interchange format */
|
||||
@@ -307,6 +311,10 @@
|
||||
|
||||
/* end of Kendryte SDK */
|
||||
|
||||
/* MM32 HAL & SDK Drivers */
|
||||
|
||||
/* end of MM32 HAL & SDK Drivers */
|
||||
|
||||
/* WCH HAL & SDK Drivers */
|
||||
|
||||
/* end of WCH HAL & SDK Drivers */
|
||||
@@ -342,6 +350,10 @@
|
||||
/* FT32 HAL & SDK Drivers */
|
||||
|
||||
/* end of FT32 HAL & SDK Drivers */
|
||||
|
||||
/* NOVOSNS Drivers */
|
||||
|
||||
/* end of NOVOSNS Drivers */
|
||||
/* end of HAL & SDK Drivers */
|
||||
|
||||
/* sensors drivers */
|
||||
@@ -431,6 +443,7 @@
|
||||
#define BSP_USING_PIN
|
||||
#define BSP_USING_UART
|
||||
#define BSP_USING_UART2
|
||||
#define BSP_USING_UART3
|
||||
#define BSP_USING_CLOCK_TIMER
|
||||
#define BSP_USING_CTIMER0
|
||||
/* end of On-chip Peripheral Drivers */
|
||||
|
||||
Reference in New Issue
Block a user