/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file    yunhorn_sts_weight_scale.h    									   *
  * @author  Yunhorn (r) Technology Limited Application Team	               *
  * @brief   Yunhorn (r) SmarToilets (r) Product configuration file.		   *
  ******************************************************************************
  * @attention
  *
  * Copyright (c) 2024 Yunhorn Technology Limited.
  * Copyright (c) 2024 Shenzhen Yunhorn Technology Co., Ltd.
  * All rights reserved.
  *
  * This software is licensed under terms that can be found in the LICENSE file
  * in the root directory of this software component.
  * If no LICENSE file comes with this software, it is provided AS-IS.
  *
  ******************************************************************************
  */
/* USER CODE END Header */


#ifndef YUNHORN_STS_WEIGHT_SCALE_H_
#define YUNHORN_STS_WEIGHT_SCALE_H_
#include "main.h"
#include "sys_app.h"



typedef struct
{
	uint32_t	weight_scale_value;
  float pressure;         /*!< in mbar */
  float temperature;      /*!< in degC */
  float humidity;         /*!< in % */
  int32_t latitude;       /*!< latitude converted to binary */
  int32_t longitude;      /*!< longitude converted to binary */
  int16_t altitudeGps;    /*!< in m */
  int16_t altitudeBar;    /*!< in m * 10 */
  /**more may be added*/
  /* USER CODE BEGIN sensor_t */

  /* USER CODE END sensor_t */
} sts_sensor_t;



void sts_weight_scale_init(void);
void sts_weight_scale(sts_sensor_t *sensor_data);
uint32_t KalmanFilter(uint32_t inData);
void HX711_Init(void);
void Init_HX711pin(void);
uint32_t HX711_Read(void);
void Get_GrossWeight(void);
void Get_NetWeight(void);

void delay_init(void);
void delay_ms(uint16_t nms);
void delay_us(uint32_t nus);




#endif /* YUNHORN_STS_WEIGHT_SCALE_H_ */