You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.3 KiB
64 lines
1.3 KiB
/*
|
|
* CFG.H
|
|
*
|
|
* Created on: 2024年4月26日
|
|
* Author: tang
|
|
*/
|
|
|
|
#ifndef _CFG_H_
|
|
#define _CFG_H_
|
|
//#include "stdint.h"
|
|
#include "CH59x_common.h"
|
|
typedef struct
|
|
{
|
|
uint16_t preamble_len_tx; // tx前导码长度
|
|
uint16_t preamble_len_rx; // rx前导码长度
|
|
int8_t sf_tx; // tx扩频因子
|
|
int8_t sf_rx; // rx扩频因子
|
|
int8_t power; // 发射功率
|
|
int8_t bw_tx; // tx带宽
|
|
int8_t bw_rx; // rx带宽
|
|
uint32_t freq_tx; // tx频率
|
|
uint32_t freq_rx; // rx频率
|
|
uint32_t tx_timeout; //发送超时时间
|
|
uint32_t rx_timeout; //发送超时时间
|
|
bool is_public_network;
|
|
} lora_param_t;
|
|
|
|
typedef enum
|
|
{
|
|
UART_7_BIT = 0,
|
|
UART_8_BIT,
|
|
UART_9_BIT
|
|
} proto_data_bits_t;
|
|
typedef enum
|
|
{
|
|
UART_1_STOP_BIT = 0,
|
|
UART_2_STOP_BIT,
|
|
UART_0_5_STOP_BIT,
|
|
UART_1_5_STOP_BIT
|
|
} proto_stop_bits_t;
|
|
typedef enum
|
|
{
|
|
NO_PARITY = 0,
|
|
ODD_PARITY,
|
|
EVEN_PARITY
|
|
} proto_parity_t;
|
|
|
|
typedef struct
|
|
{
|
|
uint8_t debug_state;
|
|
uint32_t baud;
|
|
proto_data_bits_t data;//数据位
|
|
proto_stop_bits_t stop;
|
|
proto_parity_t parity;
|
|
} uart_param_t;
|
|
|
|
|
|
extern uart_param_t uart_param;
|
|
extern lora_param_t lora_param;
|
|
|
|
|
|
void config_get_from_flash(void);
|
|
void config_set_def(void);
|
|
#endif /* AT_CFG_H_ */
|
|
|