Compare commits
6 Commits
master
...
46837a68e4
| Author | SHA1 | Date | |
|---|---|---|---|
| 46837a68e4 | |||
| 698851cbfd | |||
| 788060bf38 | |||
| a4657e202f | |||
| aa554f1fe5 | |||
| b5e0708b09 |
@@ -6,10 +6,12 @@ edition = "2021"
|
|||||||
[dependencies.arduino-hal]
|
[dependencies.arduino-hal]
|
||||||
git = "https://github.com/rahix/avr-hal"
|
git = "https://github.com/rahix/avr-hal"
|
||||||
rev = "3e362624547462928a219c40f9ea8e3a64f21e5f"
|
rev = "3e362624547462928a219c40f9ea8e3a64f21e5f"
|
||||||
features = ["sparkfun-promicro"]
|
|
||||||
|
|
||||||
[dependencies.static_pins]
|
[dependencies.static-pins]
|
||||||
git = "https://gitea.doryan04.ru/TheEmbeddedRust/static_pins"
|
git = "https://gitea.doryan04.ru/TheEmbeddedRust/static-pins"
|
||||||
|
|
||||||
|
[features]
|
||||||
|
sparkfun-promicro = ["arduino-hal/sparkfun-promicro", "static-pins/sparkfun-promicro"]
|
||||||
|
|
||||||
[dependencies.avr-device]
|
[dependencies.avr-device]
|
||||||
version = "0.5.4"
|
version = "0.5.4"
|
||||||
|
|||||||
@@ -1,41 +0,0 @@
|
|||||||
{
|
|
||||||
"arch": "avr",
|
|
||||||
"atomic-cas": false,
|
|
||||||
"cpu": "atmega1280",
|
|
||||||
"crt-objects-fallback": "false",
|
|
||||||
"data-layout": "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8",
|
|
||||||
"eh-frame-header": false,
|
|
||||||
"exe-suffix": ".elf",
|
|
||||||
"late-link-args": {
|
|
||||||
"gnu-cc": [
|
|
||||||
"-lgcc"
|
|
||||||
],
|
|
||||||
"gnu-lld-cc": [
|
|
||||||
"-lgcc"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"linker": "avr-gcc",
|
|
||||||
"linker-flavor": "gnu-cc",
|
|
||||||
"llvm-target": "avr-unknown-unknown",
|
|
||||||
"max-atomic-width": 8,
|
|
||||||
"metadata": {
|
|
||||||
"description": null,
|
|
||||||
"host_tools": null,
|
|
||||||
"std": null,
|
|
||||||
"tier": null
|
|
||||||
},
|
|
||||||
"no-default-libraries": false,
|
|
||||||
"pre-link-args": {
|
|
||||||
"gnu-cc": [
|
|
||||||
"-mmcu=atmega1280",
|
|
||||||
"-Wl,--as-needed,--print-memory-usage"
|
|
||||||
],
|
|
||||||
"gnu-lld-cc": [
|
|
||||||
"-mmcu=atmega1280",
|
|
||||||
"-Wl,--as-needed,--print-memory-usage"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"relocation-model": "static",
|
|
||||||
"target-c-int-width": "16",
|
|
||||||
"target-pointer-width": "16"
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
{
|
|
||||||
"arch": "avr",
|
|
||||||
"atomic-cas": false,
|
|
||||||
"cpu": "atmega1284p",
|
|
||||||
"crt-objects-fallback": "false",
|
|
||||||
"data-layout": "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8",
|
|
||||||
"eh-frame-header": false,
|
|
||||||
"exe-suffix": ".elf",
|
|
||||||
"late-link-args": {
|
|
||||||
"gnu-cc": [
|
|
||||||
"-lgcc"
|
|
||||||
],
|
|
||||||
"gnu-lld-cc": [
|
|
||||||
"-lgcc"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"linker": "avr-gcc",
|
|
||||||
"linker-flavor": "gnu-cc",
|
|
||||||
"llvm-target": "avr-unknown-unknown",
|
|
||||||
"max-atomic-width": 8,
|
|
||||||
"metadata": {
|
|
||||||
"description": null,
|
|
||||||
"host_tools": null,
|
|
||||||
"std": null,
|
|
||||||
"tier": null
|
|
||||||
},
|
|
||||||
"no-default-libraries": false,
|
|
||||||
"pre-link-args": {
|
|
||||||
"gnu-cc": [
|
|
||||||
"-mmcu=atmega1284p",
|
|
||||||
"-Wl,--as-needed,--print-memory-usage"
|
|
||||||
],
|
|
||||||
"gnu-lld-cc": [
|
|
||||||
"-mmcu=atmega1284p",
|
|
||||||
"-Wl,--as-needed,--print-memory-usage"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"relocation-model": "static",
|
|
||||||
"target-c-int-width": "16",
|
|
||||||
"target-pointer-width": "16"
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
{
|
|
||||||
"arch": "avr",
|
|
||||||
"atomic-cas": false,
|
|
||||||
"cpu": "atmega128a",
|
|
||||||
"crt-objects-fallback": "false",
|
|
||||||
"data-layout": "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8",
|
|
||||||
"eh-frame-header": false,
|
|
||||||
"exe-suffix": ".elf",
|
|
||||||
"late-link-args": {
|
|
||||||
"gnu-cc": [
|
|
||||||
"-lgcc"
|
|
||||||
],
|
|
||||||
"gnu-lld-cc": [
|
|
||||||
"-lgcc"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"linker": "avr-gcc",
|
|
||||||
"linker-flavor": "gnu-cc",
|
|
||||||
"llvm-target": "avr-unknown-unknown",
|
|
||||||
"max-atomic-width": 8,
|
|
||||||
"metadata": {
|
|
||||||
"description": null,
|
|
||||||
"host_tools": null,
|
|
||||||
"std": null,
|
|
||||||
"tier": null
|
|
||||||
},
|
|
||||||
"no-default-libraries": false,
|
|
||||||
"pre-link-args": {
|
|
||||||
"gnu-cc": [
|
|
||||||
"-mmcu=atmega128a",
|
|
||||||
"-Wl,--as-needed,--print-memory-usage"
|
|
||||||
],
|
|
||||||
"gnu-lld-cc": [
|
|
||||||
"-mmcu=atmega128a",
|
|
||||||
"-Wl,--as-needed,--print-memory-usage"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"relocation-model": "static",
|
|
||||||
"target-c-int-width": "16",
|
|
||||||
"target-pointer-width": "16"
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
{
|
|
||||||
"arch": "avr",
|
|
||||||
"atomic-cas": false,
|
|
||||||
"cpu": "atmega164pa",
|
|
||||||
"crt-objects-fallback": "false",
|
|
||||||
"data-layout": "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8",
|
|
||||||
"eh-frame-header": false,
|
|
||||||
"exe-suffix": ".elf",
|
|
||||||
"late-link-args": {
|
|
||||||
"gnu-cc": [
|
|
||||||
"-lgcc"
|
|
||||||
],
|
|
||||||
"gnu-lld-cc": [
|
|
||||||
"-lgcc"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"linker": "avr-gcc",
|
|
||||||
"linker-flavor": "gnu-cc",
|
|
||||||
"llvm-target": "avr-unknown-unknown",
|
|
||||||
"max-atomic-width": 8,
|
|
||||||
"metadata": {
|
|
||||||
"description": null,
|
|
||||||
"host_tools": null,
|
|
||||||
"std": null,
|
|
||||||
"tier": null
|
|
||||||
},
|
|
||||||
"no-default-libraries": false,
|
|
||||||
"pre-link-args": {
|
|
||||||
"gnu-cc": [
|
|
||||||
"-mmcu=atmega164pa",
|
|
||||||
"-Wl,--as-needed,--print-memory-usage"
|
|
||||||
],
|
|
||||||
"gnu-lld-cc": [
|
|
||||||
"-mmcu=atmega164pa",
|
|
||||||
"-Wl,--as-needed,--print-memory-usage"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"relocation-model": "static",
|
|
||||||
"target-c-int-width": "16",
|
|
||||||
"target-pointer-width": "16"
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
{
|
|
||||||
"arch": "avr",
|
|
||||||
"atomic-cas": false,
|
|
||||||
"cpu": "atmega168",
|
|
||||||
"crt-objects-fallback": "false",
|
|
||||||
"data-layout": "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8",
|
|
||||||
"eh-frame-header": false,
|
|
||||||
"exe-suffix": ".elf",
|
|
||||||
"late-link-args": {
|
|
||||||
"gnu-cc": [
|
|
||||||
"-lgcc"
|
|
||||||
],
|
|
||||||
"gnu-lld-cc": [
|
|
||||||
"-lgcc"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"linker": "avr-gcc",
|
|
||||||
"linker-flavor": "gnu-cc",
|
|
||||||
"llvm-target": "avr-unknown-unknown",
|
|
||||||
"max-atomic-width": 8,
|
|
||||||
"metadata": {
|
|
||||||
"description": null,
|
|
||||||
"host_tools": null,
|
|
||||||
"std": null,
|
|
||||||
"tier": null
|
|
||||||
},
|
|
||||||
"no-default-libraries": false,
|
|
||||||
"pre-link-args": {
|
|
||||||
"gnu-cc": [
|
|
||||||
"-mmcu=atmega168",
|
|
||||||
"-Wl,--as-needed,--print-memory-usage"
|
|
||||||
],
|
|
||||||
"gnu-lld-cc": [
|
|
||||||
"-mmcu=atmega168",
|
|
||||||
"-Wl,--as-needed,--print-memory-usage"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"relocation-model": "static",
|
|
||||||
"target-c-int-width": "16",
|
|
||||||
"target-pointer-width": "16"
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
{
|
|
||||||
"arch": "avr",
|
|
||||||
"atomic-cas": false,
|
|
||||||
"cpu": "atmega2560",
|
|
||||||
"crt-objects-fallback": "false",
|
|
||||||
"data-layout": "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8",
|
|
||||||
"eh-frame-header": false,
|
|
||||||
"exe-suffix": ".elf",
|
|
||||||
"late-link-args": {
|
|
||||||
"gnu-cc": [
|
|
||||||
"-lgcc"
|
|
||||||
],
|
|
||||||
"gnu-lld-cc": [
|
|
||||||
"-lgcc"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"linker": "avr-gcc",
|
|
||||||
"linker-flavor": "gnu-cc",
|
|
||||||
"llvm-target": "avr-unknown-unknown",
|
|
||||||
"max-atomic-width": 8,
|
|
||||||
"metadata": {
|
|
||||||
"description": null,
|
|
||||||
"host_tools": null,
|
|
||||||
"std": null,
|
|
||||||
"tier": null
|
|
||||||
},
|
|
||||||
"no-default-libraries": false,
|
|
||||||
"pre-link-args": {
|
|
||||||
"gnu-cc": [
|
|
||||||
"-mmcu=atmega2560",
|
|
||||||
"-Wl,--as-needed,--print-memory-usage"
|
|
||||||
],
|
|
||||||
"gnu-lld-cc": [
|
|
||||||
"-mmcu=atmega2560",
|
|
||||||
"-Wl,--as-needed,--print-memory-usage"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"relocation-model": "static",
|
|
||||||
"target-c-int-width": "16",
|
|
||||||
"target-pointer-width": "16"
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
{
|
|
||||||
"arch": "avr",
|
|
||||||
"atomic-cas": false,
|
|
||||||
"cpu": "atmega328",
|
|
||||||
"crt-objects-fallback": "false",
|
|
||||||
"data-layout": "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8",
|
|
||||||
"eh-frame-header": false,
|
|
||||||
"exe-suffix": ".elf",
|
|
||||||
"late-link-args": {
|
|
||||||
"gnu-cc": [
|
|
||||||
"-lgcc"
|
|
||||||
],
|
|
||||||
"gnu-lld-cc": [
|
|
||||||
"-lgcc"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"linker": "avr-gcc",
|
|
||||||
"linker-flavor": "gnu-cc",
|
|
||||||
"llvm-target": "avr-unknown-unknown",
|
|
||||||
"max-atomic-width": 8,
|
|
||||||
"metadata": {
|
|
||||||
"description": null,
|
|
||||||
"host_tools": null,
|
|
||||||
"std": null,
|
|
||||||
"tier": null
|
|
||||||
},
|
|
||||||
"no-default-libraries": false,
|
|
||||||
"pre-link-args": {
|
|
||||||
"gnu-cc": [
|
|
||||||
"-mmcu=atmega328",
|
|
||||||
"-Wl,--as-needed,--print-memory-usage"
|
|
||||||
],
|
|
||||||
"gnu-lld-cc": [
|
|
||||||
"-mmcu=atmega328",
|
|
||||||
"-Wl,--as-needed,--print-memory-usage"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"relocation-model": "static",
|
|
||||||
"target-c-int-width": "16",
|
|
||||||
"target-pointer-width": "16"
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
{
|
|
||||||
"arch": "avr",
|
|
||||||
"atomic-cas": false,
|
|
||||||
"cpu": "atmega328p",
|
|
||||||
"crt-objects-fallback": "false",
|
|
||||||
"data-layout": "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8",
|
|
||||||
"eh-frame-header": false,
|
|
||||||
"exe-suffix": ".elf",
|
|
||||||
"late-link-args": {
|
|
||||||
"gnu-cc": [
|
|
||||||
"-lgcc"
|
|
||||||
],
|
|
||||||
"gnu-lld-cc": [
|
|
||||||
"-lgcc"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"linker": "avr-gcc",
|
|
||||||
"linker-flavor": "gnu-cc",
|
|
||||||
"llvm-target": "avr-unknown-unknown",
|
|
||||||
"max-atomic-width": 8,
|
|
||||||
"metadata": {
|
|
||||||
"description": null,
|
|
||||||
"host_tools": null,
|
|
||||||
"std": null,
|
|
||||||
"tier": null
|
|
||||||
},
|
|
||||||
"no-default-libraries": false,
|
|
||||||
"pre-link-args": {
|
|
||||||
"gnu-cc": [
|
|
||||||
"-mmcu=atmega328p",
|
|
||||||
"-Wl,--as-needed,--print-memory-usage"
|
|
||||||
],
|
|
||||||
"gnu-lld-cc": [
|
|
||||||
"-mmcu=atmega328p",
|
|
||||||
"-Wl,--as-needed,--print-memory-usage"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"relocation-model": "static",
|
|
||||||
"target-c-int-width": "16",
|
|
||||||
"target-pointer-width": "16"
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
{
|
|
||||||
"arch": "avr",
|
|
||||||
"atomic-cas": false,
|
|
||||||
"cpu": "atmega32a",
|
|
||||||
"crt-objects-fallback": "false",
|
|
||||||
"data-layout": "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8",
|
|
||||||
"eh-frame-header": false,
|
|
||||||
"exe-suffix": ".elf",
|
|
||||||
"late-link-args": {
|
|
||||||
"gnu-cc": [
|
|
||||||
"-lgcc"
|
|
||||||
],
|
|
||||||
"gnu-lld-cc": [
|
|
||||||
"-lgcc"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"linker": "avr-gcc",
|
|
||||||
"linker-flavor": "gnu-cc",
|
|
||||||
"llvm-target": "avr-unknown-unknown",
|
|
||||||
"max-atomic-width": 8,
|
|
||||||
"metadata": {
|
|
||||||
"description": null,
|
|
||||||
"host_tools": null,
|
|
||||||
"std": null,
|
|
||||||
"tier": null
|
|
||||||
},
|
|
||||||
"no-default-libraries": false,
|
|
||||||
"pre-link-args": {
|
|
||||||
"gnu-cc": [
|
|
||||||
"-mmcu=atmega32a",
|
|
||||||
"-Wl,--as-needed,--print-memory-usage"
|
|
||||||
],
|
|
||||||
"gnu-lld-cc": [
|
|
||||||
"-mmcu=atmega32a",
|
|
||||||
"-Wl,--as-needed,--print-memory-usage"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"relocation-model": "static",
|
|
||||||
"target-c-int-width": "16",
|
|
||||||
"target-pointer-width": "16"
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
{
|
|
||||||
"arch": "avr",
|
|
||||||
"atomic-cas": false,
|
|
||||||
"cpu": "atmega32u4",
|
|
||||||
"crt-objects-fallback": "false",
|
|
||||||
"data-layout": "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8",
|
|
||||||
"eh-frame-header": false,
|
|
||||||
"exe-suffix": ".elf",
|
|
||||||
"late-link-args": {
|
|
||||||
"gnu-cc": [
|
|
||||||
"-lgcc"
|
|
||||||
],
|
|
||||||
"gnu-lld-cc": [
|
|
||||||
"-lgcc"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"linker": "avr-gcc",
|
|
||||||
"linker-flavor": "gnu-cc",
|
|
||||||
"llvm-target": "avr-unknown-unknown",
|
|
||||||
"max-atomic-width": 8,
|
|
||||||
"metadata": {
|
|
||||||
"description": null,
|
|
||||||
"host_tools": null,
|
|
||||||
"std": null,
|
|
||||||
"tier": null
|
|
||||||
},
|
|
||||||
"no-default-libraries": false,
|
|
||||||
"pre-link-args": {
|
|
||||||
"gnu-cc": [
|
|
||||||
"-mmcu=atmega32u4",
|
|
||||||
"-Wl,--as-needed,--print-memory-usage"
|
|
||||||
],
|
|
||||||
"gnu-lld-cc": [
|
|
||||||
"-mmcu=atmega32u4",
|
|
||||||
"-Wl,--as-needed,--print-memory-usage"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"relocation-model": "static",
|
|
||||||
"target-c-int-width": "16",
|
|
||||||
"target-pointer-width": "16"
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
{
|
|
||||||
"arch": "avr",
|
|
||||||
"atomic-cas": false,
|
|
||||||
"cpu": "atmega48p",
|
|
||||||
"crt-objects-fallback": "false",
|
|
||||||
"data-layout": "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8",
|
|
||||||
"eh-frame-header": false,
|
|
||||||
"exe-suffix": ".elf",
|
|
||||||
"late-link-args": {
|
|
||||||
"gnu-cc": [
|
|
||||||
"-lgcc"
|
|
||||||
],
|
|
||||||
"gnu-lld-cc": [
|
|
||||||
"-lgcc"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"linker": "avr-gcc",
|
|
||||||
"linker-flavor": "gnu-cc",
|
|
||||||
"llvm-target": "avr-unknown-unknown",
|
|
||||||
"max-atomic-width": 8,
|
|
||||||
"metadata": {
|
|
||||||
"description": null,
|
|
||||||
"host_tools": null,
|
|
||||||
"std": null,
|
|
||||||
"tier": null
|
|
||||||
},
|
|
||||||
"no-default-libraries": false,
|
|
||||||
"pre-link-args": {
|
|
||||||
"gnu-cc": [
|
|
||||||
"-mmcu=atmega48p",
|
|
||||||
"-Wl,--as-needed,--print-memory-usage"
|
|
||||||
],
|
|
||||||
"gnu-lld-cc": [
|
|
||||||
"-mmcu=atmega48p",
|
|
||||||
"-Wl,--as-needed,--print-memory-usage"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"relocation-model": "static",
|
|
||||||
"target-c-int-width": "16",
|
|
||||||
"target-pointer-width": "16"
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
{
|
|
||||||
"arch": "avr",
|
|
||||||
"atomic-cas": false,
|
|
||||||
"cpu": "atmega8",
|
|
||||||
"crt-objects-fallback": "false",
|
|
||||||
"data-layout": "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8",
|
|
||||||
"eh-frame-header": false,
|
|
||||||
"exe-suffix": ".elf",
|
|
||||||
"late-link-args": {
|
|
||||||
"gnu-cc": [
|
|
||||||
"-lgcc"
|
|
||||||
],
|
|
||||||
"gnu-lld-cc": [
|
|
||||||
"-lgcc"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"linker": "avr-gcc",
|
|
||||||
"linker-flavor": "gnu-cc",
|
|
||||||
"llvm-target": "avr-unknown-unknown",
|
|
||||||
"max-atomic-width": 8,
|
|
||||||
"metadata": {
|
|
||||||
"description": null,
|
|
||||||
"host_tools": null,
|
|
||||||
"std": null,
|
|
||||||
"tier": null
|
|
||||||
},
|
|
||||||
"no-default-libraries": false,
|
|
||||||
"pre-link-args": {
|
|
||||||
"gnu-cc": [
|
|
||||||
"-mmcu=atmega8",
|
|
||||||
"-Wl,--as-needed,--print-memory-usage"
|
|
||||||
],
|
|
||||||
"gnu-lld-cc": [
|
|
||||||
"-mmcu=atmega8",
|
|
||||||
"-Wl,--as-needed,--print-memory-usage"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"relocation-model": "static",
|
|
||||||
"target-c-int-width": "16",
|
|
||||||
"target-pointer-width": "16"
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
{
|
|
||||||
"arch": "avr",
|
|
||||||
"atomic-cas": false,
|
|
||||||
"cpu": "attiny167",
|
|
||||||
"crt-objects-fallback": "false",
|
|
||||||
"data-layout": "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8",
|
|
||||||
"eh-frame-header": false,
|
|
||||||
"exe-suffix": ".elf",
|
|
||||||
"late-link-args": {
|
|
||||||
"gnu-cc": [
|
|
||||||
"-lgcc"
|
|
||||||
],
|
|
||||||
"gnu-lld-cc": [
|
|
||||||
"-lgcc"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"linker": "avr-gcc",
|
|
||||||
"linker-flavor": "gnu-cc",
|
|
||||||
"llvm-target": "avr-unknown-unknown",
|
|
||||||
"max-atomic-width": 8,
|
|
||||||
"metadata": {
|
|
||||||
"description": null,
|
|
||||||
"host_tools": null,
|
|
||||||
"std": null,
|
|
||||||
"tier": null
|
|
||||||
},
|
|
||||||
"no-default-libraries": false,
|
|
||||||
"pre-link-args": {
|
|
||||||
"gnu-cc": [
|
|
||||||
"-mmcu=attiny167",
|
|
||||||
"-Wl,--as-needed,--print-memory-usage"
|
|
||||||
],
|
|
||||||
"gnu-lld-cc": [
|
|
||||||
"-mmcu=attiny167",
|
|
||||||
"-Wl,--as-needed,--print-memory-usage"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"relocation-model": "static",
|
|
||||||
"target-c-int-width": "16",
|
|
||||||
"target-pointer-width": "16"
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
{
|
|
||||||
"arch": "avr",
|
|
||||||
"atomic-cas": false,
|
|
||||||
"cpu": "attiny2313",
|
|
||||||
"crt-objects-fallback": "false",
|
|
||||||
"data-layout": "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8",
|
|
||||||
"eh-frame-header": false,
|
|
||||||
"exe-suffix": ".elf",
|
|
||||||
"late-link-args": {
|
|
||||||
"gnu-cc": [
|
|
||||||
"-lgcc"
|
|
||||||
],
|
|
||||||
"gnu-lld-cc": [
|
|
||||||
"-lgcc"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"linker": "avr-gcc",
|
|
||||||
"linker-flavor": "gnu-cc",
|
|
||||||
"llvm-target": "avr-unknown-unknown",
|
|
||||||
"max-atomic-width": 8,
|
|
||||||
"metadata": {
|
|
||||||
"description": null,
|
|
||||||
"host_tools": null,
|
|
||||||
"std": null,
|
|
||||||
"tier": null
|
|
||||||
},
|
|
||||||
"no-default-libraries": false,
|
|
||||||
"pre-link-args": {
|
|
||||||
"gnu-cc": [
|
|
||||||
"-mmcu=attiny2313",
|
|
||||||
"-Wl,--as-needed,--print-memory-usage"
|
|
||||||
],
|
|
||||||
"gnu-lld-cc": [
|
|
||||||
"-mmcu=attiny2313",
|
|
||||||
"-Wl,--as-needed,--print-memory-usage"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"relocation-model": "static",
|
|
||||||
"target-c-int-width": "16",
|
|
||||||
"target-pointer-width": "16"
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
{
|
|
||||||
"arch": "avr",
|
|
||||||
"atomic-cas": false,
|
|
||||||
"cpu": "attiny85",
|
|
||||||
"crt-objects-fallback": "false",
|
|
||||||
"data-layout": "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8",
|
|
||||||
"eh-frame-header": false,
|
|
||||||
"exe-suffix": ".elf",
|
|
||||||
"late-link-args": {
|
|
||||||
"gnu-cc": [
|
|
||||||
"-lgcc"
|
|
||||||
],
|
|
||||||
"gnu-lld-cc": [
|
|
||||||
"-lgcc"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"linker": "avr-gcc",
|
|
||||||
"linker-flavor": "gnu-cc",
|
|
||||||
"llvm-target": "avr-unknown-unknown",
|
|
||||||
"max-atomic-width": 8,
|
|
||||||
"metadata": {
|
|
||||||
"description": null,
|
|
||||||
"host_tools": null,
|
|
||||||
"std": null,
|
|
||||||
"tier": null
|
|
||||||
},
|
|
||||||
"no-default-libraries": false,
|
|
||||||
"pre-link-args": {
|
|
||||||
"gnu-cc": [
|
|
||||||
"-mmcu=attiny85",
|
|
||||||
"-Wl,--as-needed,--print-memory-usage"
|
|
||||||
],
|
|
||||||
"gnu-lld-cc": [
|
|
||||||
"-mmcu=attiny85",
|
|
||||||
"-Wl,--as-needed,--print-memory-usage"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"relocation-model": "static",
|
|
||||||
"target-c-int-width": "16",
|
|
||||||
"target-pointer-width": "16"
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
{
|
|
||||||
"arch": "avr",
|
|
||||||
"atomic-cas": false,
|
|
||||||
"cpu": "attiny88",
|
|
||||||
"crt-objects-fallback": "false",
|
|
||||||
"data-layout": "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8",
|
|
||||||
"eh-frame-header": false,
|
|
||||||
"exe-suffix": ".elf",
|
|
||||||
"late-link-args": {
|
|
||||||
"gnu-cc": [
|
|
||||||
"-lgcc"
|
|
||||||
],
|
|
||||||
"gnu-lld-cc": [
|
|
||||||
"-lgcc"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"linker": "avr-gcc",
|
|
||||||
"linker-flavor": "gnu-cc",
|
|
||||||
"llvm-target": "avr-unknown-unknown",
|
|
||||||
"max-atomic-width": 8,
|
|
||||||
"metadata": {
|
|
||||||
"description": null,
|
|
||||||
"host_tools": null,
|
|
||||||
"std": null,
|
|
||||||
"tier": null
|
|
||||||
},
|
|
||||||
"no-default-libraries": false,
|
|
||||||
"pre-link-args": {
|
|
||||||
"gnu-cc": [
|
|
||||||
"-mmcu=attiny88",
|
|
||||||
"-Wl,--as-needed,--print-memory-usage"
|
|
||||||
],
|
|
||||||
"gnu-lld-cc": [
|
|
||||||
"-mmcu=attiny88",
|
|
||||||
"-Wl,--as-needed,--print-memory-usage"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"relocation-model": "static",
|
|
||||||
"target-c-int-width": "16",
|
|
||||||
"target-pointer-width": "16"
|
|
||||||
}
|
|
||||||
12
src/lib.rs
12
src/lib.rs
@@ -4,7 +4,6 @@ use core::marker::PhantomData;
|
|||||||
|
|
||||||
use arduino_hal::{
|
use arduino_hal::{
|
||||||
delay_us,
|
delay_us,
|
||||||
pac::EXINT,
|
|
||||||
port::{
|
port::{
|
||||||
mode::{Input, PullUp},
|
mode::{Input, PullUp},
|
||||||
Pin, PinOps,
|
Pin, PinOps,
|
||||||
@@ -42,10 +41,7 @@ where
|
|||||||
P: PinOps + StaticPinOps,
|
P: PinOps + StaticPinOps,
|
||||||
{
|
{
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn new(_pin: Pin<Input<PullUp>, P>, exint: &EXINT) -> Self {
|
pub fn new(_pin: Pin<Input<PullUp>, P>) -> Self {
|
||||||
exint.eimsk.write(|w| w.bits(1 << 1));
|
|
||||||
exint.eicra.write(|w| unsafe { w.bits(!(1 << 3 | 1 << 2)) });
|
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
_pin: PhantomData {},
|
_pin: PhantomData {},
|
||||||
}
|
}
|
||||||
@@ -179,6 +175,8 @@ where
|
|||||||
for _ in 0..8 {
|
for _ in 0..8 {
|
||||||
delay_us(FIRST_HALF_SERIAL_DELAY);
|
delay_us(FIRST_HALF_SERIAL_DELAY);
|
||||||
|
|
||||||
|
data <<= 1;
|
||||||
|
|
||||||
if P::is_low() {
|
if P::is_low() {
|
||||||
data |= 1;
|
data |= 1;
|
||||||
reciever_parity_bit ^= 1;
|
reciever_parity_bit ^= 1;
|
||||||
@@ -189,8 +187,6 @@ where
|
|||||||
|
|
||||||
delay_cycles(READING_ADJUST);
|
delay_cycles(READING_ADJUST);
|
||||||
delay_us(SECOND_HALF_SERIAL_DELAY);
|
delay_us(SECOND_HALF_SERIAL_DELAY);
|
||||||
|
|
||||||
data <<= 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
delay_us(FIRST_HALF_SERIAL_DELAY);
|
delay_us(FIRST_HALF_SERIAL_DELAY);
|
||||||
@@ -200,7 +196,7 @@ where
|
|||||||
delay_cycles(READING_ADJUST);
|
delay_cycles(READING_ADJUST);
|
||||||
delay_us(SECOND_HALF_SERIAL_DELAY);
|
delay_us(SECOND_HALF_SERIAL_DELAY);
|
||||||
|
|
||||||
if reciever_parity_bit != transmitter_parity_bit {
|
if reciever_parity_bit == transmitter_parity_bit {
|
||||||
return Err((data, reciever_parity_bit));
|
return Err((data, reciever_parity_bit));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user