Here's the right way to set #BL602 ADC Gain ... By calling the BL602 ADC Standard Driver
Remember this awful hack for setting the #BL602 ADC Gain? Let's do this The Right Way with the ADC Low Level HAL
https://github.com/lupyuen/bl_iot_sdk/blob/adc/components/hal_drv/bl602_hal/bl_adc.c#L339-L367
Sadly #BL602 ADC High Level HAL won't let us average the ADC Samples ... So we rewrite our firmware to call ADC Low Level HAL instead
https://github.com/lupyuen/bl_iot_sdk/blob/adc/customer_app/sdk_app_adc2/sdk_app_adc2/demo.c
Why does our #BL602 Light Sensor work only in Sunlight? I'm guessing: 1️⃣ Because our LED is Blue 2️⃣ Sunlight is intense (especially in Singapore)
https://wiki.analog.com/university/courses/electronics/electronics-lab-led-sensor?rev=1551786227
Need to enable ADC Gain when reading the #BL602 LED ... By modding the BL602 ADC HAL source code 🙄
https://github.com/lupyuen/bl_iot_sdk/blob/adc/components/hal_drv/bl602_hal/bl_adc.c#L339-L367
Yep #PineCone #BL602's Blue LED works as a Light Sensor (I think) ... But only in Sunlight 🤔
https://github.com/lupyuen/bl_iot_sdk/blob/adc/customer_app/sdk_app_adc/sdk_app_adc/demo.c
Can we turn #PineCone #BL602's LED into a Light Sensor ... By reading it with ADC? 🤔
https://github.com/lupyuen/bl_iot_sdk/blob/adc/customer_app/sdk_app_adc/sdk_app_adc/demo.c
How we inject the "#BL602 Book" Cross-References into the #RustLang Wrapper Docs ... With our Rust Procedural Macro
https://github.com/lupyuen/bl602-rust-wrapper/blob/master/bl602-macros/src/safe_wrap.rs#L457-L511
How we read the "#BL602 Book" Cross-References ... From our #RustLang Procedural Macro
https://github.com/lupyuen/bl602-rust-wrapper/blob/master/bl602-macros/src/safe_wrap.rs#L483-L521
Let's inject these "#BL602 Book" cross-references into the #RustLang Docs ... By modding our Procedural Macro
https://github.com/lupyuen/bl602-rust-wrapper/blob/master/doclinks.md
Sadly the generated #BL602 #RustLang Wrappers lack documentation ... Shall we cross-reference "The RISC-V BL602 Book"? 🤔
https://lupyuen.github.io/articles/led#how-it-works-bl602-gpio
#BL706 MCU SDK has a cool reference to Quentin Tarantino's "Pulp Fiction" 😂
https://github.com/bouffalolab/bl_mcu_sdk/blob/master/examples/spi/spi_dma_sd/main.c#L82
IoT Techie and Educator / Apache NuttX PMC