Skip to main content

用于为 Arduino 构建 Rust 项目并编写它的 python 工具。

项目描述

氧化剂(arduino-氧化剂)

日本语版が使用できます / 有日语版

用于为 Arduino 构建 Rust 项目并编写它的 python 工具。

安装

要求

  • python3
  • pip
  • cargo
  • 配置为为 Arduino 构建的 rust 项目,或要编写的 elf 文件
  • avrdude

安装

您可以安装氧化剂pip

pip install arduino-oxidizer

注意:要安装的包的名称是arduino-oxidizer,而不是oxidizer

如何使用

构建并编写为 Arduino 配置的 Cargo 项目

Oxidizer 使用 构建项目cargo,并写入 Arduino。目标 ELF 文件基于cargo.toml.

oxidizer <Serial port to write>

例子

$ cd /path/to/cargo/projects/root
$ oxidizer /dev/ttyUSB0
[i] Building 'some-nice-project' ...
[i] >> cargo build
    Updating crates.io index
    Finished dev [unoptimized + debuginfo] target(s) in 2.30s
[v] Building succeeded! Writing to Arduino...
[i] >> avrdude -C/etc/avrdude.conf -patmega328p -carduino -P/dev/ttyUSB0 -Uflash:w:target/avr-atmega
328p/debug/some-nice-project.elf:e

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

/* ...... */

avrdude: 4982 bytes of flash verified

avrdude: safemode: Fuses OK (E:00, H:00, L:00)

avrdude done.  Thank you.

[v] All works done!

在发布模式下构建和编写

使用选项--release( -r) 运行,以在发布模式下构建。

$ cd /path/to/cargo/projects/root
$ oxidizer /dev/ttyUSB0 -r
[i] Building 'some-nice-project' in release mode...
[i] >> cargo build --release
    Updating crates.io index
    Finished release [optimized] target(s) in 2.42s

/* ...... */

avrdude done.  Thank you.

[✓] All works done!

编写自己的 ELF 文件

使用选项--skip-cargo( -s) 和--elf-path( -e) 运行,以跳过构建货物项目,并将您自己的 ELF 文件写入 Arduino。

$ oxidizer --skip-cargo --elf-path my_own_elf_file.elf /dev/ttyUSB0
[i] >> avrdude -C/etc/avrdude.conf -patmega328p -carduino -P/dev/ttyUSB0 -Uflash:w:my_own_elf_file.elf:e

avrdude: AVR device initialized and ready to accept instructions

/* ...... */

avrdude done.  Thank you.

[✓] All works done!

其他选项

有多种选择:

$ oxidizer --help
usage: oxidizer [-h] [--release] [--cargo-option [Option [Option ...]]]
                [--avrdude-option [Option [Option ...]]] [--avrdude-override] [--avrdude-quite]
                [--skip-cargo] [--elf-path ELF_PATH] [--no-color]
                target

A building helper for the Rust project for Arduino.

positional arguments:
  target                Specify the serial port to write.

optional arguments:
  -h, --help            show this help message and exit
  --release, -r         Let cargo build in release mode
  --cargo-option [Option [Option ...]], -c [Option [Option ...]]
                        Pass options to cargo. Type without '-'!
  --avrdude-option [Option [Option ...]], -a [Option [Option ...]]
                        Pass options to avrdude. Type without '-'!
  --avrdude-override, -A
                        override avrdude's option. Use with '-a'
  --avrdude-quite, -q   Use -q option when avrdude.
  --skip-cargo, -s      Skip building using cargo.
  --elf-path ELF_PATH, -e ELF_PATH
                        Specify ELF file's path. Use target/avr-
                        atmega328p/{debug,release}/{package_name}.elf as default.
  --no-color            Disable color output.
