https://github.com/lupyuen/bl602_adc
BL602 ADC and Temperature Sensor Library for Apache NuttX OS
https://github.com/lupyuen/bl602_adc
bl602 bl604 nuttx pinecone pinedio riscv32
Last synced: 21 days ago
JSON representation
BL602 ADC and Temperature Sensor Library for Apache NuttX OS
- Host: GitHub
- URL: https://github.com/lupyuen/bl602_adc
- Owner: lupyuen
- License: apache-2.0
- Created: 2022-01-12T10:57:01.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-26T03:10:05.000Z (about 4 years ago)
- Last Synced: 2025-01-14T12:53:46.381Z (over 1 year ago)
- Topics: bl602, bl604, nuttx, pinecone, pinedio, riscv32
- Language: C
- Homepage: https://lupyuen.github.io/articles/book#nuttx-on-bl602
- Size: 177 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BL602 ADC and Temperature Sensor Library for Apache NuttX OS
This NuttX Library enables access to BL602's ADC and Internal Temperature Sensor. The code was ported from BL602 MCU SDK's ADC / GLB / EFuse Standard Driver with minimal changes...
- [bl_mcu_sdk/drivers/bl602_driver/std_drv](https://github.com/bouffalolab/bl_mcu_sdk/blob/master/drivers/bl602_driver/std_drv)
As explained in [this Twitter Thread](https://twitter.com/MisterTechBlog/status/1481425041275617283).
[(Note: This library is NOT the proper way to access ADC Hardware in NuttX. Hopefully someday we will have an ADC Driver for BL602 NuttX, then we can do away with this library)](https://www.linkedin.com/feed/update/urn:li:activity:6887353468663812096?commentUrn=urn%3Ali%3Acomment%3A%28activity%3A6887353468663812096%2C6887410260710055936%29&replyUrn=urn%3Ali%3Acomment%3A%28activity%3A6887353468663812096%2C6887411211546312704%29)
To test the BL602 ADC Library, run this NuttX App...
- [lupyuen/bl602_adc_test](https://github.com/lupyuen/bl602_adc_test)
# Install Library
To add this library to your NuttX project...
```bash
cd nuttx/nuttx/libs
git submodule add https://github.com/lupyuen/bl602_adc libbl602_adc
```
Next update the Makefiles and Kconfig...
- ["Update Makefiles and Kconfig"](https://lupyuen.github.io/articles/sx1262#update-makefiles-and-kconfig)
Change "__sx1262__" to "__bl602_adc__", preserve case
- [See the modified Makefiles and Kconfig](https://github.com/lupyuen/incubator-nuttx/commit/cbe6be8ca58407ec4a124348dd19c4986a60335e)
Then update the NuttX Build Config...
```bash
## TODO: Change this to the path of our "incubator-nuttx" folder
cd nuttx/nuttx
## Preserve the Build Config
cp .config ../config
## Erase the Build Config
make distclean
## For BL602: Configure the build for BL602
./tools/configure.sh bl602evb:nsh
## For ESP32: Configure the build for ESP32.
## TODO: Change "esp32-devkitc" to our ESP32 board.
./tools/configure.sh esp32-devkitc:nsh
## Restore the Build Config
cp ../config .config
## Edit the Build Config
make menuconfig
```
In menuconfig, enable the BL602 ADC Library under "Library Routines".