Files
433_STM32/Driver_RF433/Inc/rf433_config.h

134 lines
3.0 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
******************************************************************************
* @file rf433_config.h
* @brief RF433模块配置文件
******************************************************************************
*/
#ifndef __RF433_CONFIG_H__
#define __RF433_CONFIG_H__
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================
* 编译模式选择
* ============================================================================ */
/**
* @brief 编译模式选择
* @note 必须在包含此头文件之前定义
* RF433_MODE_TX - 仅编译TX功能
* RF433_MODE_RX - 仅编译RX功能
* RF433_MODE_BOTH - 编译TX和RX功能默认
*/
#define RF433_MODE_TX 1
#define RF433_MODE_RX 2
#define RF433_MODE_BOTH 3
#ifndef RF433_MODE
#define RF433_MODE RF433_MODE_RX
#endif
/* ============================================================================
* 默认配置参数
* ============================================================================ */
/**
* @brief 默认工作模式(运行时选择)
* @note 1: TX模式
* 2: RX模式
* 3: 双模模式
*/
#ifndef RF433_DEFAULT_WORK_MODE
#define RF433_DEFAULT_WORK_MODE RF433_MODE_TX
#endif
/**
* @brief 默认发送间隔ms
*/
#ifndef RF433_DEFAULT_TX_INTERVAL
#define RF433_DEFAULT_TX_INTERVAL 1000
#endif
/**
* @brief 默认发送次数
*/
#ifndef RF433_DEFAULT_TX_COUNT
#define RF433_DEFAULT_TX_COUNT 10
#endif
/* ============================================================================
* 缓冲区大小配置
* ============================================================================ */
/**
* @brief FIFO缓冲区大小
*/
#ifndef RF433_FIFO_SIZE
#define RF433_FIFO_SIZE 1024
#endif
/**
* @brief 最大数据包长度
*/
#ifndef RF433_MAX_PACKET_SIZE
#define RF433_MAX_PACKET_SIZE 237
#endif
/**
* @brief 默认超时时间ms
*/
#ifndef RF433_DEFAULT_TIMEOUT
#define RF433_DEFAULT_TIMEOUT 100
#endif
/* ============================================================================
* 硬件配置
* ============================================================================ */
/**
* @brief 是否使用AUX引脚检测忙状态
* @note 1: 使用AUX引脚推荐
* 0: 使用延时(不推荐)
*/
#ifndef RF433_USE_GPIO_AUX
#define RF433_USE_GPIO_AUX 1
#endif
/**
* @brief AUX引脚忙等待超时时间ms
*/
#ifndef RF433_AUX_TIMEOUT
#define RF433_AUX_TIMEOUT 100
#endif
/* ============================================================================
* 调试配置
* ============================================================================ */
/**
* @brief 是否启用调试输出
*/
#ifndef RF433_DEBUG_ENABLE
#define RF433_DEBUG_ENABLE 0
#endif
/**
* @brief 调试输出函数
*/
#if RF433_DEBUG_ENABLE
#ifndef RF433_DEBUG_PRINTF
#define RF433_DEBUG_PRINTF(fmt, ...) printf("[RF433] " fmt "\r\n", ##__VA_ARGS__)
#endif
#else
#define RF433_DEBUG_PRINTF(fmt, ...)
#endif
#ifdef __cplusplus
}
#endif
#endif /* __RF433_CONFIG_H__ */