-
Notifications
You must be signed in to change notification settings - Fork 8.2k
boards: shields: Adding support for the waveshare pico ups-b shield #60384
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
Merged
fabiobaltieri
merged 1 commit into
zephyrproject-rtos:main
from
joeker64:add_pico_ups_shield
Nov 27, 2023
Merged
Changes from all commits
Commits
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
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
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,5 @@ | ||
| # Copyright (c) 2023 Joseph Yates | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| config SHIELD_WAVESHARE_PICO_UPS_B | ||
| def_bool $(shields_list_contains,waveshare_pico_ups_b) |
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,18 @@ | ||
| /* | ||
| * Copyright (c) 2023 Joseph Yates | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
|
|
||
| &pinctrl { | ||
| i2c1_default: i2c1_default { | ||
| group1 { | ||
| bias-pull-up; | ||
| }; | ||
| }; | ||
| }; | ||
|
|
||
| &pico_i2c1 { | ||
| status = "okay"; | ||
| }; |
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,141 @@ | ||
| .. _waveshare_pico_ups_b_shield: | ||
|
|
||
| Waveshare Pico UPS-B shield | ||
| ########################### | ||
|
|
||
| Overview | ||
| ******** | ||
|
|
||
| The Waveshare Pico UPS-B shield is an uninterruptible Power supply (UPS) | ||
| module designed for the Raspberry Pi Pico which uses the Texas Instruments' INA219 | ||
| current/power Monitor. It communicates with the Raspberry Pi Pico over I2C | ||
|
|
||
| .. figure:: waveshare_pico_ups_b.jpg | ||
| :align: center | ||
| :alt: Waveshare Pico UPS-B shield | ||
|
|
||
| Waveshare Pico UPS-B shield | ||
|
|
||
| Hardware | ||
| -------- | ||
|
|
||
| - INA219 | ||
|
|
||
| - Senses bus voltages from 0 to 26 V | ||
| - Reports current, voltage and power | ||
| - 16 Programmable Addresses | ||
| - SOT23-8 and SOIC-8 packages | ||
| - Calibration registers | ||
|
|
||
| - ETA6003 | ||
|
|
||
| - Switching charger with power path management | ||
| - Up to 95% DC-DC efficiency | ||
| - 0mΩ power path MOSFET | ||
| - Up to 2.5A max charging current | ||
|
|
||
| - Connectivity | ||
|
|
||
| - Raspberry Pi Pico compatible (I2C) | ||
| - 2 pin jst header for Li-po battery | ||
|
|
||
| -------+-----------------------+---------------------------+ | ||
| | Name | Function | Usage | | ||
| +=======+=======================+===========================+ | ||
| | GP0 | None | | | ||
| +-------+-----------------------+---------------------------+ | ||
| | GP1 | None | | | ||
| +-------+-----------------------+---------------------------+ | ||
| | GP2 | None | | | ||
| +-------+-----------------------+---------------------------+ | ||
| | GP3 | None | | | ||
| +-------+-----------------------+---------------------------+ | ||
| | GP4 | None | | | ||
| +-------+-----------------------+---------------------------+ | ||
| | GP5 | None | | | ||
| +-------+-----------------------+---------------------------+ | ||
| | GP6 | I2C1_SDA ACTIVE_LOW | INA219 | | ||
| +-------+-----------------------+---------------------------+ | ||
| | GP7 | I2C1_SCL ACTIVE_LOW | INA219 | | ||
| +-------+-----------------------+---------------------------+ | ||
| | GP8 | None | | | ||
| +-------+-----------------------+---------------------------+ | ||
| | GP9 | None | | | ||
| +-------+-----------------------+---------------------------+ | ||
| | GP10 | None | | | ||
| +-------+-----------------------+---------------------------+ | ||
| | GP11 | None | | | ||
| +-------+-----------------------+---------------------------+ | ||
| | GP12 | None | | | ||
| +-------+-----------------------+---------------------------+ | ||
| | GP13 | None | | | ||
| +-------+-----------------------+---------------------------+ | ||
| | GP14 | None | | | ||
| +-------+-----------------------+---------------------------+ | ||
| | GP15 | None | | | ||
| +-------+-----------------------+---------------------------+ | ||
| | GP16 | None | | | ||
| +-------+-----------------------+---------------------------+ | ||
| | GP17 | None | | | ||
| +-------+-----------------------+---------------------------+ | ||
| | GP18 | None | | | ||
| +-------+-----------------------+---------------------------+ | ||
| | GP19 | None | | | ||
| +-------+-----------------------+---------------------------+ | ||
| | GP20 | None | | | ||
| +-------+-----------------------+---------------------------+ | ||
| | GP21 | None | | | ||
| +-------+-----------------------+---------------------------+ | ||
| | GP22 | None | | | ||
| +-------+-----------------------+---------------------------+ | ||
| | GP23 | None | | | ||
| +-------+-----------------------+---------------------------+ | ||
| | GP24 | None | | | ||
| +-------+-----------------------+---------------------------+ | ||
| | GP25 | None | | | ||
| +-------+-----------------------+---------------------------+ | ||
| | GP26 | None | | | ||
| +-------+-----------------------+---------------------------+ | ||
| | GP27 | None | | | ||
| +-------+-----------------------+---------------------------+ | ||
| | GP28 | None | | | ||
| +-------+-----------------------+---------------------------+ | ||
|
|
||
|
|
||
| - Power Supply | ||
|
|
||
| - 3.3V ~ 5V | ||
|
|
||
| - Components | ||
|
|
||
| - Power switch | ||
| - Power LED | ||
| - Charging LED | ||
|
|
||
| For more information about the Waveshare Pico UPS-B: | ||
|
|
||
| - `Waveshare Pico UPS website`_ | ||
| - `INA219 data sheet`_ | ||
| - `ETA6003 data sheet`_ | ||
|
|
||
| Programming | ||
| *********** | ||
|
|
||
| Set ``-DSHIELD=waveshare_pico_ups_b`` when you invoke ``west build`` or ``cmake`` in your Zephyr application. For | ||
| example: | ||
|
|
||
| .. zephyr-app-commands:: | ||
| :zephyr-app: samples/sensor/ina219 | ||
| :tool: all | ||
| :board: rpi_pico | ||
| :shield: waveshare_pico_ups_b | ||
| :goals: build flash | ||
|
|
||
| .. _Waveshare Pico UPS website: | ||
| https://www.waveshare.com/wiki/Pico-UPS-B | ||
|
|
||
| .. _INA219 data sheet: | ||
| https://www.ti.com/lit/ds/symlink/ina219.pdf | ||
|
|
||
| .. _ETA6003 data sheet: | ||
| https://www.waveshare.com/w/upload/3/3f/ETA6003.pdf | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,19 @@ | ||
| /* | ||
| * Copyright (c) 2023 Joseph Yates | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| &pico_i2c1 { | ||
| waveshare_pico_ups: ina219@43 { | ||
| status = "okay"; | ||
| compatible = "ti,ina219"; | ||
| reg = <0x43>; | ||
| brng = <1>; | ||
| pg = <3>; | ||
| sadc = <12>; | ||
| badc = <12>; | ||
| shunt-milliohm = <100>; | ||
| lsb-microamp = <20>; | ||
| }; | ||
| }; |
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.
Uh oh!
There was an error while loading. Please reload this page.