52 #ifndef BHY_UC_DRIVER_H_
53 #define BHY_UC_DRIVER_H_
65 (
const uint8_t *bhy_fw_data);
69 bhy_meta_event_fifo_type_t fifo_sel,
70 uint8_t enable_state, uint8_t int_enable_state);
74 bhy_meta_event_fifo_type_t fifo_sel,
75 uint8_t* p_enable_state, uint8_t* p_int_enable_state);
88 BHY_RETURN_FUNCTION_TYPE
bhy_mapping_matrix_set(bhy_physical_sensor_index_type_t index , int8_t *p_mapping_matrix);
100 BHY_RETURN_FUNCTION_TYPE
bhy_mapping_matrix_get(bhy_physical_sensor_index_type_t index , int8_t *p_mapping_matrix);
111 BHY_RETURN_FUNCTION_TYPE
bhy_soft_passthru_write(uint8_t addr, uint8_t reg, uint8_t *data, uint8_t length, uint8_t increment_reg);
122 BHY_RETURN_FUNCTION_TYPE
bhy_soft_passthru_read(uint8_t addr, uint8_t reg, uint8_t *data, uint8_t length, uint8_t increment_reg);
145 (bhy_virtual_sensor_t sensor_id, uint8_t wakeup_status, uint16_t sample_rate,
146 uint16_t max_report_latency_ms, uint8_t flush_sensor, uint16_t change_sensitivity,
147 uint16_t dynamic_range);
151 (bhy_virtual_sensor_t sensor_id, uint8_t wakeup_status);
166 BHY_RETURN_FUNCTION_TYPE
bhy_read_fifo(uint8_t * buffer, uint16_t buffer_size,
167 uint16_t * bytes_read, uint16_t * bytes_left);
181 (uint8_t **fifo_buffer, uint16_t *fifo_buffer_length,
192 uint32_t * system_timestamp);
202 uint8_t *data, uint8_t length);
212 uint8_t *data, uint8_t length);
232 #if BHY_CALLBACK_MODE
235 BHY_RETURN_FUNCTION_TYPE bhy_install_sensor_callback (bhy_virtual_sensor_t sensor_id, uint8_t wakeup_status,
void (*sensor_callback)(
bhy_data_generic_t *, bhy_virtual_sensor_t));
236 BHY_RETURN_FUNCTION_TYPE bhy_install_timestamp_callback(uint8_t wakeup_status,
void (*timestamp_callback)(
bhy_data_scalar_u16_t *));
237 BHY_RETURN_FUNCTION_TYPE bhy_install_meta_event_callback(bhy_meta_event_type_t meta_event_id,
void (*meta_event_callback)(
bhy_data_meta_event_t *, bhy_meta_event_type_t));
242 BHY_RETURN_FUNCTION_TYPE bhy_uninstall_sensor_callback (bhy_virtual_sensor_t sensor_id, uint8_t wakeup_status);
243 BHY_RETURN_FUNCTION_TYPE bhy_uninstall_timestamp_callback (uint8_t wakeup_status );
244 BHY_RETURN_FUNCTION_TYPE bhy_uninstall_meta_event_callback (bhy_meta_event_type_t meta_event_id);
BHY_RETURN_FUNCTION_TYPE bhy_read_parameter_page(uint8_t page, uint8_t parameter, uint8_t *data, uint8_t length)
This function reads arbitrary data from an arbitrary parameter page.
Definition: bhy_uc_driver.c:925
BHY_RETURN_FUNCTION_TYPE bhy_driver_init(const uint8_t *bhy_fw_data)
This function initializes the driver, the API and loads the ram patch into the sensor.
Definition: bhy_uc_driver.c:150
BHY_RETURN_FUNCTION_TYPE bhy_sync_cus_evt_size(void)
This function get all the custom sensor data length according reading information from hub.
Definition: bhy_uc_driver.c:1328
BHY_RETURN_FUNCTION_TYPE bhy_mapping_matrix_set(bhy_physical_sensor_index_type_t index, int8_t *p_mapping_matrix)
This function set mapping matrix to a corresponding physical sensor.
Definition: bhy_uc_driver.c:994
BHY_RETURN_FUNCTION_TYPE bhy_parse_next_fifo_packet(uint8_t **fifo_buffer, uint16_t *fifo_buffer_length, bhy_data_generic_t *fifo_data_output, bhy_data_type_t *fifo_data_type)
this functions parse the packet in fifo and get the actual fifo data of sensors
Definition: bhy_uc_driver.c:425
BHY_RETURN_FUNCTION_TYPE bhy_enable_virtual_sensor(bhy_virtual_sensor_t sensor_id, uint8_t wakeup_status, uint16_t sample_rate, uint16_t max_report_latency_ms, uint8_t flush_sensor, uint16_t change_sensitivity, uint16_t dynamic_range)
this functions enables the selected virtual sensor
Definition: bhy_uc_driver.c:234
BHY_RETURN_FUNCTION_TYPE bhy_get_sic_matrix(float *sic_matrix)
This function reads out the current SIC matrix from BHy.
Definition: bhy_uc_driver.c:1292
BHY_RETURN_FUNCTION_TYPE bhy_meta_event_set_config(bhy_meta_event_type_t meta_event_id, bhy_meta_event_fifo_type_t fifo_sel, uint8_t enable_state, uint8_t int_enable_state)
this function configures meta event
Definition: bhy_uc_driver.c:187
BHY_RETURN_FUNCTION_TYPE bhy_mapping_matrix_get(bhy_physical_sensor_index_type_t index, int8_t *p_mapping_matrix)
This function get mapping matrix from a corresponding physical sensor.
Definition: bhy_uc_driver.c:1073
BHY_RETURN_FUNCTION_TYPE bhy_soft_passthru_write(uint8_t addr, uint8_t reg, uint8_t *data, uint8_t length, uint8_t increment_reg)
Soft pass-through parameter write function.
Definition: bhy_uc_driver.c:1146
BHY_RETURN_FUNCTION_TYPE bhy_meta_event_get_config(bhy_meta_event_type_t meta_event_id, bhy_meta_event_fifo_type_t fifo_sel, uint8_t *p_enable_state, uint8_t *p_int_enable_state)
this function gets configuration from specific meta event
Definition: bhy_uc_driver.c:209
BHY_RETURN_FUNCTION_TYPE bhy_set_sic_matrix(float *sic_matrix)
This function write a new SIC matrix to the BHy.
Definition: bhy_uc_driver.c:1370
BHY_RETURN_FUNCTION_TYPE bhy_gp_register_read(bhy_gp_register_type_t gp_reg, uint8_t *p_data)
Write data to specific GP register.
Definition: bhy_uc_driver.c:1276
BHY_RETURN_FUNCTION_TYPE bhy_read_fifo(uint8_t *buffer, uint16_t buffer_size, uint16_t *bytes_read, uint16_t *bytes_left)
this functions retrieves the fifo data,it needs a buffer of at least (BHY_I2C_REG_BUFFER_LENGTH + 1) ...
Definition: bhy_uc_driver.c:354
int8_t bhy_get_cus_evt_size(bhy_virtual_sensor_t sensor_id)
This function get the specific custom sensor data length according reading information from hub.
Definition: bhy_uc_driver.c:1353
BHY_RETURN_FUNCTION_TYPE bhy_gp_register_write(bhy_gp_register_type_t gp_reg, uint8_t data)
Write data to specific GP register.
Definition: bhy_uc_driver.c:1251
BHY_RETURN_FUNCTION_TYPE bhy_soft_passthru_read(uint8_t addr, uint8_t reg, uint8_t *data, uint8_t length, uint8_t increment_reg)
Soft pass-through parameter read function.
Definition: bhy_uc_driver.c:1190
BHY_RETURN_FUNCTION_TYPE bhy_update_system_timestamp(bhy_data_scalar_u16_t *timestamp_packet, uint32_t *system_timestamp)
This function will detect the timestamp packet accordingly and update either the MSW or the LSW of th...
Definition: bhy_uc_driver.c:815
BHY_RETURN_FUNCTION_TYPE bhy_write_parameter_page(uint8_t page, uint8_t parameter, uint8_t *data, uint8_t length)
This function writes arbitrary data to an arbitrary parameter page.
Definition: bhy_uc_driver.c:854
void bhy_print_debug_packet(bhy_data_debug_t *packet, void(*debug_print_ptr)(const uint8_t *))
This function outputs the debug data to function pointer You need to provide a function that takes as...
Definition: bhy_uc_driver.c:1408
BHY_RETURN_FUNCTION_TYPE bhy_disable_virtual_sensor(bhy_virtual_sensor_t sensor_id, uint8_t wakeup_status)
this functions disables the selected virtual sensor
Definition: bhy_uc_driver.c:303
header file of bhy_uc_driver.c
Definition: bhy_uc_driver_types.h:277
Definition: bhy_uc_driver_types.h:232
Definition: bhy_uc_driver_types.h:301