-
Notifications
You must be signed in to change notification settings - Fork 1
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
LDSW, IBATT and NRF9160 examples #9
Open
fredriknk
wants to merge
15
commits into
thermigo:main
Choose a base branch
from
fredriknk:main
base: main
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.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
2096858
Added ldsw yml data
fredriknk 1c70694
Added try_conversion: crate::common::Task
fredriknk bcf2986
feat: Added .vscode config for rust analyzer for multiple target exam…
fredriknk c9dfd46
fix: Changed target location to account for more targets
fredriknk e85a71c
Feat: Nrf9160 example
fredriknk 0818200
feat: Blinky example
fredriknk 5fe03ee
feat: Mesure voltage and ntc temp
fredriknk 6dd9460
feat: Added basic loadswitch functionality
fredriknk 842f80a
fix: Removed unused libs
fredriknk a423256
feat: function to read charger current config
fredriknk 158d016
fix: Theese registers are allso used for ibat measurement, added info
fredriknk 817e14e
feat: Added ibat current measurement and conversion
fredriknk 7e19a89
fix: Removed a message i used for debug
fredriknk 278dcc9
fix: Update README.md wit loadsw
fredriknk f2ef647
refactor: move all adc related methods to adc module
badrbouslikhin 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 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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
/target | ||
examples/target | ||
examples/*/target |
This file contains 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,4 @@ | ||
*.cortex-debug.*.json | ||
launch.json | ||
tasks.json | ||
*.cfg |
This file contains 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,11 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. | ||
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp | ||
// List of extensions which should be recommended for users of this workspace. | ||
"recommendations": [ | ||
"rust-lang.rust-analyzer", | ||
"tamasfe.even-better-toml", | ||
], | ||
// List of extensions recommended by VS Code that should not be recommended for users of this workspace. | ||
"unwantedRecommendations": [] | ||
} |
This file contains 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,33 @@ | ||
{ | ||
"[toml]": { | ||
"editor.formatOnSave": false | ||
}, | ||
"[markdown]": { | ||
"editor.formatOnSave": false | ||
}, | ||
"rust-analyzer.check.allTargets": false, | ||
"rust-analyzer.check.noDefaultFeatures": true, | ||
"rust-analyzer.cargo.noDefaultFeatures": true, | ||
"rust-analyzer.showUnlinkedFileNotification": false, | ||
// Uncomment the target of your chip. | ||
//"rust-analyzer.cargo.target": "thumbv6m-none-eabi", | ||
//"rust-analyzer.cargo.target": "thumbv7m-none-eabi", | ||
"rust-analyzer.cargo.target": "thumbv7em-none-eabi", | ||
//"rust-analyzer.cargo.target": "thumbv7em-none-eabihf", | ||
//"rust-analyzer.cargo.target": "thumbv8m.main-none-eabihf", | ||
"rust-analyzer.cargo.features": [ | ||
// Comment out these features when working on the examples. Most example crates do not have any cargo features. | ||
//"stm32f446re", | ||
//"time-driver-any", | ||
//"unstable-pac", | ||
//"exti", | ||
//"rt", | ||
], | ||
"rust-analyzer.linkedProjects": [ | ||
// To work on the examples, comment the line above and all of the cargo.features lines, | ||
// then uncomment ONE line below to select the chip you want to work on. | ||
// This makes rust-analyzer work on the example crate and all its dependencies. | ||
"examples/nrf9160/Cargo.toml", | ||
//"examples/nrf52840/Cargo.toml", | ||
], | ||
} |
This file contains 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
This file contains 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 |
---|---|---|
|
@@ -1692,7 +1692,7 @@ ADC: | |
description: VSYS measurement result LSBs | ||
ADCVBATBURSTRESULTMSB: | ||
type: register | ||
description: ADC VBAT (or VBUS) burst measurement result MSB | ||
description: ADC VBAT (or VBUS) burst measurement result MSB or IBAT/vbat measurement | ||
access: ReadOnly | ||
address: 0x16 | ||
repeat: | ||
|
@@ -1708,7 +1708,7 @@ ADC: | |
description: ADC VBAT (or VBUS) burst measurement result upper 8-bits | ||
ADCGP1RESULTLSBS: | ||
type: register | ||
description: ADC result LSB's (VBAT burst 0, 1, 2 and 3) | ||
description: ADC result LSB's (VBAT burst 0, 1, 2 and 3) or 2 IBAT/ 3 VBUS | ||
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. Do you mean that |
||
access: ReadOnly | ||
address: 0x1A | ||
size_bits: 8 | ||
|
@@ -1749,6 +1749,14 @@ ADC: | |
start: 0 | ||
end: 1 | ||
description: Enable auto IBAT measurement after VBAT task | ||
conversion: | ||
name: IBATMEASENABLE | ||
IBATOFF: | ||
value: 0 | ||
description: IBAT measurement disabled | ||
IBATON: | ||
value: 1 | ||
description: IBAT measurement enabled | ||
|
||
POF: | ||
type: block | ||
|
@@ -1989,3 +1997,108 @@ SHIP: | |
SHPHLDGPIO0: | ||
value: 1 | ||
description: SHPHLD + GPIO0 buttons | ||
|
||
LDSW: | ||
type: block | ||
description: LOADSW registers | ||
address_offset: 0x0800 | ||
objects: | ||
LDSWSET: | ||
type: command | ||
description: Enable LDSW | ||
address: 0x00 | ||
repeat: | ||
count: 2 | ||
stride: 2 | ||
size_bits_in: 1 | ||
fields_in: | ||
TASKLDSWSET: | ||
base: uint | ||
start: 0 | ||
end: 1 | ||
description: LDSW Enable request SET | ||
try_conversion: crate::common::Task | ||
LDSWCLR: | ||
type: command | ||
description: Disable LDSW1 | ||
address: 0x01 | ||
size_bits_in: 1 | ||
repeat: | ||
count: 2 | ||
stride: 2 | ||
fields_in: | ||
TASKLDSWCLR: | ||
base: uint | ||
start: 0 | ||
end: 1 | ||
description: LDSW Disable request CLR | ||
try_conversion: crate::common::Task | ||
LDSWSTATUS: | ||
type: register | ||
description: Load Switch Status | ||
access: RO | ||
address: 0x04 | ||
size_bits: 8 | ||
reset_value: 0x00 | ||
fields: | ||
LDSW1PWRUPLDSW: | ||
base: uint | ||
start: 0 | ||
end: 1 | ||
description: Current status of LDSW1 | ||
access: ReadOnly | ||
conversion: | ||
name: LDSW1PWRUPLDSW | ||
LDSWDISABLED: | ||
value: 0 | ||
description: LDSW powered off | ||
LDSWPOWERED: | ||
value: 1 | ||
description: LDSW powered on | ||
LDSW1PWRUPLDO: | ||
base: uint | ||
start: 1 | ||
end: 2 | ||
description: Current status of LDO1 | ||
access: ReadOnly | ||
conversion: | ||
name: LDSW1PWRUPLDO | ||
LDODISABLED: | ||
value: 0 | ||
description: LDO powered off | ||
LDOPOWERED: | ||
value: 1 | ||
description: LDO powered on | ||
LDSW2PWRUPLDSW: | ||
base: uint | ||
start: 2 | ||
end: 3 | ||
description: Current status of LDSW2 | ||
access: ReadOnly | ||
conversion: | ||
name: LDSW2PWRUPLDSW | ||
LDSWDISABLED: | ||
value: 0 | ||
description: LDSW powered off | ||
LDSWPOWERED: | ||
value: 1 | ||
description: LDSW powered on | ||
LDSW2PWRUPLDO: | ||
base: uint | ||
start: 3 | ||
end: 4 | ||
description: Current status of LDO2 | ||
access: ReadOnly | ||
conversion: | ||
name: LDSW2PWRUPLDO | ||
LDODISABLED: | ||
value: 0 | ||
description: LDO powered off | ||
LDOPOWERED: | ||
value: 1 | ||
description: LDO powered on | ||
LDSWENABLE: | ||
base: uint | ||
start: 4 | ||
end: 5 | ||
description: Status of LDSW[n] and LDO[n] |
File renamed without changes.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains 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 @@ | ||
[target.'cfg(all(target_arch = "arm", target_os = "none"))'] | ||
# runner = "probe-rs run --chip nRF9160_xxAA" | ||
runner = [ "probe-rs", "run", "--chip=nRF9160_xxAA", "--always-print-stacktrace", "--log-format={t} {[{L}]%bold} {s} {{c} {ff}:{l:1}%dimmed}" ] | ||
|
||
[build] | ||
target = "thumbv8m.main-none-eabihf" | ||
|
||
[env] | ||
DEFMT_LOG = "trace" |
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.
It looks like many LOADSW configuration registers are not supported
LDSW1GPISEL
,LDSWCONFIG
,LDSW1LDOSEL
,LDSW1VOUTSEL
, etc.If that's really the case, I suggest making it explicit in the README and create an issue to add support for those registers.