mcu_hi3321_watch/tjd/service/service_gsensor.h
2025-05-26 20:15:20 +08:00

77 lines
1.8 KiB
C

/*----------------------------------------------------------------------------
* Copyright (c) TJD Technologies Co., Ltd. 2020. All rights reserved.
*
* Description: service_gsensor.h
*
* Author: liangjianfei
*
* Create: 2024-4-25
*--------------------------------------------------------------------------*/
#ifndef SERVICE_GSENSOR_H
#define SERVICE_GSENSOR_H
#include <stdint.h>
#include <stdbool.h>
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif
typedef struct
{
int16_t raw_data;
}gsen_data_t;
typedef struct{
#ifdef TJD_PCBA_0
int16_t gsensor_x;
int16_t gsensor_y;
int16_t gsensor_z;
#elif defined(TJD_PCBA_1)
gsen_data_t gsensor_x;
gsen_data_t gsensor_y;
gsen_data_t gsensor_z;
#endif
}gsensor_xyz_info;
typedef enum {
DD_ONCE,
DD_REPEATE
} fit_data_type;
typedef enum {
GSEN_SERVICE_HR = 0,
GSEN_SERVICE_SPORT,
GSEN_SERVICE_MSEN,
GSEN_SERVICE_PRODUCTION,
GSEN_SERVICE_LUCKY_CLOVER,
GSEN_SERVICE_MAX //加到MAX之前
} gsen_service_id_t;
typedef struct {
gsensor_xyz_info *buffer;
uint32_t capacity;
uint32_t count;
} gsensor_buffer;
#ifdef TJD_PCBA_0
extern void tjd_service_timer_gsensor_start_send(void);
extern void tjd_service_timer_gsensor_end_send(void);
#elif defined(TJD_PCBA_1)
void tjd_service_gsensor_open(void);
void tjd_service_gsensor_close(void);
void tjd_service_gs_add_xyz_fifo(uint8_t id,int16_t x, int16_t y, int16_t z);
uint8_t tjd_service_gs_get_xyz_fifo(gsen_service_id_t id, gsensor_xyz_info *buf, uint8_t count);
gsensor_xyz_info* tjd_service_gs_get_xyz_fifo_point(void);
uint8_t tjd_service_gs_get_fifo_count(gsen_service_id_t id);
#endif
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif
#endif