Kit API UM-B-085 Abstract This document describes the API specifications of software modules of the application running on the Dialog DA14681 Wearable Development Kit. This manual intends to assist software developers who implement applications using the DA14681 Wearable Development Kit.
Page 3
UM-B-085 DA14681 Wearable Development Kit API BLE Services ..........................35 Dialog Wearable Service..................... 35 6.1.1 DWS Data Structures and Types ................ 35 6.1.2 IoT Data Structures and Types ................36 6.1.3 Functions ......................42 6.1.4 Callback Functions ....................43 Health Care Service ......................44 6.2.1...
Page 4
UM-B-085 DA14681 Wearable Development Kit API Environmental Sensors HT-Implementation – API Specification ...... 117 8.2.3 8.2.3.1 Data Structures and Types ............118 8.2.3.2 Dependency Functions ..............123 8.2.3.3 Functions ..................123 Health Care Sensors HT-Implementation – API Specification ......129 8.2.4...
Page 5
UM-B-085 DA14681 Wearable Development Kit API 8.6.3 Initialization and Control Functions ..............221 8.6.4 Configuration Functions ..................222 8.6.5 State Functions ....................223 8.6.6 Data Acquisition Functions ................225 8.6.7 Data Reset Functions ..................226 8.6.8 Data Push Functions ..................226 Health Toolbox Libraries ......................
UM-B-085 DA14681 Wearable Development Kit API Tables Table 1: Wearable CTS API ........................ 12 Table 2: Wearable DWS API ....................... 13 Table 3: Wearable HCS API ........................ 15 Table 4: Wearable SUOTA API ......................17 Table 5: Wearable touch pad API ....................... 18 Table 6: Wearable push button API ....................
Page 8
UM-B-085 DA14681 Wearable Development Kit API Development Kit Dialog Wearable Service epoch time slot of a constant duration (wearables: 1 min) Firmware Generic Access Profile GATT Generic ATTribute profile Graphical Device Interface Graphical User Interface Health Care Service Health Toolbox...
CTS_SPEC, CURRENT TIME SERVICE SPECIFICATION V1.1, Bluetooth SIG. BAS_SPEC, BATTERY SERVICE SPECIFICATION V1.1, Bluetooth SIG. LS013B7DH03, Datasheet, Sharp Microelectronics. UM-B-077, DA14681 Wearable Development Kit Hardware Manual, User Manual, Dialog Semiconductor. [10] BMI160, Datasheet, Bosch Sensortec. [11] BMM150, Datasheet, Bosch Sensortec.
APIs.A more detailed description of the architecture, the set of necessary hardware and software components for development on Wearable Development Kit and guidelines to install and use the reference Smartphone/Tablet apps can be found in the user manual of the DA14681 wearable development kit [1].
UM-B-085 DA14681 Wearable Development Kit API Figure 2: Software Architecture The application software is organized in FreeRTOS tasks running on the top of the DA1468x SDK. All the details of DA1468x SDK can be found in and [3]. The main software modules and tasks of the wearable application are the following: ●...
UM-B-085 DA14681 Wearable Development Kit API Wearable Task Figure 3: Main Application Components The wearable main task (WRBL) handles the data transfers between other tasks (e.g. step counter data generated in the Health Toolbox task transferred to the UI task to be displayed and/or to the BLE Manager task to be sent to a peer device).
UM-B-085 DA14681 Wearable Development Kit API 5.1.1.1 Functions wrbl_cts_init() void wrbl_cts_init(void); Function Name Function Description Initialize the CTS component of the wearable task Parameters None Return Values None Notes wrbl_cts_notify_time_all() void wrbl_cts_notify_time_all(bool update_time); Function Name Function Description Notifies all connected peer devices of the (current) time/date.
UM-B-085 DA14681 Wearable Development Kit API 5.1.2.1 Functions wrbl_dws_init() void wrbl_dws_init(void); Function Name Function Description Initialize the DWS component of the wearable task. Parameters None Return Values None Notes wrbl_dws_send_data_report() void wrbl_dws_send_data_report(iot_report_id_t type, void * const data); Function Name Function Description Send data reports to the connected peer device.
UM-B-085 DA14681 Wearable Development Kit API 5.1.3.1 Functions wrbl_hcs_init() void wrbl_hcs_init(void); Function Name Function Description Initialize the HCS component of the wearable task. Parameters None Return Values None Notes handle_connected_hcs() void handle_connected_hcs(void); Function Name Function Description Function to inform the component of the new connection.
UM-B-085 DA14681 Wearable Development Kit API op_code Parameters Type of the accumulated counter value Value of the accumulated counter timestamp Timestamp of the epoch Return Values None Notes Valid types (op_codes) are: HCS_OP_CODE_STEP HCS_OP_CODE_HEART_RATE HCS_OP_CODE_SLEEP_QUALITY HCS_OP_CODE_CALORIES HCS_OP_CODE_BODY_STATE wrbl_hcs_send_status() void wrbl_hcs_send_status(hcs_op_code_t op_code, bool status);...
UM-B-085 DA14681 Wearable Development Kit API 5.1.4.1 Functions wrbl_suota_init() void wrbl_suota_init(void); Function Name Function Description Initialize the SUOTA module. Parameters None Return Values None Notes Interface The wearable device's user inputs are the push button and two touch buttons. The two touch buttons are used together to create a slide detection mechanism.
UM-B-085 DA14681 Wearable Development Kit API 5.2.1.2 Functions wrbl_touch_init() void wrbl_touch_init(wrbl_touch_event_callback event_cb); Function Name Function Description Initialize the touch module. event_cb Parameters Callback function to be called when a touch event is detected Return Values None Notes wrbl_touch_set_enable() void wrbl_touch_set_enable(bool enable);...
Data Storage is an abstraction layer that provides the functionality for storing epoch data in Flash memory using the Non-Volatile Memory Storage (NVMS) adapter of the SDK. A more detailed description of the library can be found in the user manual of the DA14681 wearable development kit [1].
UM-B-085 DA14681 Wearable Development Kit API Functions data_storage_init() data_storage_start_record() data_storage_stop_record() data_storage_add_new_epoch() data_storage_find_epoch_addr() data_storage_get_samples() data_storage_update_sample() data_storage_erase_hist() data_storage_handle_exception() 5.3.1.1 Data Structures and Types ds_sample_size_t Type Definition Name Description ds_sample_size_t Sample size enumeration type defined as: DS_SAMPLE_8_BIT = 2, DS_SAMPLE_4_BIT = 3, DS_SAMPLE_MAX...
UM-B-085 DA14681 Wearable Development Kit API 5.3.1.2 Functions data_storage_init() data_storage_t* data_storage_init(uint16_t heart_rate_size, Function Name uint16_t step_size, uint16_t calories_size, uint16_t sleep_size); Function Description Initializes the data storage module allocating required resources and initializes the NVMS adapter. heart_rate_size Parameters Heart rate region size...
Page 23
UM-B-085 DA14681 Wearable Development Kit API data_storage_add_new_epoch() ds_err_t data_storage_add_new_epoch(data_storage_t *ds, Function Name ds_data_type_t data_type, uint32_t data); Function Description Adds a new epoch in the chunk. Checks if there is space available and if not, creates space by erasing or shrinking the next chunk.
Page 24
UM-B-085 DA14681 Wearable Development Kit API data_storage_update_sample() ds_err_t data_storage_update_sample(data_storage_t *ds, Function Name uint32_t timestamp, ds_data_type_t data_type, uint8_t *new_data, uint16_t cnt); Function Description Updates the values of the referenced epochs with the ones provided. Epochs must be already written once and also must be contained in a single chunk.
UM-B-085 DA14681 Wearable Development Kit API 5.3.2 Battery State of Charge is a functionality of the wearable device that produces an estimation of the battery charge state as a percentage. To produce that estimation, the fuel gauge module is combined with the ADC module using a Vbat + Ibat method to calculate the remaining battery charge.
UM-B-085 DA14681 Wearable Development Kit API 5.3.3.1 Functions wrbl_clk_mngr_init() void wrbl_clk_mngr_init(void); Function Name Function Description Initialize wearable clock manager. Function creates required structures that need to run. Parameters None Return Values None Notes wrbl_clk_mngr_raise_clk() bool wrbl_clk_mngr_raise_clk(void); Function Name Function Description Request wearable clock to increase frequency.
UM-B-085 DA14681 Wearable Development Kit API 5.3.4.2 Functions wrbl_rtc_init() void wrbl_rtc_init(const rtc_callbacks_t *cb); Function Name Function Description Initialize the RTC module. Parameters Callback function to be called when an RTC event is detected Return Values None Notes handle_rtc() void handle_rtc(void);...
UM-B-085 DA14681 Wearable Development Kit API Table 11: Wearable Health Toolbox Control API Data Structures and Types srvc_iface_t srvc_sens_t ht_conf_type_t ht_ctrl_state_t sens_config_t srvc_state_t acc_values_t epoch_timestamps Functions wrbl_ht_ctrl_init() wrbl_ht_ctrl_stop() wrbl_ht_ctrl_get_sens_state() wrbl_ht_ctrl_get_iface_state() wrbl_ht_ctrl_config_sens() wrbl_ht_ctrl_switch_sens() wrbl_ht_ctrl_switch_iface() wrbl_ht_ctrl_set_init() wrbl_ht_ctrl_reset_sens() wrbl_ht_ctrl_config_basic_attrs() wrbl_ht_ctrl_config_sfl_coeffs() wrbl_ht_ctrl_config_calibr_coeffs() wrbl_ht_ctrl_config_calibr_control() wrbl_ht_ctrl_get_config()
Page 29
UM-B-085 DA14681 Wearable Development Kit API ht_conf_type_t Type Definition Name Description ht_conf_type_t Configuration type enumeration type defined as: CONF_START_HT, CONF_STOP_HT, CONF_BASIC_SETUP, CONF_CONFIG_DONE, CONF_RESET_DONE, CONF_SFL_CLBR_COEFFS, CONF_MAG_CLBR_CTRL, CONF_MAG_CLBR_CTRL_STAT, CONF_MAG_CLBR_CTRL_BASIC, CONF_MAG_CLBR_CTRL_SMART, CONF_MAG_CLBR_CTRL_CMPLT, CONF_MAG_CLBR_COEFFS, CONF_MAG_CLBR_COEFFS_STAT, CONF_MAG_CLBR_COEFFS_BASIC, CONF_MAG_CLBR_COEFFS_SMART, CONF_MAG_CLBR_COEFFS_CMPLT, CONF_ACC_CLBR, CONF_USER_PROFILE, CONF_STEP_SETTING, CONF_HRM_SETTING, CONF_SQ_SETTING ,...
Page 30
UM-B-085 DA14681 Wearable Development Kit API srvc_state_t Field Type Description config sens_config_t Corresponding sensor/service configuration ticks uint8_t Samples to drop in order to achieve required rate acc_values_t Field Type Description step uint32_t Steps accumulated value uint32_t Calories accumulated value sq_l...
UM-B-085 DA14681 Wearable Development Kit API 5.4.2 Functions wrbl_ht_ctrl_init() void wrbl_ht_ctrl_init(void); Function Name Function Description Stores DWS service handler and starts the Health Toolbox. Parameters None Return Values None Notes wrbl_ht_ctrl_stop() void wrbl_ht_ctrl_stop(void); Function Name Function Description Stop Health Toolbox...
Page 32
UM-B-085 DA14681 Wearable Development Kit API void wrbl_ht_ctrl_switch_sens(srvc_iface_t iface, srvc_sens_t sens, Function Name ht_ctrl_state_t sens_state); Function Description Enables or disables the referenced sensor/service without changing its settings. It stores the new state to be restored at startup when interface is enabled/disabled.
Page 33
UM-B-085 DA14681 Wearable Development Kit API Notes wrbl_ht_ctrl_config_sfl_coeffs() void wrbl_ht_ctrl_config_sfl_coeffs(iot_sfl_coeffs_t *iot_sfl_coeffs); Function Name Function Description Configures the BLE interface configuration applied. iot_sfl_coeffs Parameters SFL coefficients Return Values None Notes wrbl_ht_ctrl_config_calibr_coeffs() void wrbl_ht_ctrl_config_calibr_coeffs( iot_calibr_coeffs_t Function Name *iot_calibr_coeffs); Function Description Configures the BLE interface configuration applied.
Page 34
UM-B-085 DA14681 Wearable Development Kit API Function Description Resets the BLE iface sensors/services calibration settings to the default ones Parameters None Return Values None Notes wrbl_ht_ctrl_set_user_profile() void wrbl_ht_ctrl_set_user_profile(hcs_user_profile_t *user_profile); Function Name Function Description Configures the HCS user profile and configures the Health Toolbox services.
UM-B-085 DA14681 Wearable Development Kit API wrbl_ht_ctrl_store_clbr() void wrbl_ht_ctrl_store_clbr(void); Function Name Function Description Sores the current calibrations of the Health Toolbox to Flash memory. Parameters None Return Values None Notes wrbl_ht_ctrl_read_nv() void wrbl_ht_ctrl_read_nv(void); Function Name Function Description Retrieves the configurations/calibrations of the Health Toolbox from Flash memory if available.
UM-B-085 DA14681 Wearable Development Kit API dws_features_t Field Type Description accelerometer_en uint8_t Determines active characteristics. 0: disabled gyro_en uint8_t >0: enabled magn_en uint8_t pressure_en uint8_t humidity_en uint8_t temp_en uint8_t s_fusion_en uint8_t version[16] uint8_t SW version, in BCD format. device_type uint8_t Device type.
Page 37
UM-B-085 DA14681 Wearable Development Kit API iot_sensor_type_t Type Definition Name Description iot_sensor_type_t IoT sensor type enumeration type defined as: IOT_SENSOR_ACC, IOT_SENSOR_GYR, IOT_SENSOR_MAG, IOT_SENSOR_MAX iot_flags_t Type Definition Name Description iot_flags_t IoT sensor enable/combination enumeration type defined as: IOT_ENABLE_ACC_FLAG = (1 << 0), IOT_ENABLE_GYR_FLAG = (1 <<...
Page 38
UM-B-085 DA14681 Wearable Development Kit API iot_bmi160_gyro_range_t Type Definition Name Description iot_bmi160_gyro_range_t IoT BMI160 gyroscope range enumeration type defined as: IOT_BMI160_GYRO_RANGE_2000_DEG_SEC = 0x00, IOT_BMI160_GYRO_RANGE_1000_DEG_SEC = 0x01, IOT_BMI160_GYRO_RANGE_500_DEG_SEC = 0x02, IOT_BMI160_GYRO_RANGE_250_DEG_SEC = 0x03 iot_bmi160_gyro_rate_t Type Definition Name Description iot_bmi160_gyro_rate_t IoT BMI160 gyroscope rate enumeration type defined as:...
Page 39
UM-B-085 DA14681 Wearable Development Kit API iot_cal_mode_t Type Definition Name Description iot_cal_mode_t IoT calibration mode enumeration type defined as: IOT_CAL_MODE_NONE = 0, IOT_CAL_MODE_STATIC = 1, IOT_CAL_MODE_AUTO_CONT = 2, IOT_CAL_MODE_AUTO_ONE_SHOT iot_auto_cal_mode_t Type Definition Name Description iot_auto_cal_mode_t IoT auto calibration mode enumeration type defined as:...
UM-B-085 DA14681 Wearable Development Kit API iot_sfl_coeffs_t Field Type Description beta_a uint16_t Beta A SFL coefficient beta_m uint16_t Beta M SFL coefficient reserved[4] uint8_t Reserved iot_calibr_coeffs_t Field Type Description sensor_type uint8_t Sensor type (as in iot_sensor_type_t) q_format uint8_t Q format of matrix...
Page 41
UM-B-085 DA14681 Wearable Development Kit API iot_ctrl_params_t Field Type Description sensor_status uint8_t Sensor state status basic_setup iot_basic_setup_t Basic setup of the sensors sfl_coefficients iot_sfl_coeffs_t Smart fusion library coefficients calibr_coeffs iot_calibr_coeffs_t Calibration coefficients calibr_ctrl iot_calibr_ctrl_t Calibration control configuration iot_control_t Field Type...
UM-B-085 DA14681 Wearable Development Kit API Field Type Description ucSensorState uint8_t Sensor state ucSensorEvent uint8_t Sensor event (always 3, reserved FFU) val32 int32_t Sensor value of pressure/humidity/temperature iot_data_report_sf_t Field Type Description ucReportId uint8_t Report ID type (as in iot_report_id_t) ucSensorState...
UM-B-085 DA14681 Wearable Development Kit API 6.1.4 Callback Functions dws_control_val_wr_valid() att_error_t dws_control_val_wr_valid(ble_service_t *svc, Function Name uint16_t conn_idx, const uint8_t *msg, uint16_t length); Function Description Callback function to be called when a write control value is received in order to check validity of the command.
UM-B-085 DA14681 Wearable Development Kit API Health Care Service The Health Care Service (HCS) is a Dialog proprietary GATT service used to control, configure and reading output data from Health Care services running on the Wearable DK. By supporting the GATT client role a remote BLE central connected to the Wearable DK can perform the following operations: ●...
Page 45
UM-B-085 DA14681 Wearable Development Kit API hcs_ctrl_cmd_t Type Definition Name Description hcs_ctrl_cmd_t HCS control command enumeration type defined as: HCS_CTRL_STOP, HCS_CTRL_START, HCS_CTRL_RESET, HCS_HEART_RATE_MODE_ONE_SHOT, HCS_HEART_RATE_MODE_CONTINOUS, HCS_CALORIES_ACT_WALK_RUN, HCS_CALORIES_ACT_CYCLING, HCS_READ_HISTORICAL_DATA, HCS_READ_OPERATION_STATE, HCS_READ_COUNTER hcs_op_code_t Type Definition Name Description hcs_op_code_t HCS operation code enumeration type defined as:...
Page 46
UM-B-085 DA14681 Wearable Development Kit API hcs_calories_mode_t Type Definition Name Description hcs_calories_mode_t HCS burned calories mode enumeration type defined as: HCS_CALORIES_WALKING = 0xF0, HCS_CALORIES_CYCLING hcs_heart_rate_mode_t Type Definition Name Description hcs_heart_rate_mode_t HCS heart rate mode enumeration type defined as: HCS_HR_ONE_SHOT = 0x00,...
Page 47
UM-B-085 DA14681 Wearable Development Kit API hcs_sleep_quality_t Field Type Description timestamp uint32_t Sleep quality epoch timestamp state hcs_sq_state_t:8 Sleep quality epoch state hcs_data_chunk_header_t Field Type Description timestamp uint32_t Historical data chunk header timestamp epochs_cnt uint16_t Historical data chunk header epochs found...
UM-B-085 DA14681 Wearable Development Kit API 6.2.2 Functions hcs_init() ble_service_t *hcs_init(const hcs_callbacks_t * const cb, Function Name const hcs_features_t features, const hcs_user_profile_t * const user_profile); Function Description Registers health care service instance. Parameters Application callbacks hcs_features Application supported features user_profile...
UM-B-085 DA14681 Wearable Development Kit API 6.2.3 Callback Functions user_profile_cfg() void user_profile_cfg(ble_service_t *svc, uint16_t conn_idx, Function Name hcs_user_profile_t *user_profile); Function Description Callback function to be called when a user profile is received. Parameters Service instance conn_idx Connection index user_profile User profile settings...
Page 51
UM-B-085 DA14681 Wearable Development Kit API get_acc_counter_val() uint32_t get_acc_counter_val(ble_service_t *svc, uint16_t conn_idx, Function Name hcs_op_code_t op_code); Function Description Callback function to be called when a service's accumulated counter is requested. Parameters Service instance conn_idx Connection index op_code Value reference Return Values...
UM-B-085 DA14681 Wearable Development Kit API SUOTA Service The SUOTA Service is a Dialog proprietary BLE service used for updating the firmware of BLE devices. Details and service specification can be found in [4]. A complete API specification of the SUOTA implementation can be found in the Doxygen generated files of the SDK and specifically in the file sdk_680/doc/html/dlg__suota_8h.html.
UM-B-085 DA14681 Wearable Development Kit API User Interface UI Task The UI task is the upper layer in communication with the LS013B7DH03 display. The UI task functions can be called from other tasks (e.g. the WRBL task) for specific operations on the LS013B7DH03 via the GUI and the display driver API.
UM-B-085 DA14681 Wearable Development Kit API Table 14: User Interface Task API Structures ui_screen_num_t ui_change_mode_t ui_operation_mode_t ui_screen_element_t ui_t Functions ui_task_init() ui_task_[enable/disable]_display() ui_task_register_screen_[change/updated]_cb() ui_task_set_screen() ui_task_swipe_screen_[left/right/up/down]() ui_task_show_splash_screen() ui_task_blink_screen_elem() ui_task_set_change_mode() ui_task_change_opmode() ui_task_set_vibration_state() ui_task_set_battery_level() ui_task_set_battery_state() ui_task_set_connection_state() ui_task_set_alarm_state() ui_task_set_time_[hours/minutes]_val() ui_task_set_date_[day/month/year]_val() ui_task_set_alarm_[hours/minutes]_val() ui_task_set_[sensor or service]_val() Callbacks...
Page 55
UM-B-085 DA14681 Wearable Development Kit API ui_operation_mode_t Type Definition Name Description ui_operation_mode_t Operation mode enumeration type defined as: UI_OPERATION_MODE_ON, UI_OPERATION_MODE_OFF, UI_OPERATION_MODE_PWR_SAVE ui_screen_element_t Type Definition Name Description ui_screen_element_t Screen element enumeration type defined as: UI_ELEM_ICON, UI_ELEM_LABEL ui_t Field Type Description handle...
UM-B-085 DA14681 Wearable Development Kit API 7.1.2 Functions ui_task_init() OS_BASE_TYPE ui_task_init(void); Function Name Function Description Initializes UI task. Parameters Return Values OS_OK if initialization completed successfully, OS_FAIL otherwise. Notes ui_task_[enable/disable]_display() void ui_task_enable_display(); Function Name void ui_task_disable_display(); Function Description Enables\disables display.
Page 57
UM-B-085 DA14681 Wearable Development Kit API ui_task_swipe_screen_[left/right/up/down]() void ui_task_swipe_screen_left(); Function Name void ui_task_swipe_screen_right(); void ui_task_swipe_screen_up(); void ui_task_swipe_screen_down(); Function Description Swipes to left/right/up/down screen. Parameters None Return Values Notes ui_task_show_splash_screen() void ui_task_show_splash_screen(); Function Name Function Description Shows splash screen with Dialog Semi logo.
Page 58
UM-B-085 DA14681 Wearable Development Kit API void ui_task_change_opmode(ui_screen_num_t screen, Function Name ui_op_mode_t opmode); Function Description Changes operation mode for the selected screen. screen Parameters Screen number opmode Operation mode to set Return Values Notes Valid types (screens) are: UI_NFC_SCREEN UI_HEART_RATE_SCREEN...
Page 59
UM-B-085 DA14681 Wearable Development Kit API ui_task_set_alarm_state() void ui_task_set_alarm_state(bool value); Function Name Function Description Sets state of alarm. value Parameters Alarm state (true = ON, false = OFF) Return Values Notes ui_task_set_time_[hours/minutes]_val() void ui_task_set_time_hours_val(uint8_t value); Function Name void ui_task_set_time_minutes_val(uint8_t value);...
UM-B-085 DA14681 Wearable Development Kit API Notes 7.1.2.2 Callbacks screen_changed_cb() void screen_changed_cb(ui_screen_num_t active_screen); Function Name Function Description Informs of change screen event. active_screen Parameters Number of active screen Return Values Notes screen_updated_cb() void screen_updated_cb(ui_screen_num_t active_screen); Function Name Function Description Informs of refresh screen event.
Page 61
UM-B-085 DA14681 Wearable Development Kit API gdi_t Field Type Description buffers[GDI_NUM_OF_BUFFERS] uint8_t * Frame buffers table active_buffer uint8_t * Pointer to active frame buffer buffer_num uint8_t Number of active frame buffer bg_color gdi_color_t Display background color display_enabled bool Display enabled state User Manual Revision 1.0...
UM-B-085 DA14681 Wearable Development Kit API 7.2.1.2 Functions gdi_init() void gdi_init(void); Function Name Initializes the GDI instance – allocate memory and set default background color Function Description Parameters None Return Values None Notes gdi_display_[enable/display]() void gdi_display_enable(void); Function Name void gdi_display_disable(void);...
Page 63
UM-B-085 DA14681 Wearable Development Kit API Function Description Updates display in left/right/up/down direction using data from two frame buffers with swipe animation. Parameters None Return Values None Notes gdi_set_bg_color() void gdi_set_bg_color(gdi_color_t color); Function Name Function Description Sets the background color for all frame buffers. The existing frame buffer content will be erased.
Page 64
UM-B-085 DA14681 Wearable Development Kit API gdi_[set/clear]_dot() void gdi_set_dot(uint8_t x, uint8_t y); Function Name void gdi_clear_dot(uint8_t x, uint8_t y); Function Description Draws/clears pixel. Parameters Pixel x coordinate Pixel y coordinate Return Values None Notes gdi_draw_[fill_]circle() void gdi_draw_circle(uint8_t x0, uint8_t y0, uint8_t radius);...
UM-B-085 DA14681 Wearable Development Kit API Function Description Draw rectangle/filled rectangle. Parameters Upper left corner x coordinate Upper left corner y coordinate Rectangle width Rectangle height Return Values None Notes gdi_draw_arc() void gdi_draw_arc(uint8_t x, uint8_t y, uint8_t r, uint8_t t, Function Name int start_angle, int end_angle);...
UM-B-085 DA14681 Wearable Development Kit API Static Label Functions ui_draw_static_label() Status Bar Functions ui_draw_status_bar() ui_status_bar_redraw_needed() ui_register_status_bar() ui_unregister_status_bar() Textbox Functions ui_draw_textbox() ui_textbox_set_text() 7.2.2.1 Data Structures and Types ui_battery_state_t Type Definition Name Description ui_battery_state_t Battery state enumeration type defined as: UI_BATTERY_NOT_CHARGING, UI_BATTERY_CHARGING,...
Page 67
UM-B-085 DA14681 Wearable Development Kit API Field Type Description properties const void * Can be used to store additional item parameters. Each widget has its own parameters. status void * Can be used to handle item status. Currently used only by textbox widget to store initial text.
UM-B-085 DA14681 Wearable Development Kit API 7.2.2.2 Battery Widget Functions ui_draw_battery() void ui_draw_battery(const ui_screen_item_t *item, uint8_t x, uint8_t y); Function Name Function Description Draws battery widget. item Parameters Pointer to suitable screen widget X coordinate of the widget Y coordinate of the widget...
UM-B-085 DA14681 Wearable Development Kit API Return Values None Notes 7.2.2.4 Common Functions ui_measure_string() uint8_t ui_measure_string(const font_info_t * const font, Function Name const char * const str); Function Description Measures the string length. font Parameters Pointer to the font definition...
UM-B-085 DA14681 Wearable Development Kit API 7.2.2.6 Screen Functions ui_set_active_screen() void ui_set_active_screen(const ui_screen_t * const screen); Function Name Function Description Sets active screen. screen Parameters Pointer to suitable screen Return Values None Notes ui_draw_active_screen() uint8_t ui_draw_active_screen(bool force_redraw); Function Name Function Description Draws active screen.
UM-B-085 DA14681 Wearable Development Kit API item Parameters Pointer to suitable screen widget Corresponding parameter visibility Visibility state of screen widget validity Validity state of screen widget blinking Blinking state of screen widget Return Values None Notes ui_get_item_[visibility/validity/blinking]() bool ui_get_item_visibility(const ui_screen_item_t * const item);...
UM-B-085 DA14681 Wearable Development Kit API Function Description Checks if status bar widget should be redrawn. status_bar Parameters Pointer to status bar widget Return Values None Notes ui_register_status_bar() void ui_register_status_bar(const ui_status_bar_t *bar); Function Name Function Description Registers status bar. Parameters...
UM-B-085 DA14681 Wearable Development Kit API ● Services/algorithms processing sensor data and producing human motion and healthcare related metrics, which determine an estimate of human physical activity and health status. Based on this basic classification of control and data flows determining the general execution flow...
UM-B-085 DA14681 Wearable Development Kit API Table 17: Basic Health Toolbox API Sensors/Services Configuration Functions Sensor or Configuration Parameters Service Name Enable/ Mode Rate Other Disable Sensors ht_config_acc() √ Accelerometer not available 0.78, 1.56, 3.12, Range: 6.25, 12.5, 25, ±2, ±4, ±8, ±16...
UM-B-085 DA14681 Wearable Development Kit API Data Acquisition Functions ht_data_read_acc() ht_data_read_gyr() ht_data_read_mag() ht_data_read_env() ht_data_read_sc() ht_data_read_sf() ht_data_read_hr() ht_data_read_sq() ht_data_read_cc() ht_data_read_bs() ht_data_read_s1() Data-Reset Functions ht_data_reset_sc() ht_data_reset_sq() ht_data_reset_cc() 8.1.1 Data Structures and Types ht_error_t Type Definition Name Description ht_error_t Execution status of a function:...
Page 77
UM-B-085 DA14681 Wearable Development Kit API ht_calibr_coeffs_t Data Structure Fields Type Description cal_mode uint8_t Magnetometer calibration mode: HT_MAG_CAL_MODE_NONE, HT_MAG_CAL_MODE_STATIC, HT_MAG_CAL_MODE_ONE_SHOT_AUTO_BASIC, HT_MAG_CAL_MODE_CONT_AUTO_BASIC, HT_MAG_CAL_MODE_ONE_SHOT_AUTO_SMART, HT_MAG_CAL_MODE_CONT_AUTO_SMART q_format uint8_t Calibration coefficients Q format. offset_vector int16_t[3] Offset coefficients. matrix int16_t[3][3] Matrix coefficients. ht_calibr_ctrl_t Data Structure Fields...
Page 78
UM-B-085 DA14681 Wearable Development Kit API Data Structure Fields Type Description Rate uint8_t Accelerometer sensor data rate: HT_ACCEL_DATA_RATE_INVALID, HT_ACCEL_DATA_RATE_0_78HZ, HT_ACCEL_DATA_RATE_1_56HZ, HT_ACCEL_DATA_RATE_3_12HZ, HT_ACCEL_DATA_RATE_6_25HZ, HT_ACCEL_DATA_RATE_12_5HZ, HT_ACCEL_DATA_RATE_25HZ, HT_ACCEL_DATA_RATE_50HZ, HT_ACCEL_DATA_RATE_100HZ ht_gyr_config_t Data Structure Fields Type Description enable bool Enable/disable gyroscope sensor: HT_DISABLE, HT_ENABLE range...
Page 79
UM-B-085 DA14681 Wearable Development Kit API ht_env_config_t Data Structure Fields Type Description enable bool Enable/disable environmental sensors: HT_DISABLE, HT_ENABLE rate uint32_t Environmental sensors data rate: HT_ENV_DATA_RATE_0_125HZ, HT_ENV_DATA_RATE_0_25HZ, HT_ENV_DATA_RATE_0_5HZ, HT_ENV_DATA_RATE_1HZ, HT_ENV_DATA_RATE_2HZ, HT_ENV_DATA_RATE_4HZ, HT_ENV_DATA_RATE_8HZ, HT_ENV_DATA_RATE_DISABLE ht_sc_config_t Data Structure Fields Type Description enable...
Page 80
UM-B-085 DA14681 Wearable Development Kit API ht_hr_config_t Data Structure Fields Type Description enable bool Enable/disable heart rate estimation service: HT_DISABLE, HT_ENABLE mode uint8_t Heart rate estimation mode: HT_HR_MODE_REGULAR, HT_HR_MODE_INTERMITTENT rate uint32_t Heart rate estimation service data rate: HT_HR_DATA_RATE_1_PER_60SEC_HZ, HT_HR_DATA_RATE_1_PER_30SEC_HZ, HT_HR_DATA_RATE_1_PER_15SEC_HZ,...
Page 81
UM-B-085 DA14681 Wearable Development Kit API Data Structure Fields Type Description mode uint8_t (Template) s1 mode: HT_S1_MODE_TYPE_MODE_1, HT_S1_MODE_TYPE_MODE_2 rate uint8_t (Template) s1 service data rate: HT_S1_DATA_RATE_INVALID, HT_S1_DATA_RATE_0_78HZ, HT_S1_DATA_RATE_1_56HZ, HT_S1_DATA_RATE_3_12HZ, HT_S1_DATA_RATE_6_25HZ, HT_S1_DATA_RATE_12_5HZ, HT_S1_DATA_RATE_25HZ, HT_S1_DATA_RATE_50HZ, HT_S1_DATA_RATE_100HZ acc_range uint8_t (Template) s1 accelerometer (as input) sensor...
Page 82
UM-B-085 DA14681 Wearable Development Kit API Data Structure Fields Type Description gender uint8_t Calories counting user's gender type (m/f): HT_UPF_GENDER_TYPE_FEMALE, HT_UPF_GENDER_TYPE_MALE height uint8_t Calories counting user's height (in cm). weight uint8_t Calories counting user's weight (in kg). ht_upf_t Type Definition Name...
Page 83
UM-B-085 DA14681 Wearable Development Kit API ht_hr_t Type Definition Name Description ht_hr_t Configuration state structure for heart rate estimation service: ht_hr_config_t ht_sq_t Type Definition Name Description ht_sq_t Configuration state structure for sleep quality monitoring service: ht_sq_config_t ht_cc_t Type Definition Name...
Page 84
UM-B-085 DA14681 Wearable Development Kit API Data Structure Fields Type Description xyz.y int16_t Accelerometer y-axis sensor data value. xyz.z int16_t Accelerometer z-axis sensor data value. calibr_state. uint8_t:1 Pre-calibrated data valid flag. uncalibr_data_valid calibr_state. uint8_t:1 Post-calibrated data valid flag. calibr_data_valid calibr_state. cal_enabled uint8_t:1 Calibration enabled flag.
UM-B-085 DA14681 Wearable Development Kit API Data Structure Fields Type Description humidity uint32_t Humidity sensor data (in %RH as unsigned 32-bit integer in Q22.10 format (22 integer 10 fractional bits)). ht_data_sc_t Data Structure Fields Type Description step_count uint32_t Number of steps counted.
UM-B-085 DA14681 Wearable Development Kit API Data Structure Fields Type Description epoch uint32_t First epoch number sleep quality monitoring data refer ht_data_cc_t Data Structure Fields Type Description calories int32_t Amount of calories burned (in cal). distance int32_t Distance covered (in cm).
UM-B-085 DA14681 Wearable Development Kit API 8.1.2 Dependency Functions ht_handle_t -> ht_clear_done() void (*ht_clear_done)(ht_error_t error) Function Name Function Description (Optional) Handles indication that Health Toolbox Task has been cleared. the execution status of ‘clear’ operation error Parameters HT_SUCCESS, ≥ HT_FAIL...
UM-B-085 DA14681 Wearable Development Kit API ht_handle_t -> ht_state_get_done() void (*ht_state_get_done)(uint8_t type, void* state, ht_error_t error) Function Name Function Description (Optional) Handles indication that the configuration state of a specific sensor or service in Health Toolbox component has been acquired.
UM-B-085 DA14681 Wearable Development Kit API ht_handle_t -> ht_data_reset_done() void (*ht_data_reset_done)(uint8_t type, ht_error_t error) Function Name Function Description (Optional) Handles indication that resetting data of a specific sensor or service in Health Toolbox component has been completed. type Parameters the sensor or service type HT_SERVICE_TYPE_SC, HT_SERVICE_TYPE_SQT, HT_SERVICE_TYPE_CCT the execution status of ‘data-reset’...
UM-B-085 DA14681 Wearable Development Kit API Function Description Initializes Health Toolbox, setting initial values to the internal variables and structures, creating a FreeRTOS task for control coordination and data manipulation, and initializing services, sensors (putting to suspend mode) and other processes being supported.
UM-B-085 DA14681 Wearable Development Kit API ht_error_t ht_rtc_send_notif(void) Function Name Function Description Sends RTC tick notification to Health Toolbox. If RTC interval is not appropriate for Health Toolbox operation, RTC tick notification is ignored. Parameters None HT_SUCCESS for successful execution; ≥ HT_FAIL for error...
UM-B-085 DA14681 Wearable Development Kit API Function Description Configures magnetometer calibration control. If the respective function pointer is defined in ht_handle_t instance handle, a config-done indication is sent via ht_config_done() callback function, setting parameter type to HT_CONFIG_CALIBR_CONTROL_MAG. A calibration-control-changed indication is sent via ht_calibr_done() callback function, setting parameter type to HT_CALIBR_CONTROL_MAG.
UM-B-085 DA14681 Wearable Development Kit API ht_error_t ht_config_gyr(ht_gyr_config_t* config) Function Name Function Description Configures gyroscope sensor. If the respective function pointer is defined in ht_handle_t instance handle, a config-done indication is sent via ht_config_done() callback function, setting parameter type to HT_CONFIG_GYR.
UM-B-085 DA14681 Wearable Development Kit API Function Configures sensor fusion service. If the respective function pointer is defined in ht_handle_t instance handle, a config-done indication is sent via ht_config_done() Description callback function, setting parameter type to HT_CONFIG_SF. Sensor fusion service data indications are sent via ht_data_indication() callback function, setting parameter type to HT_SERVICE_TYPE_SF.
UM-B-085 DA14681 Wearable Development Kit API Function Description Configures body state classification service. If the respective function pointer is defined in ht_handle_t instance handle, a config-done indication is sent via ht_config_done() callback function, setting parameter type to HT_CONFIG_BS. Body state classification service data indications are sent via ht_data_indication() callback function, setting parameter type to HT_SERVICE_TYPE_BS.
UM-B-085 DA14681 Wearable Development Kit API Notes ht_state_get_sf_coeffs() ht_error_t ht_state_get_sf_coeffs(void) Function Name Function Description Gets configuration status of sensor fusion coefficients. If the respective function pointer is defined in ht_handle_t instance handle, a state-get-done indication is sent via ht_state_get_done() callback function, carrying the configuration status structure and setting parameter type to HT_STATE_SF_COEFFS.
UM-B-085 DA14681 Wearable Development Kit API Function Description Gets configuration status of accelerometer sensor. If the respective function pointer is defined in ht_handle_t instance handle, a state-get-done indication is sent via ht_state_get_done() callback function, carrying the configuration status structure and setting parameter type to HT_STATE_ACC.
UM-B-085 DA14681 Wearable Development Kit API Notes ht_state_get_sf() ht_error_t ht_state_get_sf(void) Function Name Function Description Gets configuration status of sensor fusion service. If the respective function pointer is defined in ht_handle_t instance handle, a state-get-done indication is sent via ht_state_get_done() callback function, carrying the configuration status structure and setting parameter type to HT_STATE_SF.
UM-B-085 DA14681 Wearable Development Kit API Function Description Gets configuration status of body state classification service. If the respective function pointer is defined in ht_handle_t instance handle, a state-get-done indication is sent via ht_state_get_done() callback function, carrying the configuration status structure and setting parameter type to HT_STATE_BS.
UM-B-085 DA14681 Wearable Development Kit API 8.1.3.4 Data Acquisition Functions ht_data_read_acc() ht_error_t ht_data_read_acc(void) Function Name Function Description Reads last accelerometer data. If accelerometer sensor is enabled and the respective function pointer is defined in ht_handle_t instance handle, a data-read-done indication is sent via ht_data_read_done() callback function, carrying last accelerometer sensor data values and setting parameter type to HT_SENSOR_TYPE_ACC.
UM-B-085 DA14681 Wearable Development Kit API Function Description Reads last step counting data. If step counting service is enabled and the respective function pointer is defined in ht_handle_t instance handle, a data-read-done indication is sent via ht_data_read_done() callback function, carrying total step counter value and setting parameter type to HT_SERVICE_TYPE_SC.
UM-B-085 DA14681 Wearable Development Kit API Notes ht_data_read_bs() ht_error_t ht_data_read_bs(void) Function Name Function Description Reads last body state classification data. If body state classification service is enabled and the respective function pointer is defined in ht_handle_t instance handle, a data-...
UM-B-085 DA14681 Wearable Development Kit API 8.1.3.5 Data-Reset Functions ht_data_reset_sc() ht_error_t ht_data_reset_sc(void) Function Name Function Description Resets total step counter value. If the respective function pointer is defined in ht_handle_t instance handle, a data-reset-done indication is sent via ht_data_reset_done() callback function, setting parameter type to HT_SERVICE_TYPE_SC.
UM-B-085 DA14681 Wearable Development Kit API Health Toolbox Implementations Health Toolbox provides a list of sub-components, called “Health Toolbox implementations”, which implement the creation of multiple instances of control and data manipulation (i.e. control and data flows) over the supported/integrated sensors/services by the Health Toolbox. The source code and...
UM-B-085 DA14681 Wearable Development Kit API ht_impl_task_context_request() void ht_impl_task_context_request(ht_impl_task_cntx_req_cb_t* cb, Function Name bool* notif_pending) Function Description Requests (new) task context execution flow, providing the callback function through which the execution flow will be returned. Parameters the callback function through which the execution flow will...
UM-B-085 DA14681 Wearable Development Kit API ht_impl_inertial_config_t Data Structure Fields Type Description acc_config ht_impl_acc_config_t Accelerometer sensor data flow configuration structure. gyr_config ht_impl_gyr_config_t Gyroscope sensor data flow configuration structure. mag_config ht_impl_mag_config_t Magnetometer sensor data flow configuration structure. ht_impl_acc_t Type Definition Name...
UM-B-085 DA14681 Wearable Development Kit API ht_impl_data_mag_t Data Structure Fields Type Description xyz.x int16_t Magnetometer x-axis sensor data value. xyz.y int16_t Magnetometer y-axis sensor data value. xyz.z int16_t Magnetometer z-axis sensor data value. calibr_state. uncalibr_data_valid uint8_t:1 Pre-calibrated data valid flag.
UM-B-085 DA14681 Wearable Development Kit API 8.2.2.2 Dependency Functions ht_impl_inertial_handle_t -> inertial_data_cb() ht_impl_error_t (*inertial_data_cb)(void* data, uint16_t size, Function Name ht_impl_data_ref_released_cb_t cb) Function Description (Optional) Callback function which is called when inertial sensor data need to be sent over a defined data flow instance of type ht_impl_inertial_handle_t, based on the defined inertial_sensor_types field.
UM-B-085 DA14681 Wearable Development Kit API HT_IMPL_SUCCESS for successful execution; ≥ HT_IMPL_FAIL for error Return Values Notes ht_impl_stop_acc() ht_impl_error_t ht_impl_stop_acc(void) Function Name Function Description Stops accelerometer sensor, and the respective data indication process driven by the active data flow instances, as well.
UM-B-085 DA14681 Wearable Development Kit API ht_impl_error_t ht_impl_config_acc(ht_impl_inertial_handle_t* handle, Function Name ht_impl_acc_config_t* config, uint8_t least_ind_rate) Function Description Configures accelerometer sensor data flow instance, i.e. enable/disable data indication, and set the required operation mode, the data range, the operation data rate and the indication data rate of accelerometer sensor for the particular instance.
UM-B-085 DA14681 Wearable Development Kit API Notes ht_impl_config_mag() ht_impl_error_t ht_impl_config_mag(ht_impl_inertial_handle_t* handle, Function Name ht_impl_mag_config_t* config, uint8_t least_ind_rate) Function Description Configures magneometer sensor data flow instance, i.e. enable/disable data indication, and set the required operation mode, the operation data rate and the indication data rate of magnetometer sensor for the particular instance.
UM-B-085 DA14681 Wearable Development Kit API ht_impl_state_get_acc() ht_impl_error_t ht_impl_state_get_acc(ht_impl_acc_t* state) Function Name Function Description Gets configuration status of accelerometer sensor, i.e. the accelerometer sensor configuration determined by the initialized data flow instances. state Parameters the configuration status structure of the accelerometer sensor data flow HT_IMPL_SUCCESS for successful execution;...
UM-B-085 DA14681 Wearable Development Kit API Function Description Reads gyroscope sensor data. If gyroscope sensor is enabled for the particular data flow instance, then in case indication data rate is set, last read/indicated gyroscope sensor data value is returned (through data parameter), otherwise a force-read is performed and new gyroscope sensor data is acquired and returned (through data parameter).
UM-B-085 DA14681 Wearable Development Kit API All functions and respective data structures/types being defined in the API are summarized below: Table 20: Environmental Sensors HT-Implementation API Data Structures and Types ht_impl_temp_config_t ht_impl_pres_config_t ht_impl_hum_config_t ht_impl_env_config_t ht_impl_temp_t ht_impl_pres_t ht_impl_hum_t ht_impl_data_temp_t ht_impl_data_pres_t ht_impl_data_hum_t...
UM-B-085 DA14681 Wearable Development Kit API ht_impl_pres_t Type Definition Name Description ht_impl_pres_t Configuration state structure for pressure sensor data flow: ht_impl_pres_config_t ht_impl_hum_t Type Definition Name Description ht_impl_hum_t Configuration state structure for humidity sensor data flow: ht_impl_hum_config_t ht_impl_data_temp_t Data Structure Fields...
UM-B-085 DA14681 Wearable Development Kit API Data Structure Fields Type Description pres_config. uint8_t Number of pressure sensor data samples to ind_samples_to_wait wait for, before indication. hum_config. config ht_impl_hum_config_t Humidity sensor data flow instance configuration. hum_config. ind_samples_passed uint8_t Number of humidity sensor data samples passed.
UM-B-085 DA14681 Wearable Development Kit API 8.2.3.2 Dependency Functions ht_impl_env_handle_t -> env_data_cb() ht_impl_error_t (*env_data_cb)(void* data, uint16_t size, Function Name ht_impl_data_ref_released_cb_t cb) Function Description (Optional) Callback function which is called when environmental sensor data need to be sent over a defined data flow instance of type ht_impl_env_handle_t, based on the defined env_sensor_types field.
UM-B-085 DA14681 Wearable Development Kit API HT_IMPL_SUCCESS for successful execution; ≥ HT_IMPL_FAIL for error Return Values Notes ht_impl_stop_temp() ht_impl_error_t ht_impl_stop_temp(void) Function Name Function Description Stops temperature sensor, and the respective data indication process driven by the active data flow instances, as well.
UM-B-085 DA14681 Wearable Development Kit API ht_impl_error_t ht_impl_config_env_acquisition_event(bool enable, Function Name uint32_t rate) Function Description Configures environmental sensor data (external) acquisition event source. If external source is disabled then an internal source is used. Acquisition event rate defines the base rate based on which the data indication rates of the initialized data flow instances are determined.
UM-B-085 DA14681 Wearable Development Kit API Function Description Configures pressure sensor data flow instance, i.e. enable/disable data indication, and set the required operation mode and the indication data rate of pressure sensor for the particular instance. The configuration for the rest of the environmental sensors required by the particular instance remains the same.
UM-B-085 DA14681 Wearable Development Kit API Function Description Configures environmental sensors data flow instance, i.e. enable/disable data indication, and set the required operation mode and the indication data rate of environmental sensors for the particular instance. Furthermore, sets the least indication data rate required for the particular data flow instance, which in case it is slower than the configured environmental sensor indication rate, an internal intermediate storage (i.e.
UM-B-085 DA14681 Wearable Development Kit API ht_impl_data_read_temp() ht_impl_error_t ht_impl_data_read_temp(ht_impl_env_handle_t* handle, Function Name ht_impl_data_temp_t* data) Function Description Reads temperature sensor data. If temperature sensor is enabled for the particular data flow instance, then in case indication data rate is set, last read/indicated...
UM-B-085 DA14681 Wearable Development Kit API Notes ht_impl_data_pushing_env_event() ht_impl_error_t ht_impl_data_pushing_env_event( Function Name HT_IMPL_ENV_MULT_DATA_T* data, uint16_t size) Function Description Pushes environmental sensor data to Health Toolbox implementation of environmental sensor data flows. If the internal storage (i.e. FIFO) is full or reaches...
UM-B-085 DA14681 Wearable Development Kit API Data Structure Fields Type Description ind_rate uint8_t Health care accelerometer sensor indication data rate: HT_IMPL_HC_ACC_RATE_INVALID, HT_IMPL_HC_ACC_RATE_0_78HZ, HT_IMPL_HC_ACC_RATE_1_56HZ, HT_IMPL_HC_ACC_RATE_3_12HZ, HT_IMPL_HC_ACC_RATE_6_25HZ, HT_IMPL_HC_ACC_RATE_12_5HZ, HT_IMPL_HC_ACC_RATE_25HZ, HT_IMPL_HC_ACC_RATE_50HZ, HT_IMPL_HC_ACC_RATE_100HZ op_rate uint8_t Health care accelerometer sensor operation data rate: HT_IMPL_HC_ACC_RATE_INVALID, HT_IMPL_HC_ACC_RATE_0_78HZ,...
UM-B-085 DA14681 Wearable Development Kit API ht_impl_data_hc_acc_t Data Structure Fields Type Description xyz.x int16_t Health care accelerometer x-axis sensor data value. xyz.y int16_t Health care accelerometer y-axis sensor data value. xyz.z int16_t Health care accelerometer z-axis sensor data value. calibr_state. uncalibr_data_valid uint8_t:1 Pre-calibrated data valid flag.
UM-B-085 DA14681 Wearable Development Kit API Data Structure Fields Type Description hc_opt_config. uint8_t Number of health care optical sensor data ind_samples_to_wait samples to wait for, before indication. hc_acc_config. config ht_impl_hc_acc_config Health care accelerometer sensor data flow instance configuration. hc_acc_config. uint8_t...
UM-B-085 DA14681 Wearable Development Kit API 8.2.4.2 Dependency Functions ht_impl_hc_handle_t -> hc_data_cb() ht_impl_error_t (*hc_data_cb)(void* data, uint16_t size, Function Name ht_impl_data_ref_released_cb_t cb) Function Description (Optional) Callback function which is called when health care sensor data need to be sent over a defined data flow instance of type ht_impl_hc_handle_t, based on the defined hc_sensor_types field.
UM-B-085 DA14681 Wearable Development Kit API HT_IMPL_SUCCESS for successful execution; ≥ HT_IMPL_FAIL for error Return Values Notes ht_impl_stop_hc_opt() ht_impl_error_t ht_impl_stop_hc_opt(void) Function Name Function Description Stops health care optical sensor, and the respective data indication process driven by the active data flow instances, as well.
UM-B-085 DA14681 Wearable Development Kit API Notes ht_impl_config_hc_opt() ht_impl_error_t ht_impl_config_hc_opt(ht_impl_hc_handle_t* handle, Function Name ht_impl_hc_opt_config_t* config, uint8_t least_ind_rate) Function Description Configures health care optical sensor data flow instance, i.e. enable/disable data indication, and set the required operation mode and the indication data rate of optical sensor for the particular instance.
UM-B-085 DA14681 Wearable Development Kit API handle Parameters the handle structure of the data flow instance config the health care accelerometer sensor configuration structure of the data flow instance least_ind_rate least indication data rate of health care sensors HT_IMPL_HC_IND_RATE_INVALID, HT_IMPL_HC_IND_RATE_0_78HZ,...
UM-B-085 DA14681 Wearable Development Kit API Function Description Gets configuration status of health care accelerometer sensor, i.e. the health care accelerometer sensor configuration determined by the initialized data flow instances. state Parameters the configuration status structure of the health care accelerometer sensor data flow HT_IMPL_SUCCESS for successful execution;...
UM-B-085 DA14681 Wearable Development Kit API ht_impl_error_t ht_impl_data_pushing_hc_event( Function Name HT_IMPL_HC_MULT_DATA_T* data, uint16_t size) Function Description Pushes health care sensor data to Health Toolbox implementation of health care sensor data flows. If the internal storage (i.e. FIFO) is full or reaches the (watermark)
UM-B-085 DA14681 Wearable Development Kit API 8.2.5.1 Data Structures and Types ht_impl_sf_config_t Data Structure Fields Type Description enable bool Enable/disable sensor fusion service data flow: HT_IMPL_DISABLE, HT_IMPL_ENABLE ht_impl_sf_t Type Definition Name Description ht_impl_sf_t Configuration state structure for sensor fusion service data flow:...
UM-B-085 DA14681 Wearable Development Kit API Data Structure Fields Type Description gyr_rate uint8_t Gyroscope sensor data rate: HT_IMPL_GYR_RATE_INVALID, HT_IMPL_GYR_RATE_25HZ, HT_IMPL_GYR_RATE_50HZ, HT_IMPL_GYR_RATE_100HZ mag_rate uint8_t Magnetometer sensor data rate: HT_IMPL_MAG_RATE_INVALID, HT_IMPL_MAG_RATE_0_78HZ, HT_IMPL_MAG_RATE_1_56HZ, HT_IMPL_MAG_RATE_3_12HZ, HT_IMPL_MAG_RATE_6_25HZ, HT_IMPL_MAG_RATE_12_5HZ, HT_IMPL_MAG_RATE_25HZ, HT_IMPL_MAG_RATE_50HZ, HT_IMPL_MAG_RATE_100HZ beta_a uint16_t Control value for relative weight of accelerometer sensor data.
UM-B-085 DA14681 Wearable Development Kit API 8.2.5.2 Dependency Functions ht_impl_sf_handle_t -> sf_data_cb() ht_impl_error_t (*sf_data_cb)(void* data, uint16_t size, Function Name ht_impl_data_ref_released_cb_t cb) Function Description (Optional) Callback function which is called when sensor fusion service data need to be sent over a defined data flow instance of type ht_impl_sf_handle_t.
UM-B-085 DA14681 Wearable Development Kit API ht_impl_error_t ht_impl_start_sf(void) Function Name Function Description Starts sensor fusion service based on the configured data flow instances. Parameters None HT_IMPL_SUCCESS for successful execution; ≥ HT_IMPL_FAIL for error Return Values Notes ht_impl_stop_sf() ht_impl_error_t ht_impl_stop_sf(void) Function Name...
UM-B-085 DA14681 Wearable Development Kit API Notes ht_impl_data_pushing_and_indication_sf_event() ht_impl_error_t ht_impl_data_pushing_and_indication_sf_event( Function Name ht_impl_data_sf_t* data, uint16_t size) Function Description Pushes sensor fusion service data and indicate (i.e. trigger a data-indication event) data over the initialized data flows, based on their configuration.
UM-B-085 DA14681 Wearable Development Kit API ht_impl_data_hr_t Data Structure Fields Type Description heart_rate uint8_t Heart rate (in bpm). ht_impl_hr_handle_t Data Structure Fields Type Description hr_data_cb ht_impl_data_rdy_cb_t Heart rate estimation service (rate/epoch) data ready function pointer. hri_data_cb ht_impl_data_rdy_cb_t Heart rate estimation service instant data ready function pointer.
UM-B-085 DA14681 Wearable Development Kit API 8.2.6.2 Dependency Functions ht_impl_hr_handle_t -> hr_data_cb() ht_impl_error_t (*hr_data_cb)(void* data, uint16_t size, Function Name ht_impl_data_ref_released_cb_t cb) Function Description (Optional) Callback function which is called when heart rate estimation service (rate/epoch) data need to be sent over a defined data flow instance of type ht_impl_hr_handle_t.
UM-B-085 DA14681 Wearable Development Kit API ht_impl_error_t ht_impl_clear_hr(ht_impl_hr_handle_t* handle) Function Name Function Description Clears heart rate estimation service data flow instance. The configuration of heart rate estimation service is determined by the rest of the data flow instances (if any), and it is updated accordingly.
UM-B-085 DA14681 Wearable Development Kit API ht_impl_error_t ht_impl_config_hr_acquisition_event(bool enable, Function Name uint32_t rate) Function Description Configures heart rate estimation service data (external) acquisition event source. If external source is disabled, then an internal source is used. Acquisition event rate defines the base rate based on which the data indication rates of the initialized data flow instances are determined.
UM-B-085 DA14681 Wearable Development Kit API Notes ht_impl_data_acquisition_hr_event() ht_impl_error_t ht_impl_data_acquisition_hr_event(void) Function Name Function Description Triggers heart rate estimation service data (external) acquisition event. Based on the configured indication rate of heart rate estimation service, the data of the latter are (force-)read and data indications are sent over the initialized data flow instances and based on their configuration (i.e.
UM-B-085 DA14681 Wearable Development Kit API 8.2.7.1 Data Structures and Types ht_impl_sc_config_t Data Structure Fields Type Description enable bool Enable/disable step counting service data flow: HT_IMPL_DISABLE, HT_IMPL_ENABLE ind_rate uint32_t Step counting service indication data rate: HT_IMPL_SC_RATE_0_125HZ, HT_IMPL_SC_RATE_0_25HZ, HT_IMPL_SC_RATE_0_5HZ, HT_IMPL_SC_RATE_1HZ, HT_IMPL_SC_RATE_2HZ,...
UM-B-085 DA14681 Wearable Development Kit API 8.2.7.2 Dependency Functions ht_impl_sc_handle_t -> sc_data_cb() ht_impl_error_t (*sc_data_cb)(void* data, uint16_t size, Function Name ht_impl_data_ref_released_cb_t cb) Function Description (Optional) Callback function which is called when step counting service data need to be sent over a defined data flow instance of type ht_impl_sc_handle_t.
UM-B-085 DA14681 Wearable Development Kit API op_mode Parameters the value of the step counting service operation mode HT_IMPL_SC_OPMODE_SENSITIVE, // light-weighted, small persons HT_IMPL_SC_OPMODE_REGULAR, // normal HT_IMPL_SC_OPMODE_ROBUST // reducing great amounts of false positive step detections HT_IMPL_SUCCESS for successful execution; ≥ HT_IMPL_FAIL for error...
UM-B-085 DA14681 Wearable Development Kit API Function Description Configures step counting service data flow instance, i.e. enable/disable data indication, and set the required indication data rate of step counting service for the particular instance. Furthermore, sets the least indication data rate required for the particular data flow instance, which in case it is slower than the configured step counting service indication rate, an internal intermediate storage (i.e.
UM-B-085 DA14681 Wearable Development Kit API Function Description Triggers step counting service data (external) acquisition event. Based on the configured indication rate of step counting service, the data of the latter are (force-) read and stored to the internal storage (i.e. FIFO). If the internal storage (i.e. FIFO) is...
UM-B-085 DA14681 Wearable Development Kit API Functions ht_impl_init_cc() ht_impl_clear_cc() ht_impl_set_cc_attrs() ht_impl_start_cc() ht_impl_stop_cc() ht_impl_config_cc() ht_impl_state_get_cc() ht_impl_data_read_cc() ht_impl_data_reset_cc() ht_impl_data_pushing_and_indication_cc_event() 8.2.8.1 Data Structures and Types ht_impl_cc_config_t Data Structure Fields Type Description enable bool Enable/disable calories counting service data flow: HT_IMPL_DISABLE, HT_IMPL_ENABLE ht_impl_cc_t Type Definition Name...
UM-B-085 DA14681 Wearable Development Kit API ht_impl_cc_handle_t Data Structure Fields Type Description cc_data_cb ht_impl_data_rdy_cb_t Calories counting service data ready function pointer. cct_data_cb ht_impl_data_rdy_cb_t Calories counting service total data ready function pointer. config ht_impl_cc_config_t Calories counting service data flow instance configuration.
UM-B-085 DA14681 Wearable Development Kit API 8.2.8.2 Dependency Functions ht_impl_cc_handle_t -> cc_data_cb() ht_impl_error_t (*cc_data_cb)(void* data, uint16_t size, Function Name ht_impl_data_ref_released_cb_t cb) Function Description (Optional) Callback function which is called when calories counting service data need to be sent over a defined data flow instance of type ht_impl_cc_handle_t.
UM-B-085 DA14681 Wearable Development Kit API ht_impl_error_t ht_impl_clear_cc(ht_impl_cc_handle_t* handle) Function Name Function Description Clears calories counting service data flow instance. The configuration of calories counting service is determined by the rest of the data flow instances (if any), and it is updated accordingly.
UM-B-085 DA14681 Wearable Development Kit API ht_impl_state_get_cc() ht_impl_error_t ht_impl_state_get_cc(ht_impl_cc_t* state) Function Name Function Description Gets configuration status of calories counting service, i.e. the calories counting service configuration determined by the initialized data flow instances.. state Parameters the configuration status structure of the calories counting service data flow HT_IMPL_SUCCESS for successful execution;...
UM-B-085 DA14681 Wearable Development Kit API ht_impl_sq_handle_t Data Structure Fields Type Description sq_data_cb ht_impl_data_rdy_cb_t Sleep quality monitoring service data ready function pointer. squ_data_cb ht_impl_data_rdy_cb_t Sleep quality monitoring service update data ready function pointer. sqt_data_cb ht_impl_data_rdy_cb_t Sleep quality monitoring service total data ready function pointer.
UM-B-085 DA14681 Wearable Development Kit API 8.2.9.2 Dependency Functions ht_impl_sq_handle_t -> sq_data_cb() ht_impl_error_t (*sq_data_cb)(void* data, uint16_t size, Function Name ht_impl_data_ref_released_cb_t cb) Function Description (Optional) Callback function which is called when sleep quality monitoring service data need to be sent over a defined data flow instance of type ht_impl_sq_handle_t.
UM-B-085 DA14681 Wearable Development Kit API ht_impl_error_t ht_impl_init_sq(ht_impl_sq_handle_t* handle, Function Name ht_impl_data_rdy_cb_t sq_data_cb, ht_impl_data_rdy_cb_t squ_data_cb, ht_impl_data_rdy_cb_t sqt_data_cb) Function Description Initializes sleep quality monitoring service data flow instance, by setting initial values to the internal variables and structures of the particular Health Toolbox implementation.
UM-B-085 DA14681 Wearable Development Kit API Function Description Configures sleep quality monitoring service data flow instance, i.e. enable/disable sleep quality monitoring service data indication for the particular instance. Data indications are sent via sq_data_cb(), squ_data_cb() and sqt_data_cb() callback functions, indicating per-epoch sleep quality monitoring service data, update and total ones, respectively..
UM-B-085 DA14681 Wearable Development Kit API data Parameters the sleep quality monitoring service (epoch) data being pushed size the size of data (i.e. number of data samples) being pushed HT_IMPL_SUCCESS for successful execution; ≥ HT_IMPL_FAIL for error Return Values Notes...
UM-B-085 DA14681 Wearable Development Kit API 8.3.1 Data Structures and Types tmr_error_t Type Definition Name Description tmr_error_t Execution status of a function: TMR_SUCCESS, TMR_FAIL tmr_handle_t Data Structure Fields Type Description timer OS_TIMER The OS_TIMER instance the abstraction refers to. TimerCallbackFunction_t Timer-fired event function pointer.
UM-B-085 DA14681 Wearable Development Kit API 8.3.2 Dependency Functions tmr_handle_t -> cb() void (*cb)(TimerHandle_t xTimer) Function Name (Optional) Callback function for indicatinf a “timer-fired” event. Function Description xTimer the OS timer instance which triggers the “timer-fired” Parameters event Return Values...
UM-B-085 DA14681 Wearable Development Kit API Function Description Clears Timer instance defined by the given handle, removing it from the internal Timer instance list and freeing previously allocated resources. There is a maximum wait time until command is sent. handle...
UM-B-085 DA14681 Wearable Development Kit API TMR_SUCCESS for successful execution; ≥ TMR_FAIL for error Return Values Notes tmr_restart() tmr_error_t tmr_restart(tmr_handle_t* handle) Function Name Function Description Restarts a Timer instance having been previously configured with a specific time interval. There is no wait time for the command to be sent.
UM-B-085 DA14681 Wearable Development Kit API tmr_getNow() uint32_t tmr_getNow(void) Function Name Function Description Get current time in OS ticks. Parameters None Return Values The current time in OS ticks Notes Sensor Control Component The API provided by Sensor Control component includes functions for initializing, controlling and configuring the supported/integrated sensors in terms of their operation and data acquisition.
UM-B-085 DA14681 Wearable Development Kit API sc_gyr_data_t Data Structure Fields Type Description xyz.x int16_t Gyroscope x-axis sensor data value. xyz.y int16_t Gyroscope y-axis sensor data value. xyz.z int16_t Gyroscope z-axis sensor data value. sc_mag_data_t Data Structure Fields Type Description xyz.x int16_t Magnetometer x-axis sensor data value.
UM-B-085 DA14681 Wearable Development Kit API Data Structure Fields Type Description uint16_t Optical sensor ir-light-intensity data. valid_data Bool Optical sensor data validity indication. sc_calibr_offsets_t Data Structure Fields Type Description offset_x int16_t x-axis sensor data offset value. offset_y int16_t y-axis sensor data offset value.
UM-B-085 DA14681 Wearable Development Kit API Data Structure Fields Type Description sc_calibr_mag_coeffs_rdy_cb Function pointer Function for handling indications of magnetometer sensor calibration coefficients change. sc_intr_1_recatch Function pointer Function for handling indications for still pending (i.e. produced during handling of a previous interrupt) INT1 interrupt.
UM-B-085 DA14681 Wearable Development Kit API 8.4.2 Dependency Functions sc_handle_t -> sc_atomic_begin() void (*sc_atomic_begin)(void) Function Name Function Description (Optional) Begins an atomic section in Sensor Control. Parameters None Return Values None Must be used in combination with sc_atomic_end() Notes sc_handle_t -> sc_atomic_end()
UM-B-085 DA14681 Wearable Development Kit API Return Values None Notes sc_handle_t -> sc_calibr_mag_coeffs_rdy_cb() void (*sc_calibr_mag_coeffs_rdy_cb)(uint8_t mode, Function Name sc_calibr_coeffs_t* coeffs) Function Description Handles indications of magnetometer sensor calibration coefficients change. mode Parameters the new calibration mode control the new calibration coefficients...
UM-B-085 DA14681 Wearable Development Kit API sc_mag_cal_init() sc_error_t sc_mag_cal_init(uint8_t mode) Function Name Function Description Initializes magnetometer sensor calibration with a specific calibration mode, applying the corresponding coefficients, offsets and control wherever appropriate. mode Parameters the magnetometer calibration mode SC_MAG_CAL_MODE_NONE, SC_MAG_CAL_MODE_STATIC,...
UM-B-085 DA14681 Wearable Development Kit API sc_mag_cal_get_control() sc_error_t sc_mag_cal_get_control(uint8_t mode, Function Name sc_calibr_control_t* control) Function Description Gets magnetometer sensor calibration control for a specific calibration mode. mode Parameters the magnetometer calibration mode SC_MAG_CAL_MODE_NONE, SC_MAG_CAL_MODE_STATIC, SC_MAG_CAL_MODE_ONE_SHOT_AUTO_BASIC, SC_MAG_CAL_MODE_CONT_AUTO_BASIC, SC_MAG_CAL_MODE_ONE_SHOT_AUTO_SMART, SC_MAG_CAL_MODE_CONT_AUTO_SMART control the address to store calibration control structure for the magnetometer sensor SC_SUCCESS for successful execution;...
UM-B-085 DA14681 Wearable Development Kit API sc_acc_config() sc_error_t sc_acc_config(sc_acc_config_t* config, uint8_t least_ind_rate) Function Name Function Description Sets the operation mode and configuration of accelerometer sensor, by setting its power state mode, interrupt-based sensor data indication, and indication data rate, operation data rate and range. NORMAL and LP1 to LP6, refer to decreasing power consumption levels.
UM-B-085 DA14681 Wearable Development Kit API sc_acc_gyr_mag_config() sc_error_t sc_acc_gyr_mag_config(sc_acc_gyr_mag_config_t* config, Function Name uint8_t least_ind_rate) Function Description Sets the operation mode and configuration of accelerometer, gyroscope and magnetometer sensors, by setting their power state mode, interrupt-based sensor data indication, and indication data rates, operation data rates and ranges (if any).
UM-B-085 DA14681 Wearable Development Kit API Function Description Sets the operation mode and configuration of step sensor (pedometer). Operation mode refers to the sensitivity on counting steps. config Parameters the configuration structure of the step sensor (pedometer) SC_SUCCESS for successful execution; ≥ SC_FAIL for error...
UM-B-085 DA14681 Wearable Development Kit API SC_SUCCESS for successful execution; ≥ SC_FAIL for error Return Values Notes sc_sensors_disable_intrs() sc_error_t sc_sensors_disable_intrs(void) Function Name Function Description Disables any involved interrupt-based or -related operation in Sensor Control implementation. Parameters None SC_SUCCESS for successful execution; ≥ SC_FAIL for error...
UM-B-085 DA14681 Wearable Development Kit API Function Description Reads temperature sensor data. temp_data Parameters the address to store temperature sensor data being read SC_SUCCESS for successful execution; ≥ SC_FAIL for error Return Values Notes sc_pres_read() sc_error_t sc_pres_read(sc_pres_data_t* pres_data) Function Name Function Description Reads pressure sensor data.
UM-B-085 DA14681 Wearable Development Kit API sc_acc_scnd_read() sc_error_t sc_acc_scnd_read(sc_acc_data_t* acc_data) Function Name Function Description Reads secondary accelerometer sensor data, along with accelerometer sensor calibration status. acc_data Parameters the address to store accelerometer sensor data being read SC_SUCCESS for successful execution; ≥ SC_FAIL for error...
UM-B-085 DA14681 Wearable Development Kit API Health Care Services Task The API provided by the Health Care Services Task includes functions for initializing and controlling its operation, configuring the supported/integrated services and the ‘input data pushing’ mechanism, and finally acquiring the services' configuration state and data. All these functions and respective data structures/types being defined in the API are summarized below.
UM-B-085 DA14681 Wearable Development Kit API Data-Push Functions hc_svcs_data_push_acc_gyr_mag() hc_svcs_data_push_acc_gyr_mag_no_copy() hc_svcs_data_push_opt_acc() hc_svcs_data_push_opt_acc_no_copy() hc_svcs_data_push_step_pres() hc_svcs_data_push_step_pres_no_copy() 8.5.1 Data Structures and Types hc_svcs_error_t Type Definition Name Description hc_svcs_error_t Execution status of Health Care Services functions: HC_SVCS_SUCCESS, HC_SVCS_FAIL hc_svcs_upf_config_t Data Structure Fields Type Description...
UM-B-085 DA14681 Wearable Development Kit API hc_svcs_sf_t Type Definition Name Description hc_svcs_sf_t Configuration state structure for sensor fusion service: hc_svcs_sf_config_t hc_svcs_hr_t Type Definition Name Description hc_svcs_hr_t Configuration state structure for heart rate estimation service: hc_svcs_hr_config_t hc_svcs_sq_t Type Definition Name Description...
UM-B-085 DA14681 Wearable Development Kit API Data Structure Fields Type Description hc_svcs_get_rtc_notifs_config Function pointer Function for acquiring RTC availability and interval. hc_svcs_dpsh_src_config Function pointer Function for requesting new configuration for the source of the pushed (input) data. hc_svcs_data_sf_t Data Structure Fields...
UM-B-085 DA14681 Wearable Development Kit API Data Structure Fields Type Description int16_t Accelerometer y-axis data value. int16_t Accelerometer z-axis data value. calibr_state. reserved0 uint8_t:1 Reserved. calibr_state. calibr_data_valid uint8_t:1 Post-calibrated data valid flag. calibr_state. reserved2 uint8_t:6 Reserved. hc_svcs_data_gyr_t Data Structure Fields...
UM-B-085 DA14681 Wearable Development Kit API 8.5.2 Dependency Functions hc_svcs_handle_t -> hc_svcs_clear_done() void (*hc_svcs_clear_done)(hc_svcs_error_t error) Function Name Function Description (Optional) Handles indication that Health Care Services Task has been cleared. the execution status of ‘clear’ operation error Parameters HC_SVCS_SUCCESS, ≥ HC_SVCS_FAIL...
UM-B-085 DA14681 Wearable Development Kit API type Parameters the attributes or service type HC_SVCS_STATE_UPF, HC_SVCS_STATE_SF, HC_SVCS_STATE_HR, HC_SVCS_STATE_SQ, HC_SVCS_STATE_CC state the configuration state of the attributes or the service the execution status of ‘state-get’ operation error HC_SVCS_SUCCESS, ≥ HC_SVCS_FAIL Return Values...
UM-B-085 DA14681 Wearable Development Kit API Return Values None Notes hc_svcs_handle_t -> hc_svcs_error() void (*hc_svcs_error)(uint8_t type, ht_error_t error) Function Name Function Description (Optional) Handles indication that an error in Health Care Services component has been produced. type Parameters the error type...
UM-B-085 DA14681 Wearable Development Kit API Function Description Initializes Health Care Services component, setting initial values to the internal variables and structures, creating a FreeRTOS task for control coordination and data manipulation, and initializing services and other processes being supported. Callback function may be set to the hc_svcs_handle_t instance handle, so that control and data indications can be sent.
UM-B-085 DA14681 Wearable Development Kit API hc_svcs_error_t hc_svcs_rtc_send_notif(void) Function Name Function Description Sends RTC tick notification to Health Care Services component. If RTC interval is not appropriate for Health Care Services operation, RTC tick notification is ignored. Parameters None HC_SVCS_SUCCESS for successful execution; ≥ HC_SVCS_FAIL for error...
UM-B-085 DA14681 Wearable Development Kit API Function Description Configures sleep quality monitoring service. If the respective function pointers are defined in hc_svcs_handle_t instance handle, a config-done indication is sent via hc_svcs_config_done() callback function, setting parameter type to HC_SVCS_CONFIG_SQ, while data indications via hc_svcs_data_indication() are sent based on the configured data rate, setting parameter type to HC_SVCS_SERVICE_TYPE_SQ.
UM-B-085 DA14681 Wearable Development Kit API Parameters None HC_SVCS_SUCCESS for successful execution; ≥ HC_SVCS_FAIL for error Return Values Notes hc_svcs_state_get_hr() hc_svcs_error_t hc_svcs_state_get_hr(void) Function Name Function Description Gets configuration status of heart rate estimation service. If the respective function pointer is defined in hc_svcs_handle_t instance handle, a state-get-done indication is sent via hc_svcs_state_get_done() callback function, carrying the configuration status structure and setting parameter type to HC_SVCS_STATE_HR.
UM-B-085 DA14681 Wearable Development Kit API hc_svcs_data_read_hr() hc_svcs_error_t hc_svcs_data_read_hr(void) Function Name Function Description Reads last heart rate estimation data. If heart rate estimation service is enabled and the respective function pointer is defined in hc_svcs_handle_t instance handle, a data-read-done indication is sent via hc_svcs_data_read_done() callback function, carrying last heart rate estimation data and setting parameter type to HC_SVCS_SERVICE_TYPE_HR.
UM-B-085 DA14681 Wearable Development Kit API hc_svcs_data_push_acc_gyr_mag_no_copy() hc_svcs_error_t hc_svcs_data_push_acc_gyr_mag_no_copy( Function Name hc_svcs_data_acc_gyr_mag_t* data, uint16_t size, hc_svcs_data_ref_released_cb_t cb) Function Description Pushes multiple combined accelerometer, gyroscope and magnetometer sensor data with zero copy. The provided callback function is called upon the release of the data reference by Health Care Services component.
UM-B-085 DA14681 Wearable Development Kit API hc_svcs_error_t hc_svcs_data_push_step_pres( Function Name hc_svcs_data_step_pres_t* data, uint16_t size) Function Description Pushes multiple combined step and pressure sensor data. Data are copied internally. If the respective function pointer is defined in hc_svcs_handle_t instance handle, a data-push-done indication is sent via hc_svcs_data_push_done() callback function, setting parameter type to HC_SVCS_DATA_PUSH_STEP_PRES.
UM-B-085 DA14681 Wearable Development Kit API KIWI Services Task The KIWI Services Task follows the Health Care Services Task code structure and operation paradigm for the integration in the Wearable DK system of the following services, which are supported by the KIWI basic activity state tracking library: ●...
UM-B-085 DA14681 Wearable Development Kit API kiwi_svcs_sq_t Type Definition Name Description kiwi_svcs_sq_t Configuration state structure for sleep quality monitoring service: kiwi_svcs_sq_config_t kiwi_svcs_cc_t Type Definition Name Description kiwi_svcs_cc_t Configuration state structure for calories counting service: kiwi_svcs_cc_config_t kiwi_svcs_bs_t Type Definition Name Description...
UM-B-085 DA14681 Wearable Development Kit API kiwi_svcs_data_sc_t Data Structure Fields Type Description steps int32_t Steps counted. epoch_index uint32_t First epoch number step counting data refer to. kiwi_svcs_data_sq_t Data Structure Fields Type Description invalid int32_t Number of consecutive epochs classified as INVALID.
UM-B-085 DA14681 Wearable Development Kit API Data Structure Fields Type Description int16_t Gyroscope y-axis data value. int16_t Gyroscope z-axis data value. kiwi_svcs_data_mag_t Data Structure Fields Type Description int16_t Magnetometer x-axis data value. int16_t Magnetometer y-axis data value. int16_t Magnetometer z-axis data value.
UM-B-085 DA14681 Wearable Development Kit API 8.6.2 Dependency Functions kiwi_svcs_handle_t -> kiwi_svcs_clear_done() void (*kiwi_svcs_clear_done)(kiwi_svcs_error_t error) Function Name Function Description (Optional) Handles indication that KIWI Services Task has been cleared. the execution status of ‘clear’ operation error Parameters KIWI_SVCS_SUCCESS, ≥ KIWI_SVCS_FAIL...
UM-B-085 DA14681 Wearable Development Kit API type Parameters the attributes or service type KIWI_SVCS_STATE_COMMON, KIWI_SVCS_STATE_UPF, KIWI_SVCS_STATE_SC , KIWI_SVCS_STATE_SQ, KIWI_SVCS_STATE_CC , KIWI_SVCS_STATE_BS state the configuration state of the attributes or the service the execution status of ‘state-get’ operation error KIWI_SVCS_SUCCESS, ≥ KIWI_SVCS_FAIL...
UM-B-085 DA14681 Wearable Development Kit API Notes kiwi_svcs_handle_t -> kiwi_svcs_data_push_done() void (*kiwi_svcs_data_push_done)(uint8_t type, kiwi_svcs_error_t error) Function Name Function Description (Optional) Handles indication that the last input data have been pushed to KIWI Services component. type Parameters the input data type...
UM-B-085 DA14681 Wearable Development Kit API None Return Values Notes 8.6.3 Initialization and Control Functions kiwi_svcs_init() kiwi_svcs_error_t kiwi_svcs_init(kiwi_svcs_handle_t* handle) Function Name Function Description Initializes KIWI Services, setting initial values to the internal variables and structures, creating a FreeRTOS task for control coordination and data manipulation, and initializing services and other processes being supported.
UM-B-085 DA14681 Wearable Development Kit API Function Description Stops KIWI Services, disabling all services being supported. If the respective function pointer is defined in kiwi_svcs_handle_t instance handle, a stop-done indication is sent via kiwi_svcs_stop_done() callback function. Parameters None KIWI_SVCS_SUCCESS for successful execution; ≥ KIWI_SVCS_FAIL for error...
UM-B-085 DA14681 Wearable Development Kit API config Parameters the configuration structure of step counting service KIWI_SVCS_SUCCESS for successful execution; ≥ KIWI_SVCS_FAIL for error Return Values Notes kiwi_svcs_config_sq() kiwi_svcs_error_t kiwi_svcs_config_sq(kiwi_svcs_sq_config_t* config) Function Name Function Description Configures sleep quality monitoring service. If the respective function pointers are...
UM-B-085 DA14681 Wearable Development Kit API true if running; false if not running Return Values Notes kiwi_svcs_state_get_common() kiwi_svcs_error_t kiwi_svcs_state_get_common(void) Function Name Function Description Gets configuration status of supported services common attributes. If the respective function pointer is defined in kiwi_svcs_handle_t instance handle, a state-get-done indication is sent via kiwi_svcs_state_get_done() callback function, carrying the configuration status structure and setting parameter type to KIWI_SVCS_STATE_COMMON.
UM-B-085 DA14681 Wearable Development Kit API Function Description Gets configuration status of calories counting service. If the respective function pointer is defined in kiwi_svcs_handle_t instance handle, a state-get-done indication is sent via kiwi_svcs_state_get_done() callback function, carrying the configuration status structure and setting parameter type to KIWI_SVCS_STATE_CC.
UM-B-085 DA14681 Wearable Development Kit API Function Description Reads last calories counting data. If calories counting service is enabled and the respective function pointer is defined in kiwi_svcs_handle_t instance handle, a data- read-done indication is sent via kiwi_svcs_data_read_done() callback function, carrying last calories counting data and setting parameter type to KIWI_SVCS_SERVICE_TYPE_CC.
UM-B-085 DA14681 Wearable Development Kit API kiwi_svcs_error_t kiwi_svcs_data_push_acc_gyr_mag_no_copy( Function Name kiwi_svcs_data_acc_gyr_mag_t* data, uint16_t size, kiwi_svcs_data_ref_released_cb_t cb) Function Description Pushes multiple combined accelerometer, gyroscope and magnetometer sensor data with zero copy. The provided callback function is called upon the release of the data reference by Kiwi Services component.
SPO2 (i.e. Oximeter), based on IR LED light intensity data that can also be produced by DI5115's optical sensor. A more detailed description of the library can be found in the user manual of the DA14681 wearable development kit [1]. The API provided by the Heart Rate Estimation Library includes functions for initializing, executing and configuring the heart rate estimation process.
UM-B-085 DA14681 Wearable Development Kit API 9.1.1 Initialization Functions HealthCare_Init() void HealthCare_Init(void) Function Name Function Description Initializes HealthCare algorithm and its data. Parameters None Return Values None Notes 9.1.2 Main Process Functions HealthCare_Run() void HealthCare_Run(unsigned short* data, short* accele_data, Function Name...
A more detailed description of the library can be found in the user manual of the DA14681 wearable development kit [1]. The API provided by the Sleep Quality Monitoring Library includes functions for initializing or clearing...
UM-B-085 DA14681 Wearable Development Kit API Data Structure Fields Type Description wake_onset_act_time_per_epoch uint8_t Total activity duration (in sec) per epoch, so that sleep/awake classification can be deactivated and ‘AWAKE’ state is considered. not_attached_onset_time uint8_t Time (in min) to pass with no activity, so that ‘NOT ATTACHED’...
UM-B-085 DA14681 Wearable Development Kit API sq_data_sleep_state_update_t Data Structure Fields Type Description state uint8_t Sleep state value to update epochs with: SQ_SLEEP_STATE_INVALID, SQ_SLEEP_STATE_AWAKE, SQ_SLEEP_STATE_LIGHT_SLEEP, SQ_SLEEP_STATE_DEEP_SLEEP, SQ_SLEEP_STATE_REM, SQ_SLEEP_STATE_ERROR length uint8_t The number of consecutive epochs to be updated. epoch_index uint32_t The epoch number of the first epoch being updated.
UM-B-085 DA14681 Wearable Development Kit API sq_handle_t -> sq_epoch_updated() sq_epoch_t (*sq_epoch_updated)(sq_data_sleep_state_update_t* update) Function Name Function Description (Optional) Handles indication that several successive epochs are to be updated in terms of the classified sleep state from a specific epoch number in tha past and then.
UM-B-085 DA14681 Wearable Development Kit API 9.2.4 Main Process Functions sq_data_update_acc() sq_error_t sq_data_update_acc(sq_data_acc_t* data, uint16_t size) Function Name Function Description Provides new accelerometer data samples to Sleep Quality Monitoring, based on the data rate with which the latter has been previously configured. Accelerometer data must be converted to (+2g,-2g) range over 16-bit resolution (i.e.
(based on atmospheric pressure data). A more detailed description of the library can be found in the user manual of the DA14681 wearable development kit [1]. The API provided by the Calories Counting Library includes functions for initializing or clearing the...
UM-B-085 DA14681 Wearable Development Kit API Command Functions cc_data_reset_calories() State Functions cc_state_get_calories_epochs_num() 9.3.1 Data Structures and Types cc_error_t Type Definition Name Description cc_error_t Execution status of a function: CC_SUCCESS, CC_FAIL cc_upf_config_t Data Structure Fields Type Description gender uint8_t User's gender type (m/f):...
UM-B-085 DA14681 Wearable Development Kit API cc_handle_t Data Structure Fields Type Description cc_get_buffer Function pointer Function for memory space allocation. cc_free_buffer Function pointer Function for memory space deallocation. cc_calories_drdy Function pointer Function for epoch change indication (calories data ready). cc_data_step_t...
UM-B-085 DA14681 Wearable Development Kit API 9.3.2 Dependency Functions cc_handle_t -> cc_get_buffer() cc_error_t (*cc_get_buffer)(uint8_t** buf, uint16_t size) Function Name Function Description Implements memory space allocation for variables and structures used internally in Calories Counting Library. Parameters the address of the pointer variable to put the address of the...
UM-B-085 DA14681 Wearable Development Kit API 9.3.3 Initialization and Basic Configuration Functions cc_init() cc_error_t cc_init(cc_handle_t* handle, cc_config_t* config) Function Name Function Description Initializes Calories Counting with the appropriate configuration in terms of user profile data (i.e. gender, age, height and weight), step and pressure sensor input data rate and epoch interval of calories estimation.
UM-B-085 DA14681 Wearable Development Kit API CC_SUCCESS for successful execution; ≥ CC_FAIL for error Return Values Notes 9.3.5 Service Data Acquisition Functions cc_data_read_calories() cc_error_t cc_data_read_calories(cc_data_calories_t* data) Function Name Function Description Reads the total calories (and distance) counter since Calories Counting initialization (i.e.
(M0, M3 and M4 chipsets), mobile and cloud-based environments. A more detailed description of the library can be found in the user manual of the DA14681 wearable development kit [1]. kiwi_init()
UM-B-085 DA14681 Wearable Development Kit API kiwi_main() int kiwi_main(float rawAccelX, float rawAccelY, float rawAccelZ, Function Name int isRightWrist) Function Description This function is the main loop for the kiwi classification library. One accelerometer sample (x, y, z) is passed and stored internally. As new data samples are passed in, data is stored internally and features are computed iteratively as well as in a batch once the internal buffer is filled.
UM-B-085 DA14681 Wearable Development Kit API kiwi_reset_step_count() int kiwi_reset_step_count(void) Function Name Function Description Resets the number of steps counted. Parameters None Return Values None Notes kiwi_set_bodytype_vars() void kiwi_set_bodytype_vars(uint16_t gender, uint16_t age, Function Name uint16_t height, uint16_t weight) Function Description Configures KIWI basic activity state tracking with the anthropometric variables defining a user profile (i.e.
(BMI160, BMM150, BME280 and DI5115) and the rest of the peripheral devices (SX9300, AB08X5, LS012B7DH03 and FXL6408) controlled by the DA14681, which are used to implement the upper layers of application functionality. The driver architecture provided in the...
UM-B-085 DA14681 Wearable Development Kit API 10.1.1 BMI160 Sensor Driver The BMI160 sensor driver API provides functions for the configuration, control and sensor data acquisition from the accelerometer and gyroscope sensors integrated in the corresponding modules, as well as from the magnetometer sensor integrated in the BMM150 sensor module, which in turn is controlled by the BMI160, as shown in [9].
UM-B-085 DA14681 Wearable Development Kit API 10.1.1.1 Data Structures and Types bmi160_t Data Structure Fields Type Description chip_id uint8_t Chip ID of the BMI160 sensor module. dev_addr uint8_t Device address of the BMI160 sensor module. bus_write Function pointer Function for SPI/I2C bus write-access.
UM-B-085 DA14681 Wearable Development Kit API bmi160_t -> bus_read() int8_t (*bus_read)(uint8_t dev_addr, uint8_t reg_addr, Function Name uint8_t* reg_data, uint8_t cnt) Function Description Implements read-access over the SPI / I2C bus for reading data from BMI160 sensor module registers. dev_addr Parameters...
UM-B-085 DA14681 Wearable Development Kit API bmi160_set_sensor_state() int8_t bmi160_set_sensor_state(uint8_t state) Function Name Function Description (INIT-CONFIG) Sets the state of a sensor integrated in BMI160 sensor module. state Parameters the state to set for a sensor ACC_SUSPEND , ACC_NORMAL , ACC_LOWPOWER,...
UM-B-085 DA14681 Wearable Development Kit API bmi160_read_mag_r() int8_t bmi160_read_mag_xyz(uint16_t *v_mag_r_u16) Function Name Function Description (SAMPLE) Reads magnetometer RHALL (r) data. v_mag_r_u16 Parameters the magnetometer RHALL (r) data 0 for successful execution; ≠0 for error Return Values Notes bmi160_compensate_bmm150_mag_[x/y/z]() int16_t bmi160_compensate_bmm150_mag_x(int16_t v_mag_x_s16,...
UM-B-085 DA14681 Wearable Development Kit API bmi160_read_step_counter() int8_t bmi160_read_step_counter(int16_t *v_step_cnt_s16) Function Name Function Description (SAMPLE) Reads the number of detected steps. v_step_cnt_s16 Parameters the step counter data 0 for successful execution; ≠0 for error Return Values Notes 10.1.1.5 Command Functions...
UM-B-085 DA14681 Wearable Development Kit API 10.1.1.6 State Functions bmi160_get_chip_id() int8_t bmi160_get_chip_id(uint8_t* v_chip_id_u8) Function Name Function Description (STATE) Reads the chip id of the BMI160 sensor module. v_chip_id_u8 Parameters the chip id 0 for successful execution; ≠0 for error Return Values...
UM-B-085 DA14681 Wearable Development Kit API bmi160_get_drdy_gyro_stat() int8_t bmi160_get_drdy_gyro_stat(uint8_t* v_data_rdy_u8) Function Name Function Description (STATE) Reads the status of data ready (drdy) status bit, indicating whether a new gyroscope sample value has been set to the corresponding data register. v_data_rdy_u8...
UM-B-085 DA14681 Wearable Development Kit API bmi160_get_pmu_trigger_stat() int8_t bmi160_get_pmu_trigger_stat(uint8_t* v_pmu_trigger_intr_u8) Function Name Function Description (STATE) Reads the status of the power mode (pmu) trigger interrupt status bit, indicating the transition of the gyroscope to a different power mode. v_pmu_trigger_intr_u8 Parameters the value of the pmu-trigger interrupt status bit 0 for successful execution;...
UM-B-085 DA14681 Wearable Development Kit API bmi160_get_fifo_watermark_stat() int8_t bmi160_get_fifo_watermark_stat(uint8_t* v_fifo_wm_intr_u8) Function Name Function Description (STATE) Reads the status of the FIFO watermark (wm) interrupt status bit, indicating whether data in FIFO have reached a specific level, which is set using bmi160_set_fifo_watermark_level() function.
UM-B-085 DA14681 Wearable Development Kit API bmi160_[set/get]_accel_bandwidth() int8_t bmi160_set_accel_bandwidth(uint8_t v_bw_u8) Function Name int8_t bmi160_get_accel_bandwidth(uint8_t* v_bw_u8) Function Description (CONFIG) Sets/gets the accelerometer bandwidth, that is, either the Over-Sampling Rate (OSR) using the integrated accelerometer digital filter (acc_us under-sampling parameter is disabled) or the under-sampling rate/AVeraGing (AVG) (acc_us under- sampling parameter is enabled).
UM-B-085 DA14681 Wearable Development Kit API bmi160_[set/get]_gyro_out_data_rate() int8_t bmi160_set_gyro_out_data_rate( Function Name uint8_t v_output_data_rate_u8) int8_t bmi160_get_gyro_out_data_rate( uint8_t* v_output_data_rate_u8) Function Description (CONFIG) Sets/gets the gyroscope Output Data Rate (ODR), that is, the sampling data rate. v_output_data_rate_u8 the value of the gyroscope output data rate...
UM-B-085 DA14681 Wearable Development Kit API bmi160_[set/get]_mag_out_data_rate() int8_t bmi160_set_mag_out_data_rate(uint8_t v_output_data_rate_u8) Function Name int8_t bmi160_get_mag_out_data_rate(uint8_t* v_output_data_rate_u8) Function Description (CONFIG) Sets/gets the magnetometer output-poll data rate (odr), that is, the sampling data rate of the magnetometer xyz-axis data values through the respective interface.
UM-B-085 DA14681 Wearable Development Kit API bmi160_[set/get]_fifo_accel_downsampling_enable() int8_t bmi160_set_fifo_accel_downsampling_enable( Function Name uint8_t v_fifo_down_u8) int8_t bmi160_get_fifo_accel_downsampling_enable( uint8_t* v_fifo_down_u8) Function Description (CONFIG) Sets/gets the accelerometer down-sampling rate for the data stored to the FIFO (acc_fifo_downs_rate), that is, the rate of samples that are dropped.
UM-B-085 DA14681 Wearable Development Kit API bmi160_[set/get]_fifo_time_enable() int8_t bmi160_set_fifo_time_enable(uint8_t v_fifo_time_enable_u8) Function Name int8_t bmi160_get_fifo_time_enable(uint8_t* v_fifo_time_enable_u8) Function Description (CONFIG) Sets/gets the mode of setting a FIFO sensor time frame after the last valid data frame. v_fifo_time_enable_u8 Parameters the value of the FIFO sensor time setting mode BMI160_DISABLE, BMI160_ENABLE 0 for successful execution;...
UM-B-085 DA14681 Wearable Development Kit API bmi160_[set/get]_fifo_gyro_enable() int8_t bmi160_set_fifo_gyro_enable(uint8_t v_fifo_gyro_u8) Function Name int8_t bmi160_get_fifo_gyro_enable(uint8_t* v_fifo_gyro_u8) Function Description (CONFIG) Sets/gets the gyroscope FIFO data storing mode. If enabled, gyroscope xyz-axis data are stored to the FIFO. v_fifo_gyro_u8 Parameters the value of the gyroscope FIFO data storing mode BMI160_DISABLE, BMI160_ENABLE 0 for successful execution;...
UM-B-085 DA14681 Wearable Development Kit API bmi160_[set/get]_mag_write_address() int8_t bmi160_set_mag_write_address(uint8_t v_mag_write_addr_u8) Function Name int8_t bmi160_get_mag_write_address(uint8_t* v_mag_write_addr_u8) Function Description (CONFIG) Sets/gets the address to perform an indirect write of a register in the magnetometer-BMM150 register map. v_mag_write_addr_u8 Parameters the value of the magnetometer register address to write 0 for successful execution;...
UM-B-085 DA14681 Wearable Development Kit API bmi160_[set/get]_single_tap_enable() int8_t bmi160_set_single_tap_enable(uint8_t v_intr_enable_u8) Function Name int8_t bmi160_get_single_tap_enable(uint8_t* v_intr_enable_u8) Function Description (CONFIG) Sets/gets the state of the single-tap interrupt. v_intr_enable_u8 Parameters the value of the single-tap interrupt enable bit BMI160_DISABLE, BMI160_ENABLE 0 for successful execution; ≠0 for error...
UM-B-085 DA14681 Wearable Development Kit API bmi160_[set/get]_no_motion_[x/y/z]_enable() int8_t bmi160_set_no_motion_[x/y/z]_enable(uint8_t v_intr_enable_u8) Function Name int8_t bmi160_get_no_motion_[x/y/z]_enable(uint8_t* v_intr_enable_u8) Function Description (CONFIG) Sets/gets the state of the interrupt of no-motion on x/y/z-axis. v_intr_enable_u8 Parameters the value of no-motion on x/y/z-axis interrupt enable bit BMI160_DISABLE, BMI160_ENABLE 0 for successful execution;...
UM-B-085 DA14681 Wearable Development Kit API bmi160_[set/get]_intr_1_output_odrn_pshpll() int8_t bmi160_set_intr_1_output_odrn_pshpll( Function Name uint8_t v_intr_output_type_u8) int8_t bmi160_get_intr_1_output_odrn_pshpll( uint8_t* v_intr_output_type_u8) Function Description (CONFIG) Sets/gets the type, open-drain or push-pull, for interrupts mapped to pin INT1 of BMI160 sensor module. v_intr_level_u8 Parameters the value of the interrupt type for INT1 BMI160_PUSH_PULL, BMI160_OPEN_DRAIN 0 for successful execution;...
UM-B-085 DA14681 Wearable Development Kit API bmi160_[set/get]_any_motion_intr_1() int8_t bmi160_set_any_motion_intr_1(uint8_t v_intr_any_motion_u8) Function Name int8_t bmi160_get_any_motion_intr_1(uint8_t* v_intr_any_motion_u8) Function Description (CONFIG) Sets/gets the state of mapping any-motion interrupt to BMI160 sensor module pin INT1. v_intr_any_motion_u8 Parameters the value of the any-motion interrupt mapping enable bit BMI160_DISABLE, BMI160_ENABLE 0 for successful execution;...
UM-B-085 DA14681 Wearable Development Kit API bmi160_[set/get]_pmu_trigger_intr_1() int8_t bmi160_set_pmu_trigger_intr_1(uint8_t v_intr_pmu_trig_u8) Function Name int8_t bmi160_get_pmu_trigger_intr_1(uint8_t* v_intr_pmu_trig_u8) Function Description (CONFIG) Sets/gets the state of mapping pmu trigger interrupt to BMI160 sensor module pin INT1. v_intr_pmu_trig_u8 Parameters the value of the pmu-trigger interrupt mapping enable bit BMI160_DISABLE, BMI160_ENABLE 0 for successful execution;...
UM-B-085 DA14681 Wearable Development Kit API bmi160_[set/get]_any_motion_duration() int8_t bmi160_set_any_motion_duration(uint8_t v_any_motion_durn_u8) Function Name int8_t bmi160_get_any_motion_duration(uint8_t* v_any_motion_durn_u8) Function Description (CONFIG) Sets/gets the any-motion interrupt trigger delay duration. v_any_motion_durn_u8 Parameters the value of the any-motion interrupt duration 0 for successful execution; ≠0 for error...
UM-B-085 DA14681 Wearable Development Kit API bmi160_[set/get]_slow_no_motion_threshold() int8_t bmi160_set_slow_no_motion_threshold( Function Name uint8_t v_slow_no_motion_thres_u8) int8_t bmi160_get_slow_no_motion_threshold( uint8_t* v_slow_no_motion_thres_u8) Function Description (CONFIG) Sets/gets the slow/no-motion interrupt threshold. It is accelerometer range- dependent. v_slow_no_motion_thres_u8 Parameters the value of the slow/no-motion interrupt threshold 0 for successful execution; ≠0 for error...
UM-B-085 DA14681 Wearable Development Kit API bmi160_[set/get]_significant_motion_skip() int8_t bmi160_set_significant_motion_skip( Function Name uint8_t v_int_sig_mot_skip_u8) int8_t bmi160_get_significant_motion_skip( uint8_t* v_int_sig_mot_skip_u8) Function Description (CONFIG) Sets/gets the significant-motion interrupt skip time (t_skip), that is, the time that needs to pass, so that a new detection of significant motion can begin (of t_proof duration) and finally trigger the significant/any-motion interrupt.
UM-B-085 DA14681 Wearable Development Kit API bmi160_[set/get]_tap_shock_duration() int8_t bmi160_set_tap_shock_duration(uint8_t v_tap_shock_u8) Function Name int8_t bmi160_get_tap_shock_duration(uint8_t* v_tap_shock_u8) Function Description (CONFIG) Sets/gets the tap interrupt shock duration. v_tap_shock_u8 Parameters the value of the tap shock duration BMI160_TAP_SHOCK_50MS, BMI160_TAP_SHOCK_75MS 0 for successful execution; ≠0 for error...
UM-B-085 DA14681 Wearable Development Kit API bmi160_[set/get]_if_mode() int8_t bmi160_set_if_mode(uint8_t v_if_mode_u8) Function Name int8_t bmi160_get_if_mode(uint8_t* v_if_mode_u8) Function Description (CONFIG) Sets/gets the digital interface (if) configuration mode. v_if_mode_u8 Parameters the value of the interface configuration mode 0 for successful execution; ≠0 for error...
UM-B-085 DA14681 Wearable Development Kit API bmi160_[set/get]_gyro_sleep_trigger_state() int8_t bmi160_set_gyro_sleep_trigger_state( Function Name uint8_t v_gyro_sleep_state_u8) int8_t bmi160_get_gyro_sleep_trigger_state( uint8_t* v_gyro_sleep_state_u8) Function Description (CONFIG) Sets/gets the sleep state of the gyroscope when a sleep transition is performed, i.e. GYR_SUSPEND or GYR_FASTSTARTUP. v_gyro_sleep_state_u8 Parameters the value of the gyroscope sleep state on sleep...
UM-B-085 DA14681 Wearable Development Kit API bmi160_[set/get]_step_alpha() int8_t bmi160_set_step_alpha(uint8_t v_step_alpha_u8) Function Name int8_t bmi160_get_step_alpha(uint8_t* v_step_alpha_u8) Function Description (CONFIG) Sets/gets the alpha parameter for step detection. v_step_alpha_u8 Parameters the value of the alpha parameter (range 0 to 7) 0 for successful execution; ≠0 for error...
UM-B-085 DA14681 Wearable Development Kit API bmi160_[set/get]_paging_enable() int8_t bmi160_set_paging_enable(uint8_t v_page_enable_u8) Function Name int8_t bmi160_get_paging_enable(uint8_t* v_page_enable_u8) Function Description (CONFIG) Sets/gets the state of paging. v_page_enable_u8 Parameters the value of the paging enable bit BMI160_DISABLE, BMI160_ENABLE 0 for successful execution; ≠0 for error...
UM-B-085 DA14681 Wearable Development Kit API 10.1.1.9 Magnetometer Control and Configuration Functions (Indirect Access) bmi160_init_bmm150_mag_interface() int8_t bmi160_init_bmm150_mag_interface(void) Function Name Function Description (INIT-CONFIG) Initializes the I2C interface between BMI160 and BMM150 sensor modules, setting the I2C address, reading the magnetometer trim values, setting the magnetometer to preset mode BMI160_MAG_PRESETMODE_REGULAR (i.e.
UM-B-085 DA14681 Wearable Development Kit API bmi160_init_bmm150_mag_trim_registers() int8_t bmi160_init_bmm150_mag_trim_registers(void) Function Name Function Description (INIIT-CONFIG) Reads trim values of the BMM150 magnetometer and stores them to the instance handle of the BMI160 module. Parameters None 0 for successful execution; ≠0 for error...
UM-B-085 DA14681 Wearable Development Kit API 10.1.2 BMM150 Sensor Driver The BMM150 sensor driver API provides functions for the configuration, control and sensor data acquisition from the integrated by the corresponding module magnetometer sensor. In the Wearable DK platform the latter is controlled by the BMI160 via a secondary I2C interface, as described earlier.
UM-B-085 DA14681 Wearable Development Kit API 10.1.2.2 Dependency Functions bmm150_t -> bus_write() int8_t (*bus_write)(uint8_t dev_addr, uint8_t reg_addr, Function Name uint8_t* reg_data, uint8_t cnt) Function Description Implements write-access over the SPI / I2C bus for writing data to BMM150 sensor module registers.
UM-B-085 DA14681 Wearable Development Kit API bmm150_set_sensor_state() int8_t bmm150_set_sensor_state(uint8_t state) Function Name Function Description (INIT-CONFIG) Sets the state of the magnetometer. state Parameters the state to set for a sensor MAG_NORMAL, MAG_FORCED, MAG_SUSPEND, MAG_SLEEP 0 for successful execution; ≠0 for error...
UM-B-085 DA14681 Wearable Development Kit API bmm150_read_mag_r() int8_t bmm150_read_mag_r(uint16_t *v_mag_r_u16) Function Name Function Description (SAMPLE) Reads magnetometer RHALL (r) data. v_mag_r_u16 Parameters the magnetometer RHALL (r) data 0 for successful execution; ≠0 for error Return Values Notes bmm150_compensate_mag_[x/y/z]() int16_t bmm150_compensate_mag_x(int16_t v_mag_x_s16, uint16_t v_mag_r_u16)
UM-B-085 DA14681 Wearable Development Kit API bmm150_get_low_thres_[x/y/z]_stat() int8_t bmm150_get_low_thres_x_stat(uint8_t* v_low_thres_u8) Function Name int8_t bmm150_get_low_thres_y_stat(uint8_t* v_low_thres_u8) int8_t bmm150_get_low_thres_z_stat(uint8_t* v_low_thres_u8) Function Description (STATE) Reads the status of low threshold magnetometer data on [x/y/z]-axis status bit, indicating whether a magnetometer sample value has been less than the defined low threshold (see bmm150_set_mag_low_thres()).
UM-B-085 DA14681 Wearable Development Kit API bmm150_[set/get]_low_thres_[x/y/z]_enable() int8_t bmm150_set_low_thres_x_enable(uint8_t v_intr_enable_u8) Function Name int8_t bmm150_get_low_thres_x_enable(uint8_t* v_intr_enable_u8) int8_t bmm150_set_low_thres_y_enable(uint8_t v_intr_enable_u8) int8_t bmm150_get_low_thres_y_enable(uint8_t* v_intr_enable_u8) int8_t bmm150_set_low_thres_z_enable(uint8_t v_intr_enable_u8) int8_t bmm150_get_low_thres_z_enable(uint8_t* v_intr_enable_u8) Function Description (CONFIG) Sets/gets the state of the interrupt of low threshold magnetometer sensor data on [x/y/z]-axis.
UM-B-085 DA14681 Wearable Development Kit API bmm150_[set/get]_int_latched() int8_t bmm150_set_int_latched(uint8_t v_intr_latch_u8) Function Name int8_t bmm150_get_int_latched(uint8_t* v_intr_latch_u8) Function Description (CONFIG) Sets/gets the state of the INT interrupt pin as latched. v_intr_latch_u8 Parameters the value of the interrupt latching for the INT pin BMM050_DISABLE, BMM050_ENABLE 0 for successful execution;...
UM-B-085 DA14681 Wearable Development Kit API bmm150_[set/get]_drdy_enable() int8_t bmm150_set_drdy_enable(uint8_t v_drdy_enable_u8) Function Name int8_t bmm150_get_drdy_enable(uint8_t* v_drdy_enable_u8) Function Description (CONFIG) Sets/gets the state of mapping the data ready (drdy) interrupt status to the DRDY pin of the BMM150 sensor module. v_drdy_enable_u8 Parameters...
UM-B-085 DA14681 Wearable Development Kit API bmm150_[set/get]_mag_repetition_z() int8_t bmm150_set_mag_repetition_z(uint8_t v_rep_z_u8) Function Name int8_t bmm150_get_mag_repetition_z(uint8_t* v_rep_z_u8) Function Description (CONFIG) Sets/gets the number of repetitions for magnetometer z-axis data. v_rep_z_u8 Parameters the value of the magnetometer z-axis repetitions 0 for successful execution; ≠0 for error...
UM-B-085 DA14681 Wearable Development Kit API 10.1.3 BME280 Sensor Driver The BME280 sensor driver API provides functions for the configuration, control and sensor data acquisition from the integrated by the corresponding module environmental sensors: pressure, temperature and humidity. Below mainly the functions are presented which are used by the Wearable project, while a complete list of the functions is presented in file bme280.h, based on the datasheet...
UM-B-085 DA14681 Wearable Development Kit API Configuration Functions bme280_[set/get]_hum_oversamp() bme280_[set/get]_pres_oversamp() bme280_[set/get]_temp_oversamp() bme280_[set/get]_filter_coefficient() bme280_[set/get]_standby_time() Low Level Register Access Functions bme280_[set/get]_reg_[reg_name]() 10.1.3.1 Data Structures and Types bme280_t Data Structure Fields Type Description chip_id uint8_t Chip ID of the BME280 sensor module. dev_addr uint8_t Device address of the BME280 sensor module.
UM-B-085 DA14681 Wearable Development Kit API bme280_t -> delay_msec() void (*delay_msec)(uint32_t ms) Function Name Function Description Implements a delay in ms that may be necessary for the BME280 sensor module driver functionality implementation. Parameters the delay (in ms) to be introduced...
UM-B-085 DA14681 Wearable Development Kit API bme280_read_pressure() int8_t bme280_read_pressure(uint32_t *v_pressure_u32) Function Name Function Description (SAMPLE) Reads pressure sensor data. v_pressure_u32 Parameters the pressure sensor data 0 for successful execution; ≠0 for error Return Values Notes Pressure sensor data values are measured in 1 Pa units.
UM-B-085 DA14681 Wearable Development Kit API bme280_calc_force_read_wait_time() int8_t bme280_calc_force_read_wait_time(uint8_t* wait_time) Function Name Function Description (STATE) Calculates wait time needed (in ms) for the sensor data registers to be updated after a change of the power state mode of the environmental sensors to FORCED is performed (see bme280_set_sensor_state(ENV_FORCED)).
Page 295
UM-B-085 DA14681 Wearable Development Kit API bme280_[set/get]_temp_oversamp() int8_t bme280_set_temp_oversamp(uint8_t v_oversamp_u8) Function Name int8_t bme280_get_temp_oversamp(uint8_t* v_oversamp_u8) Function Description (CONFIG) Sets/gets the oversampling mode for temperature sensor data. v_oversamp_u8 Parameters the value of the temperature oversampling mode BME280_OVERSAMP_SKIPPED, BME280_OVERSAMP_1X, BME280_OVERSAMP_2X, BME280_OVERSAMP_4X, BME280_OVERSAMP_8X, BME280_OVERSAMP_16X 0 for successful execution;...
UM-B-085 DA14681 Wearable Development Kit API 10.1.3.8 Low Level Register Access Functions bme280_[set/get]_reg_[reg_name]() int8_t bme280_set_reg_ctrl_hum(uint8_t v_reg_value_u8) Function Name int8_t bme280_get_reg_ctrl_hum(uint8_t *v_reg_value_u8) int8_t bme280_get_reg_status(uint8_t *v_reg_value_u8) int8_t bme280_set_reg_ctrl_meas(uint8_t v_reg_value_u8) int8_t bme280_get_reg_ctrl_meas(uint8_t *v_reg_value_u8) int8_t bme280_set_reg_config(uint8_t v_reg_value_u8) int8_t bme280_get_reg_config(uint8_t *v_reg_value_u8) Function Description (LOW-ACCESS) Sets/gets the register [reg_name] value based on the register names presented in BME280 datasheet Register Map.
UM-B-085 DA14681 Wearable Development Kit API 10.1.4 DI5115 Sensor Driver The DI5115 sensor high-level driver API provides functions for the configuration, control and sensor data acquisition from the integrated by the corresponding module accelerometer and optical (Health Care - HC) sensors. The term ‘high level’ means that the API functions do not refer to direct register...
UM-B-085 DA14681 Wearable Development Kit API Command Functions di5115_hld_opt_disable_intrs() Configuration Functions di5115_hld_opt_hr_adapt_optical_gain() 10.1.4.1 Data Structures and Types di5115_hld_error_t Type Definition Name Description di5115_hld_error_t Execution status of a function: DI5115_HLD_SUCCESS, DI5115_HLD_FAIL di5115_hld_hr_gr_led_intens_data_t Type Definition Name Description di5115_hld_hr_gr_led_intens_data_t Green LED light intensity raw data value representation:...
UM-B-085 DA14681 Wearable Development Kit API 10.1.4.2 Dependency Functions di5115_hld_handle_t -> bus_write() int8_t (*bus_write)(uint8_t dev_addr, uint8_t reg_addr, Function Name uint8_t* reg_data, uint8_t cnt) Function Description Implements write-access over the I2C bus for writing data to DI5115 sensor module registers. dev_addr...
UM-B-085 DA14681 Wearable Development Kit API 10.1.4.3 Initialization and Basic Configuration Functions di5115_hld_opt_init() di5115_hld_error_t di5115_hld_opt_init(di5115_hld_handle_t* handle) Function Name Function Description Initializes the DI5115 sensor module, creating the appropriate instance handle for the module which includes references to the I2C bus access functions used for reading/writing values to the registers, and soft-resetting its state.
UM-B-085 DA14681 Wearable Development Kit API 10.1.4.4 Sensor Data Acquisition Functions di5115_hld_opt_hr_leds_intensity_read() di5115_hld_error_t di5115_hld_opt_hr_leds_intensity_read( Function Name di5115_hld_hr_gr_led_intens_data_t* hgr_data, di5115_hld_hr_ir_led_intens_data_t* hir_data, bool* valid_data) Function Description Reads optical sensor data related to Green and IR LED light intensity. hgr_data Parameters the Green LED light intensity data...
UM-B-085 DA14681 Wearable Development Kit API 10.1.5 SX9300 Sensor Driver The SX9300 sensor driver API provides functions for communication with the SX9300 touch sensor module. The wearable task gets information from the touch sensor via the SX9300 driver and uses it to detect finger touches on the two touch pads below the wearable screen.
Page 303
UM-B-085 DA14681 Wearable Development Kit API sx9300_input_cap_t Type Definition Name Description sx9300_input_cap_t Input capacitance range enumeration type defined as: SX9300_CAP_LARGE, SX9300_CAP_MEDIUM_LARGE, SX9300_CAP_MEDIUM_SMALL, SX9300_CAP_SMALL sx9300_gain_t Type Definition Name Description sx9300_gain_t Digital gain factor enumeration type defined as: SX9300_GAIN_OFF, SX9300_GAIN_2, SX9300_GAIN_4, SX9300_GAIN_8...
Page 304
UM-B-085 DA14681 Wearable Development Kit API sx9300_prox_threshold_t Type Definition Name Description sx9300_proxthreshold_t Proximity detection threshold enumeration type defined as: SX9300_PROX_THRESH_0, SX9300_PROX_THRESH_20, SX9300_PROX_THRESH_40, SX9300_PROX_THRESH_60, SX9300_PROX_THRESH_80, SX9300_PROX_THRESH_100, SX9300_PROX_THRESH_120, SX9300_PROX_THRESH_140, SX9300_PROX_THRESH_160, SX9300_PROX_THRESH_180, SX9300_PROX_THRESH_200, SX9300_PROX_THRESH_220, SX9300_PROX_THRESH_240, SX9300_PROX_THRESH_260, SX9300_PROX_THRESH_280, SX9300_PROX_THRESH_300, SX9300_PROX_THRESH_350, SX9300_PROX_THRESH_400, SX9300_PROX_THRESH_450, SX9300_PROX_THRESH_500, SX9300_PROX_THRESH_600,...
Page 305
UM-B-085 DA14681 Wearable Development Kit API sx9300_sar_threshold_t Type Definition Name Description sx9300_sar_threshold_t SAR delta threshold enumeration type defined as: SX9300_SAR_THRESH_OFF, SX9300_SAR_THRESH_1, SX9300_SAR_THRESH_3, SX9300_SAR_THRESH_5, SX9300_SAR_THRESH_10, SX9300_SAR_THRESH_15, SX9300_SAR_THRESH_20, SX9300_SAR_THRESH_25, SX9300_SAR_THRESH_30, SX9300_SAR_THRESH_35, SX9300_SAR_THRESH_40, SX9300_SAR_THRESH_45, SX9300_SAR_THRESH_50, SX9300_SAR_THRESH_55, SX9300_SAR_THRESH_60, SX9300_SAR_THRESH_70 sx9300_prox_stuck_timeout_t Type Definition Name Description sx9300_prox_stuck_timeout_t Proximity ‘stuck’...
UM-B-085 DA14681 Wearable Development Kit API 10.1.5.2 Functions sx9300_init() void sx9300_init(const sx9300_t *handle); Function Name Function Description Initializes SX9300 driver, allocates the memory, initializes I2C for communication with sensor, sets up sensitivities and other sensor configurations and configures interrupts. handle...
Page 307
UM-B-085 DA14681 Wearable Development Kit API Parameters Corresponding value of period Scan period range Input capacitance range gain Digital gain factor freq Sampling frequency Capacitance measurement resolution / precision filter PROXRAW filter strength threshold Average threshold that will trigger compensation...
UM-B-085 DA14681 Wearable Development Kit API void sx9300_config_autocompensation(bool enable, sx9300_comp_method_t Function Name mode); Function Description Configures the automatic compensation settings. enable Parameters True disables the automatic compensation mode Compensation method Return Values None Notes sx9300_config_close_far_deb() void sx9300_config_close_far_deb(sx9300_deb_samples_t close, Function Name sx9300_deb_samples_t far);...
Page 309
UM-B-085 DA14681 Wearable Development Kit API bus_read() void bus_read(uint8_t reg, uint8_t *value, size_t length); Function Name Function Description Callback function to read an I2C register set Parameters Register to read value Data to get length Lenth of data to get...
UM-B-085 DA14681 Wearable Development Kit API 10.1.6 AB08X5 Real Time Clock Driver The AB08X5 RTC driver API provides functions for communication with the AB08X5 Real Time Clock module. The wearable task gets information from the AB08X5 RTC via the RTC driver and uses it in communication with other modules/tasks (e.g.
Page 311
UM-B-085 DA14681 Wearable Development Kit API ab08x5_err_t Type Definition Name Description ab08x5_err_t Error value enumeration type defined as: AB08X5_OK, AB08X5_NOT_FOUND, AB08X5_ERROR, AB08X5_BAD_VALUE = 0x04 ab08x5_t Field Type Description read_register reg_access_callback Read register callback write_reister reg_access_callback Write register callback User Manual Revision 1.0...
UM-B-085 DA14681 Wearable Development Kit API 10.1.6.2 Functions ab08x5_init() void ab08x5_init(const ab08x5_t *cb); Function Name Function Description Initializes AB08X5 driver, sets hour mode to 24-hour mode, enables trickle charger and configures interrupts. Parameters None Return Values None Notes ab08x5_set_rtc_tick_intr_interval_ms bool ab08x5_set_rtc_tick_intr_interval_ms(uint32_t ms);...
Page 313
UM-B-085 DA14681 Wearable Development Kit API void ab08x5_get_time(); Function Name void ab08x5_get_date(); Function Description Updates the time/date values in RTC structure Parameters None Return Values None Notes ab08x5_set_[field]() ab08x5_err_t ab08x5_set_hundredths(uint8_t hundredths); Function Name ab08x5_err_t ab08x5_set_seconds(uint8_t seconds); ab08x5_err_t ab08x5_set_minutes(uint8_t minutes); ab08x5_err_t ab08x5_set_hours(uint8_t hours);...
Page 314
UM-B-085 DA14681 Wearable Development Kit API years Parameters Years value to be set months Months value to be set days Days value to be set weekday Weekday value to be set Error number ab08x5_err_t Return Values Notes ab08x5_get_[alarm field]_alarm() uint8_t ab08x5_get_hundredths_alarm(bool update);...
Page 315
UM-B-085 DA14681 Wearable Development Kit API Parameters Corresponding value of hundredths_alarm value of hundredths to be set (range <00 , 99>) seconds_alarm value of seconds to be set (range <00 , 59>) minutes_alarm value of minutes to be set (range <00 , 59>) hours_alarm value of hours to be set (range <00, 23>)
Page 317
UM-B-085 DA14681 Wearable Development Kit API ab08x5_airq_rpt_t ab08x5_get_alarm_rpt_config(void); Function Name ab08x5_alarm_mode_t ab08x5_get_alarm_mode_config(void); Function Description Get configuration of alarm matching the current time/date Parameters None Return Values Coresponding configuration ab08x5_airq_rpt_t ab08x5_alarm_mode_t Notes ab08x5_get_timestamp() uint32_t ab08x5_get_timestamp(); Function Name Function Description Creates the UNIX timestamp from RTC values.
UM-B-085 DA14681 Wearable Development Kit API 10.1.7 LS013B7DH03 Display Driver The LS013B7DH03 display driver module is the bottom layer of communication with the LCD display. The module contains a set of API functions that allow full control of the display. Brief descriptions for each function can be found in the next section.
UM-B-085 DA14681 Wearable Development Kit API 10.1.7.1 Functions ls013b7dh03_init() void ls013b7dh03_init(const ls013b7dh03_t *handle); Function Name Function Description Initializes display driver. Parameters handle Instance of the ls013b7dh03 driver Return Values None Notes ls013b7dh03_[enable/disable]() void ls013b7dh03_enable(void); Function Name void ls013b7dh03_disable(void); Function Description...
FXL6408 device access, respectively, each time a set of the driver API functions needs to be called. The driver uses I2C bus adapter API functions provided by the SDK accompanying the DA14681 chip to implement I2C bus access, so that the latter can be shared with other devices (i.e. DI5115, SX9300 and AB09X5).
UM-B-085 DA14681 Wearable Development Kit API 10.1.8.2 Dependency Functions fxl6408_t -> bus_write() int8_t (*bus_write)(uint8_t dev_addr, uint8_t reg_addr, uint8_t* reg_data) Function Name Function Description Implements write-access over the I2C bus for writing data to FXL6408 peripheral device module registers. dev_addr Parameters...
UM-B-085 DA14681 Wearable Development Kit API fxl6408_t -> delay_msec() void (*delay_msec)(uint32_t ms) Function Name Function Description Implements a delay in ms that may be necessary for the FXL6408 peripheral device module driver functionality implementation. Parameters the delay (in ms) to be introduced...
UM-B-085 DA14681 Wearable Development Kit API 10.1.8.4 Command Functions fxl6408_soft_reset() int8_t fxl6408_soft_reset(void) Function Name Function Description (CMD) Performs a soft reset to the FXL6408 peripheral device module. Parameters None 0 for successful execution; ≠0 for error Return Values Notes fxl6408_clear_rst_intr()
UM-B-085 DA14681 Wearable Development Kit API fxl6408_get_gpio_intr_stat() int8_t fxl6408_get_gpio_intr_stat(uint8_t v_gpio_u8, Function Name uint8_t* v_gpio_intr_u8) Function Description (STATE) Reads the status of a specific GPIO interrupt status bit, indicating whether a GPIO input pin has changed state from default. v_gpio_u8 Parameters...
Page 326
UM-B-085 DA14681 Wearable Development Kit API fxl6408_set_gpio_output_high_z_enable() int8_t fxl6408_set_gpio_output_high_z_enable(uint8_t v_gpio_u8, Function Name uint8_t v_gpio_out_high_z_enable_u8) Function Description (CONFIG) Sets the state of high-z enable status bit for a specific GPIO pin configured as output. v_gpio_u8 Parameters the value of the GPIO pin...
Page 327
UM-B-085 DA14681 Wearable Development Kit API fxl6408_set_gpio_input_pull_up_down_mode() int8_t fxl6408_set_gpio_input_pull_up_down_mode(uint8_t v_gpio_u8, Function Name uint8_t v_gpio_in_pull_up_down_mode_u8) Function (CONFIG) Sets pull-up or pull-down mode selection for a specific GPIO pin configured Description as input. v_gpio_u8 Parameters the value of the GPIO pin FXL6408_GPIO_0, FXL6408_GPIO_1, FXL6408_GPIO_2,...
Page 330
Dialog Semiconductor excludes all liability in this respect. Customer notes that nothing in this document may be construed as a license for customer to use the Dialog Semiconductor products, software and applications referred to in this document. Such license must be separately sought by customer with Dialog Semiconductor.
Need help?
Do you have a question about the DA14681 and is the answer not in the manual?
Questions and answers