PebbleOS v4.47.0-512-g5285d4236
Loading...
Searching...
No Matches
accel_manager.h File Reference
#include "accel_manager_types.h"
#include <stdint.h>
#include <kernel/pebble_tasks.h>

Typedefs

typedef void(* AccelDataReadyCallback) (void *context)
 Called when a subscriber's sample buffer is full.
 
typedef struct AccelManagerState AccelManagerState
 Opaque accelerometer subscription.
 

Functions

uint32_t sys_accel_manager_get_max_samples_per_update (void)
 Get the maximum number of samples that can be batched per update.
 
void accel_manager_init (void)
 Initialize the accelerometer manager.
 
void accel_manager_enable (bool on)
 Enable or disable the accelerometer.
 
void accel_manager_set_motion_backlight_enabled (bool enabled)
 Enable or disable the kernel's shake subscription for the motion backlight.
 
int sys_accel_manager_peek (AccelData *accel_data)
 Read the current accelerometer sample.
 
AccelManagerState * sys_accel_manager_data_subscribe (AccelSamplingRate rate, AccelDataReadyCallback data_cb, void *context, PebbleTask handler_task)
 Subscribe to accelerometer data.
 
bool sys_accel_manager_data_unsubscribe (AccelManagerState *state)
 Remove a subscription and free it.
 
void accel_manager_remove_task_subscriptions (PebbleTask task)
 Remove every subscription that delivers its data to task.
 
int sys_accel_manager_set_sampling_rate (AccelManagerState *state, AccelSamplingRate rate)
 Change the sampling rate of a subscription.
 
uint32_t accel_manager_set_jitterfree_sampling_rate (AccelManagerState *state, uint32_t min_rate_mHz)
 Use the lowest jitter-free sampling rate of at least min_rate_mHz.
 
int sys_accel_manager_set_sample_buffer (AccelManagerState *state, AccelRawData *buffer, uint32_t samples_per_update)
 Set the buffer that receives a subscription's samples.
 
uint32_t sys_accel_manager_get_num_samples (AccelManagerState *state, uint64_t *timestamp_ms, uint32_t *generation)
 Get the number of samples currently in a subscription's buffer.
 
bool sys_accel_manager_consume_samples (AccelManagerState *state, uint32_t samples, uint32_t generation, bool *more)
 Finish handling a data callback, so the next one can be posted.
 
void accel_enable_high_sensitivity (bool high_sensitivity)
 Make shake detection sensitive enough to trigger on small movements.
 
void accel_manager_update_sensitivity (uint8_t sensitivity_percent)
 Set the motion sensitivity from the user preference.
 
bool accel_is_idle (void)
 Check whether the watch has been idle.