选项 缩写 论据 描述
--release -r 没有什么 以发布模式构建货物项目。
不能与--skip-cargo.
--cargo-option -c 传递给货物的选项
(不带 枚举-
使用其他选项运行货物。
--avrdude-option -a 传递给 avrdude 的选项
(不带 枚举-
使用其他选项运行 avrdude。
--avrdude-override -A 没有什么 将要传递给 avrdude 的默认选项替换为--avrdude-option.
--skip-cargo -s 没有什么 跳过构建货运项目。与 一起使用--elf-path
--elf-path -e 要写入的 ELF 文件 指定 ELF 文件的写入路径。
--no-color 没有什么 没有什么 打印没有 ASCII 空格序列的日志。

氧化剂(arduino-氧化剂)

有英文版/英文版が利用できます

Pythonで作成された、Rustで书かれたArduinoプロジェクトをビルド・书き込むためのツールです。

因斯图鲁

必要なもの

  • python3
  • pip
  • cargo
  • Arduino用ぁルドできるように 构成されたRustのプロジェクトまたは书ぁ込みたいelfファイル
  • avrdude

因斯图鲁

pipでインストールできます:

pip install arduino-oxidizer

注意:インストールするパッケージ名はoxidizerではなく** arduino-oxidizer**です。

使い方

Arduino用に构成されたCargoプロジェクトをビルド・书き込み

氧化剂は、cargoを用いてビルドを行い、avrdudeを用いてArduinoへ书き込みを行いまCargo.tomlす。

oxidizer <書き込み先のシリアルポート>

例子

$ cd /path/to/cargo/projects/root
$ oxidizer /dev/ttyUSB0
[i] Building 'some-nice-project' ...
[i] >> cargo build
    Updating crates.io index
    Finished dev [unoptimized + debuginfo] target(s) in 2.30s
[v] Building succeeded! Writing to Arduino...
[i] >> avrdude -C/etc/avrdude.conf -patmega328p -carduino -P/dev/ttyUSB0 -Uflash:w:target/avr-atmega
328p/debug/some-nice-project.elf:e

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

/* ...... */

avrdude: 4982 bytes of flash verified

avrdude: safemode: Fuses OK (E:00, H:00, L:00)

avrdude done.  Thank you.

[v] All works done!

货物プロジェクトをリリースモードでビルド・书き込み

--release-r)をつけて実行すると、リリースモードでビルドされます。

$ cd /path/to/cargo/projects/root
$ oxidizer /dev/ttyUSB0 -r
[i] Building 'some-nice-project' in release mode...
[i] >> cargo build --release
    Updating crates.io index
    Finished release [optimized] target(s) in 2.42s

/* ...... */

avrdude done.  Thank you.

[✓] All works done!

自作のELFファイルを书き込む

--skip-cargo-s)と--elf-path-e)を指定して実行すると、Cargoプロジェクトのビルドをスキップし、自作のELFファイルを书き込むことができます。

$ oxidizer --skip-cargo --elf-path my_own_elf_file.elf /dev/ttyUSB0
[i] >> avrdude -C/etc/avrdude.conf -patmega328p -carduino -P/dev/ttyUSB0 -Uflash:w:my_own_elf_file.elf:e

avrdude: AVR device initialized and ready to accept instructions

/* ...... */

avrdude done.  Thank you.

[✓] All works done!

他のオプション

様々なオプションを利用できます:

$ oxidizer --help
usage: oxidizer [-h] [--release] [--cargo-option [Option [Option ...]]]
                [--avrdude-option [Option [Option ...]]] [--avrdude-override] [--avrdude-quite]
                [--skip-cargo] [--elf-path ELF_PATH] [--no-color]
                target

A building helper for the Rust project for Arduino.

positional arguments:
  target                Specify the serial port to write.

optional arguments:
  -h, --help            show this help message and exit
  --release, -r         Let cargo build in release mode
  --cargo-option [Option [Option ...]], -c [Option [Option ...]]
                        Pass options to cargo. Type without '-'!
  --avrdude-option [Option [Option ...]], -a [Option [Option ...]]
                        Pass options to avrdude. Type without '-'!
  --avrdude-override, -A
                        override avrdude's option. Use with '-a'
  --avrdude-quite, -q   Use -q option when avrdude.
  --skip-cargo, -s      Skip building using cargo.
  --elf-path ELF_PATH, -e ELF_PATH
                        Specify ELF file's path. Use target/avr-
                        atmega328p/{debug,release}/{package_name}.elf as default.
  --no-color            Disable color output.
オプション 省略形 引数 说明
--release -r なし Cargoプロジェクトをリリースモードでビルドします。
--skip-cargo同时に指定することはできません。
--cargo-option -c 货物に渡すオプション(-なしで列挙) 货物でビルドする际に、追加でオプションをつけて実行します。
--avrdude-option -a avrdudeに渡すオプション(-なしで列挙) avrdudeでビルドする际に、追加でオプションをつけて実行します。
--avrdude-override -A なし avrdudeでビルドする际、规定のコマンドを--avrdude-optionで指定されたものに置き换えます。
--skip-cargo -s なし 货物でのビルドをスキップします。
--elf-pathと一绪に使用します。
--elf-path -e Arduinoに书き込むELFファイルへのパス 书き込むELFファイルのパスを指定します。
--no-color なし なし ASCIIエスケープシーケンスなしで出力を行います。

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

arduino-oxidizer-1.0.0.tar.gz (7.6 kB 查看哈希)

已上传 source

内置分布

arduino_oxidizer-1.0.0-py3-none-any.whl (7.6 kB 查看哈希

已上传 py3