-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[add][RTduino] Fitter RTduino in frdm-mcxa346 #11067
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
Open
westcity-YOLO
wants to merge
4
commits into
RT-Thread:master
Choose a base branch
from
westcity-YOLO:mcxa346-Rtduino
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+177
−1
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
bsp/nxp/mcx/mcxa/frdm-mcxa346/.cl/attachconfig/RTduino.attach
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| CONFIG_PKG_USING_RTDUINO=y | ||
| CONFIG_PKG_RTDUINO_PATH="/packages/arduino/RTduino" | ||
| CONFIG_RTDUINO_THREAD_SIZE=2048 | ||
| CONFIG_RTDUINO_THREAD_PRIO=30 | ||
| CONFIG_RTDUINO_SUPPORT_HIGH_PRECISION_MICROS=y | ||
| CONFIG_PKG_USING_RTDUINO_LATEST_VERSION=y | ||
| CONFIG_PKG_RTDUINO_VER="latest" | ||
| CONFIG_BSP_USING_I2C=y | ||
| CONFIG_BSP_USING_I2C3=y | ||
| CONFIG_BSP_USING_SPI=y | ||
| CONFIG_BSP_USING_SPI1=y | ||
| CONFIG_BSP_USING_ADC=y | ||
| CONFIG_BSP_USING_PWM=y | ||
| CONFIG_BSP_USING_ARDUINO=y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
bsp/nxp/mcx/mcxa/frdm-mcxa346/applications/arduino_main.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| /* | ||
| * Copyright (c) 2006-2023, RT-Thread Development Team | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| * | ||
| * Change Logs: | ||
| * Date Author Notes | ||
| * 2025-12-08 westcity-yolo first version | ||
| * | ||
| */ | ||
|
|
||
| #include <Arduino.h> | ||
|
|
||
| void setup(void) | ||
| { | ||
| /* put your setup code here, to run once: */ | ||
| Serial.begin(); | ||
| Serial.println("Hello RTduino!"); | ||
| } | ||
|
|
||
| void loop(void) | ||
| { | ||
| /* put your main code here, to run repeatedly: */ | ||
| delay(1000); | ||
| } |
Binary file added
BIN
+94.9 KB
bsp/nxp/mcx/mcxa/frdm-mcxa346/applications/arduino_pinout/RTduino-peripherals.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions
9
bsp/nxp/mcx/mcxa/frdm-mcxa346/applications/arduino_pinout/SConscript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| from building import * | ||
|
|
||
| cwd = GetCurrentDir() | ||
| src = Glob('*.c') + Glob('*.cpp') | ||
| inc = [cwd] | ||
|
|
||
| group = DefineGroup('RTduino-pinout', src, depend = ['PKG_USING_RTDUINO'], CPPPATH = inc) | ||
|
|
||
| Return('group') |
Binary file added
BIN
+895 KB
bsp/nxp/mcx/mcxa/frdm-mcxa346/applications/arduino_pinout/frdm-mcxa346-pinout1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+776 KB
bsp/nxp/mcx/mcxa/frdm-mcxa346/applications/arduino_pinout/frdm-mcxa346-pinout2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions
49
bsp/nxp/mcx/mcxa/frdm-mcxa346/applications/arduino_pinout/pins_arduino.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| /* | ||
| * Copyright (c) 2006-2023, RT-Thread Development Team | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| * | ||
| * Change Logs: | ||
| * Date Author Notes | ||
| * 2025-12-08 westcity-yolo first version | ||
| * | ||
| */ | ||
|
|
||
| #include <Arduino.h> | ||
| #include <board.h> | ||
| #include <drv_pin.h> | ||
| #include "pins_arduino.h" | ||
|
|
||
| /* | ||
| * {Arduino Pin, RT-Thread Pin [, Device Name, Channel]} | ||
| * [] means optional | ||
| * Digital pins must NOT give the device name and channel. | ||
| * Analog pins MUST give the device name and channel(ADC, PWM or DAC). | ||
| * Arduino Pin must keep in sequence. | ||
| */ | ||
| const pin_map_t pin_map_table[]= | ||
| { | ||
| {D0, GET_PINS(2,3), "uart2"}, /* Serial2-RX */ | ||
| {D1, GET_PINS(2,2), "uart2"}, /* Serial2-TX */ | ||
| {D2, GET_PINS(3,31)}, | ||
| {D3, GET_PINS(3,14), "pwm1", 1}, /* PWM */ | ||
| {D4, GET_PINS(4,7)}, | ||
| {D5, GET_PINS(3,1), "pwm0", 0}, /* PWM */ | ||
| {D6, GET_PINS(3,17), "pwm1", 0}, /* PWM */ | ||
| {D7, GET_PINS(3,22)}, | ||
| {D8, GET_PINS(4,3)}, | ||
| {D9, GET_PINS(3,13), "pwm1", 2}, /* PWM */ | ||
| {D10, GET_PINS(3,11),"spi1"}, /* SPI-SS */ | ||
| {D11, GET_PINS(3,8), "spi1"}, /* SPI-SDO */ | ||
| {D12, GET_PINS(3,9), "spi1"}, /* SPI-SDI */ | ||
| {D13, GET_PINS(3,10),"spi1"}, /* SPI-SCK */ | ||
| {D18, GET_PINS(1,8),"i2c2"}, /* I2C-SDA (Wire) */ | ||
| {D19, GET_PINS(1,9),"i2c2"}, /* I2C-SCL (Wire) */ | ||
| {A0, GET_PINS(1,14),"adc1", 12}, /* ADC */ | ||
| {A1, GET_PINS(2,5), "adc1", 1}, /* ADC */ | ||
| {A2, GET_PINS(2,7),"adc0", 7}, /* ADC */ | ||
| {A3, GET_PINS(3,30),"adc1", 21}, | ||
| {A4, GET_PINS(1,0),"i2c1"}, /* I2C-SDA (Wire) */ | ||
| {A5, GET_PINS(1,1),"i2c1"}, /* I2C-SCL (Wire) */ | ||
|
|
||
| }; |
58 changes: 58 additions & 0 deletions
58
bsp/nxp/mcx/mcxa/frdm-mcxa346/applications/arduino_pinout/pins_arduino.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| /* | ||
| * Copyright (c) 2006-2023, RT-Thread Development Team | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| * | ||
| * Change Logs: | ||
| * Date Author Notes | ||
| * 2025-12-08 westcity-yolo first version | ||
| * | ||
| */ | ||
|
|
||
| #ifndef Pins_Arduino_h | ||
| #define Pins_Arduino_h | ||
|
|
||
|
|
||
|
|
||
| /* pins alias. Must keep in sequence */ | ||
| #define D0 (0) | ||
| #define D1 (1) | ||
| #define D2 (2) | ||
| #define D3 (3) | ||
| #define D4 (4) | ||
| #define D5 (5) | ||
| #define D6 (6) | ||
| #define D7 (7) | ||
| #define D8 (8) | ||
| #define D9 (9) | ||
| #define D10 (10) | ||
| #define D11 (11) | ||
| #define D12 (12) | ||
| #define D13 (13) | ||
| #define D18 (14) | ||
| #define D19 (15) | ||
|
|
||
| #define A0 (16) | ||
| #define A1 (17) | ||
| #define A2 (18) | ||
| #define A3 (19) | ||
| #define A4 (20) | ||
| #define A5 (21) | ||
| #define A6 (22) | ||
| #define A7 (23) | ||
|
|
||
| #define RTDUINO_PIN_MAX_LIMIT A7 /* pin number max limit check */ | ||
|
|
||
| #define F_CPU 180000000L /* CPU:180MHz */ | ||
|
|
||
| /* i2c2 : P(,1_8-SDA P(,1_9-SCL */ | ||
| #define RTDUINO_DEFAULT_IIC_BUS_NAME "i2c2" | ||
|
|
||
| /* Serial2 : P(,2_2-TX P(,2_3-RX */ | ||
| #define RTDUINO_SERIAL2_DEVICE_NAME "uart2" | ||
|
|
||
| /* spi1 : P(,3_8-SDO P(,3_9-SDI P(,3_10-SCK P(,3_11-SS */ | ||
|
|
||
| #define RTDUINO_DEFAULT_SPI_BUS_NAME "spi1" | ||
|
|
||
| #endif /* Pins_Arduino_h */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
这里的select不全,要依照你在pin_arduino.c中实际定义的外设全部选中,还有adc的通道,这块看看驱动上是怎么设计接口的,包括pwm通道