
1. in tos_at.h, added int fuzzy_matching; field into at_echo_st struct, if this field is set to K_TRUE, then if echo message contains the string in "echo_expect" field. 2. added __API__ int tos_at_echo_fuzzy_matching_create(at_echo_t *echo, char *buffer, size_t buffer_size, char *echo_expect_contains) api to tos_at.c, which will create an at_echo_t with fuzzy_matching = K_TRUE; 3. added RHF76_ATCMD_SET_DELAY and rhf76_set_delay to RHF76.h to allow set/query RX delay config 4. added RHF76_ATCMD_SET_DATA_RATE and rhf76_set_data_rate to RHF76.h to allow set/query date rate config 5. added rhf76_at_cmd_exe for DEBUG purpose, so that user can execute any AT+ commands they want 6. added code in lora_demo.c to demonstrate package segmentation.
83 lines
2.5 KiB
C
83 lines
2.5 KiB
C
/**
|
|
******************************************************************************
|
|
* @file bsp.c
|
|
* @author jieranzhi
|
|
* @brief provide high level interfaces to manage the sensors on the
|
|
* application, this is a modified version of the official api
|
|
******************************************************************************
|
|
*/
|
|
|
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
|
#ifndef __BSP_H__
|
|
#define __BSP_H__
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
/* Includes ------------------------------------------------------------------*/
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
#include "HTS221.h"
|
|
#include "LPS22HB.h"
|
|
#include "LIS3MDL.h"
|
|
#include "LSM6DS3.h"
|
|
|
|
/* Exported types ------------------------------------------------------------*/
|
|
typedef struct
|
|
{
|
|
sensor_press_t sensor_press; /* pressure sensor */
|
|
sensor_tempnhumi_t sensor_tempnhumi; /* temperature and humidity */
|
|
sensor_magn_t sensor_magn; /* magnetometer */
|
|
sensor_motion_t sensor_motion; /* accelerometer, gyroscope */
|
|
} sensor_data_t;
|
|
|
|
// application configuration types
|
|
typedef enum{
|
|
DCT_IS_CONFIRM = 0x00U,
|
|
DCT_REPORT_PERIOD = 0x01U,
|
|
DCT_REPEAT_TIME = 0x02U,
|
|
DCT_MAGN_FULLSCALE = 0x03U,
|
|
DCT_ACCEL_FULLSCALE = 0x04U,
|
|
DCT_GYRO_FULLSCALE = 0x05U,
|
|
DCT_DEFAULT = 0xFFU,
|
|
}DeviceConfigType_TypeDef;
|
|
|
|
// application configuration
|
|
typedef struct
|
|
{
|
|
uint32_t config_address;
|
|
uint16_t report_period;
|
|
uint8_t repeat_time;
|
|
LIS3MDL_FullScaleTypeDef magn_fullscale;
|
|
LSM6DS3_AccelFullscaleTypeDef accel_fullscale;
|
|
LSM6DS3_GyroFullscaleTypeDef gyro_fullscale;
|
|
bool is_confirmed;
|
|
}DeviceConfig_TypeDef;
|
|
|
|
/* Exported constants --------------------------------------------------------*/
|
|
/* External variables --------------------------------------------------------*/
|
|
/* Exported macros -----------------------------------------------------------*/
|
|
/* Exported functions ------------------------------------------------------- */
|
|
/**
|
|
* @brief initialises the sensor
|
|
*
|
|
* @note
|
|
* @retval None
|
|
*/
|
|
void BSP_Sensor_Init(DeviceConfig_TypeDef config);
|
|
|
|
/**
|
|
* @brief sensor read.
|
|
*
|
|
* @note none
|
|
* @retval sensor_data
|
|
*/
|
|
void BSP_Sensor_Read(sensor_data_t *sensor_data);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* __BSP_H__ */
|
|
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|