pedometer3 2.0.0.0
|
Functions | |
void | pedometer3_cfg_setup (pedometer3_cfg_t *cfg) |
Config Object Initialization function. | |
err_t | pedometer3_init (pedometer3_t *ctx, pedometer3_cfg_t *cfg) |
Initialization function. | |
void | pedometer3_default_cfg (pedometer3_t *ctx) |
Click Default Configuration function. | |
void | pedometer3_generic_write (pedometer3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | pedometer3_generic_read (pedometer3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
void | pedometer3_get_accel_axis (pedometer3_t *ctx, pedometer3_axis_t *axis) |
Functions for read Accel axis data. | |
void | pedometer3_get_hp_accel_axis (pedometer3_t *ctx, pedometer3_axis_t *axis) |
Functions for read High Pass Accel axis data. | |
void | pedometer3_set_step_watermark (pedometer3_t *ctx, uint16_t value) |
Functions for sets pedometer step counter Watermark. | |
void | pedometer3_pedometer_cfg (pedometer3_t *ctx, uint8_t odr) |
Functions for pedometer configuration. | |
uint16_t | pedometer3_get_step_counter (pedometer3_t *ctx) |
Functions for get pedometer step counter. | |
void | pedometer3_get_tilt_position (pedometer3_t *ctx, pedometer3_tilt_position_t *tilt) |
Functions for get Tilt current and previous position. | |
uint8_t | pedometer3_get_tap_detection (pedometer3_t *ctx) |
Functions for get Tap detection. | |
err_t | pedometer3_test_communication (pedometer3_t *ctx) |
Functions for test first comunication width chip. | |
uint8_t | pedometer3_get_interrupt_1 (pedometer3_t *ctx) |
Functions for read INT pin state. | |
uint8_t | pedometer3_get_interrupt_2 (pedometer3_t *ctx) |
Functions for read RST pin state. | |
uint8_t | pedometer3_get_trigger_int (pedometer3_t *ctx) |
Functions for read AN pin state. | |
void pedometer3_cfg_setup | ( | pedometer3_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
This function initializes click configuration structure to init state.
void pedometer3_default_cfg | ( | pedometer3_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
This function executes default configuration for Pedometer3 click.
PEDOMETER3_REG_CONTROL_1 ------------------------------------------- PEDOMETER3_CNTL1_MODE_STAND_BY PEDOMETER3_CNTL1_RES_MODE_HIGHER_NOISE PEDOMETER3_CNTL1_DATA_READY_DISABLE PEDOMETER3_CNTL1_G_RANGE_8g PEDOMETER3_CNTL1_PEDOMETER_DISABLE PEDOMETER3_CNTL1_TILT_DISABLE PEDOMETER3_CNTL1_TAP_DISABLE
PEDOMETER3_REG_CONTROL_2
PEDOMETER3_CNTL2_SOFTWARE_RESET_NO_ACTIVE PEDOMETER3_CNTL2_COMMAND_TEST_NO_ACTIVE PEDOMETER3_CNTL2_DOWN_STATE_ENABLE PEDOMETER3_CNTL2_FACE_DOWN_STATE_ENABLE PEDOMETER3_CNTL2_FACE_UP_STATE_ENABLE PEDOMETER3_CNTL2_LEFT_STATE_ENABLE PEDOMETER3_CNTL2_RIGHT_STATE_ENABLE PEDOMETER3_CNTL2_UP_STATE_ENABLE
PEDOMETER3_REG_CONTROL_3 ------------------------------------------- PEDOMETER3_CNTL3_OTP_OUTPUT_DATA_RATE_12_5Hz PEDOMETER3_CNTL3_TAP_OUTPUT_DATA_RATE_400Hz PEDOMETER3_CNTL3_OWUF_OUTPUT_DATA_RATE_0_781Hz
PEDOMETER3_REG_CONTROL_4
PEDOMETER3_CNTL4_COUNTER_DECREMENT_MODE PEDOMETER3_CNTL4_THRESHOLD_MODE_ABSOLUTE PEDOMETER3_CNTL4_WAKE_UP_DISABLE PEDOMETER3_CNTL4_BACK_TO_SLEEP_DISABLE PEDOMETER3_CNTL2_FACE_UP_STATE_ENABLE PEDOMETER3_CNTL4_HIGH_PASS_ENABLE PEDOMETER3_CNTL4_OBTS_OUTPUT_DATA_RATE_0_781Hz
PEDOMETER3_REG_CONTROL_5 ------------------------------------------- PEDOMETER3_CNTL5_MANUAL_WAKE_UP_0 PEDOMETER3_CNTL5_MANUAL_SLEEP_UP_0
PEDOMETER3_REG_OUTPUT_DATA_CONTROL
PEDOMETER3_ODCNTL_IR_BYPASS_FILTERING_APPLIED PEDOMETER3_ODCNTL_LPRO_ODR_9 PEDOMETER3_ODCNTL_OSA_OUTPUT_DATA_RATE_50Hz PEDOMETER3_CNTL4_BACK_TO_SLEEP_DISABLE PEDOMETER3_CNTL2_FACE_UP_STATE_ENABLE PEDOMETER3_CNTL4_HIGH_PASS_ENABLE PEDOMETER3_CNTL4_OBTS_OUTPUT_DATA_RATE_0_781Hz
Set Pedometer Step Watermark on the 10 000 steps
PEDOMETER3_REG_PEDOMETER_CONTROL_2 ------------------------------------------- PEDOMETER3_PED_CNTL2_HIGH_PASS_FILTER_4 PEDOMETER3_PED_CNTL2_ODR_SELECT_100Hz
PEDOMETER3_REG_INTERRUPT_CONTROL_7
PEDOMETER3_INC7_STEP_OVERFLOW_INTERRUPT_2_ENABLE PEDOMETER3_INC7_STEP_WATERMARK_INTERRUPT_2_ENABLE PEDOMETER3_INC7_STEP_INCREMENT_INTERRUPT_1_ENABLE
PEDOMETER3_REG_INTERRUPT_CONTROL_1 ------------------------------------------- PEDOMETER3_INC1_PHYSICAL_INTERRUPT_ENABLE PEDOMETER3_REG_INTERRUPT_CONTROL_5 ------------------------------------------- PEDOMETER3_INC5_PHYSICAL_INTERRUPT_ENABLE
Start pedometer config on the ODR = 100Hz
void pedometer3_generic_read | ( | pedometer3_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic read function.
ctx | Click object. |
reg | Register address. |
data_buf | Output data buf |
len | Number of the bytes to be read |
This function reads data from the desired register.
void pedometer3_generic_write | ( | pedometer3_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic write function.
ctx | Click object. |
reg | Register address. |
data_buf | Data buf to be written. |
len | Number of the bytes in data buf. |
This function writes data to the desired register.
void pedometer3_get_accel_axis | ( | pedometer3_t * | ctx, |
pedometer3_axis_t * | axis ) |
Functions for read Accel axis data.
ctx | Click object. |
axis | Accel axis structure. |
void pedometer3_get_hp_accel_axis | ( | pedometer3_t * | ctx, |
pedometer3_axis_t * | axis ) |
Functions for read High Pass Accel axis data.
ctx | Click object. |
axis | Accel axis structure. |
uint8_t pedometer3_get_interrupt_1 | ( | pedometer3_t * | ctx | ) |
Functions for read INT pin state.
ctx | Click object. |
Interrupt | 1 state |
uint8_t pedometer3_get_interrupt_2 | ( | pedometer3_t * | ctx | ) |
Functions for read RST pin state.
ctx | Click object. |
Interrupt | 2 state |
uint16_t pedometer3_get_step_counter | ( | pedometer3_t * | ctx | ) |
Functions for get pedometer step counter.
ctx | Click object. |
uint8_t pedometer3_get_tap_detection | ( | pedometer3_t * | ctx | ) |
Functions for get Tap detection.
ctx | Click object. |
tap | A tap that's detected |
return value | name TAP --------------+--------------------------- 10 | PEDOMETER3_TAP_X_NEGATIVE 11 | PEDOMETER3_TAP_X_POSITIVE 20 | PEDOMETER3_TAP_Y_NEGATIVE 21 | PEDOMETER3_TAP_Y_POSITIVE 30 | PEDOMETER3_TAP_Z_NEGATIVE 31 | PEDOMETER3_TAP_Z_POSITIVE
void pedometer3_get_tilt_position | ( | pedometer3_t * | ctx, |
pedometer3_tilt_position_t * | tilt ) |
Functions for get Tilt current and previous position.
ctx | Click object. |
tilt | Tilt structure |
return value | name position -------------+------------------------------------ 1 | PEDOMETER3_TILT_POSITION_LEFT 2 | PEDOMETER3_TILT_POSITION_RIGHT 3 | PEDOMETER3_TILT_POSITION_DOWN 4 | PEDOMETER3_TILT_POSITION_UP 5 | PEDOMETER3_TILT_POSITION_FACE_DOWN 6 | PEDOMETER3_TILT_POSITION_FACE_UP
uint8_t pedometer3_get_trigger_int | ( | pedometer3_t * | ctx | ) |
Functions for read AN pin state.
ctx | Click object. |
Trigger | interrupt state |
err_t pedometer3_init | ( | pedometer3_t * | ctx, |
pedometer3_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
This function initializes all necessary pins and peripherals used for this click.
void pedometer3_pedometer_cfg | ( | pedometer3_t * | ctx, |
uint8_t | odr ) |
Functions for pedometer configuration.
ctx | Click object. |
odr | ODR frequency ( 100 Hz or 50 Hz) |
void pedometer3_set_step_watermark | ( | pedometer3_t * | ctx, |
uint16_t | value ) |
Functions for sets pedometer step counter Watermark.
ctx | Click object. |
value | Value for sets |
err_t pedometer3_test_communication | ( | pedometer3_t * | ctx | ) |
Functions for test first comunication width chip.
ctx | Click object. |
0 | [PEDOMETER3_ERROR] - Device error, not read main iD |
1 | [PEDOMETER_OK] - Successfully read the main ID and the device is ready to work |