我想开始我的道歉,因为这是这样一个beginners question, but I seem to be a little lost.
I’m looking at the ble_app_peripherial sample app (5.0.4 SDK). I’ve modified the code so that I can send the LED STATE from a connected mobile phone app to change the state of the LED.
However, I’m having trouble understanding how to send ads data. I understand from the ADC peripheral example how to read data from the ADC via adc_get_sample(void) . However I can not find this line in the code outside of the SDK adc.c file.
Am I missing something, does the ble_app_peripherial send ADC data ? If not, where do I put the code to get a ADC value ? Further, how do I transmit the data over the AdC channel ?
Many thanks for any help and apologies again for a beginners question.
Andy Cobley
University of Dundee
Hi AndyC,
Please check the8.26 Pillar 3 (Peripheral)chapter of theDA1458x Software Developer’s Guide (UM-B-050)user manual. This chapter demonstrates some basic interaction with three characteristics of a custom profile. TheADC VAL1 characteristic of the custom profile, reads samples from an ADC channel and send them via notification. Be aware that here is no hardware support for reading an Analog value and we are not using the adc.c driver for this example. So, when the ADC VAL 1 auto notifications are turned on from the central device and the notify operation is required by the peer, a 16-bit counter is incremented. This counter value emulates the Analog value of the ADC VAL 1.
Please check the user_catch_rest_hndl() function in the user_peripheral.c file in order to understand how each event is cached by the application and which user functions will be invoked. When the application gets a CUST1_IDX_CONTROL_POINT_VAL message, the user_custs1_ctrl_wr_ind_handler() function will be triggered from the user_catch_rest_hndl(). This function checks if the notifications are enabled or disabled and if they are enabled the app_adcval1_timer_cb_handler() callback will be invoked periodically when the app_easy_timer() elapses (APP_PERIPHERAL_CTRL_TIMER_DELAY = 100ms duration). This callback increments a 16-bit counter and sends each value to the central device via notifications
Thanks, PM_Dialog
Thanks for that. I think I was missing the Software developers guide.
https://support.dialog-semiconductor.com/resource/um-b-050-da1458x-softw...
Looks like that will get me started !
Andy