Hi,
SDK17, Softdevice S112, NRF52805 custom board.
I have baremetal bsp implemented but I am new to Softdevice and struggling a bit with an interface concept beween two.
My peripheral needs to send periodically battery level info, in addition to the event driven sensor data.
I went through several BLE peripherals examples and most of them use app timers (RTC1) to schedule regular activity, however it seems that Softdevice can function wihithout app timers. For example Blinky calls only app_timer_init() but not app_timer_create() if I am not mistaken.
- Hence my thinking - because every microamp counts, I would prefer to avoid using second (RTC1) instance if Softdevice able to generate an event/callback from RTC0. My app uses 25ms interval and 20-ish for Peripheral Latency so I would presume RTC0 should fire some internal event on 25x20 count match? Or I guess I could pipeline SAADS measurements and track(start SAADC) the end of radio tx (assuming tx is self-triggered inside Softdevice)?
- If such event is available via Observer or whatever, would it be appropriate to start SAADC measurement (at max speed, doen't need to be very accurate) from such callback handler?
- The other way around, when my app wants to send async data, can it call sd_ble_gatts_hvx() from within an interrupt handler? Data collection is done via ppi, so I guess I would need to use EGU to generate SWI as an interface for the outside world? Or sd_ble_gatts_hvx() must be called from main() context only?
- My use case is very similar to the blood pressure measurement example but I can see it uses BLE Queue library (nrf_ble_gq_item_add() instead of sd_ble_gatts_hvx() call). Any specific reason for that? Especially within power consumption context?
Thanks for your help in advance.