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.

65 lines
1.3 KiB

/*
* CFG.H
*
* Created on: 2024426
* 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_ */