#ST7789 Display will let us flip it, reverse it ... Here's how we do the #SPI thang on #BL602
https://lupyuen.github.io/articles/display#set-display-orientation
#PineCone #BL602 @ThePine64 tested OK with #BME280 over #SPI ... Here's the wiring that doesn't light up the WiFi LED 💡
https://github.com/lupyuen/bl_iot_sdk/blob/spi/customer_app/sdk_app_spi/sdk_app_spi/demo.c#L76
#PineCone #BL602 #SPI Unsolved Mysteries ... 1️⃣ Why are the SPI Data Pins flipped? 2️⃣ Why does Pin 0 light up the WiFi LED? 🤔
https://github.com/lupyuen/bl_iot_sdk/blob/spi/customer_app/sdk_app_spi/sdk_app_spi/demo.c#L54-L115
Here's how we control #BL602 #SPI Chip Select Pin ourselves ... Using plain old BL602 GPIO
https://github.com/lupyuen/bl_iot_sdk/blob/spi/customer_app/sdk_app_spi/sdk_app_spi/demo.c#L47-L128
Nope #BL602 #SPI HAL can't control Chip Select Pin by #GPIO ... Because it has already configured the pin for SPI Port earlier ... Let's control the pin ourselves 👋
https://github.com/lupyuen/bl_iot_sdk/blob/spi/components/hal_drv/bl602_hal/hal_spi.c#L98-L122
Nope #BL602 still receiving garbage from BME280 ... Let's do the #SPI Logic Analyser!
https://github.com/lupyuen/bl_iot_sdk/blob/spi/customer_app/sdk_app_spi/sdk_app_spi/demo.c#L70-L114
Sounds impossible... But #Arm's #SWD Protocol (to flash and debug firmware) runs just fine on #RaspberryPi's #SPI port... No need to bang out bits slowly and unreliably over GPIO! It's the reason why #PineTime fans @PINE64 can debug firmware with #VSCode today. Hmmm if only somebody had discovered this much earlier... 🤔 https://medium.com/@ly.lee/openocd-on-raspberry-pi-better-with-swd-on-spi-7dea9caeb590?source=friends_link&sk=df399bfd913d3e262447d28aa5af6b63
IoT Techie and Educator / Apache NuttX PMC