Stair56E UART project
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* @Descripttion:
|
||||
* @version:
|
||||
* @Author: sueRimn
|
||||
* @Date: 2023-12-21 10:56:45
|
||||
* @LastEditors: sueRimn
|
||||
* @LastEditTime: 2023-12-29 19:42:40
|
||||
*/
|
||||
#ifndef __APP_RF24G_EVENT_H__
|
||||
#define __APP_RF24G_EVENT_H__
|
||||
#include "xc6xxx_rf_ADV.h"
|
||||
|
||||
|
||||
|
||||
#define ADV_LENGTH XINCX_ADV_PIPE0_LEN
|
||||
|
||||
#define XC_RF_SEND_TIMER TIMER0_IDX
|
||||
|
||||
#define XC_SEND_NUM 1000U
|
||||
#define SEND_TIMERMS_CNT 10U
|
||||
#define RF_CONFIRMED_VALUE 5U
|
||||
|
||||
|
||||
|
||||
#ifdef RF_ADV_INTER
|
||||
extern uint8_t recv_adv_buf[XINCX_ADV_PIPE0_LEN];
|
||||
#endif
|
||||
|
||||
extern uint32_t tx_cnt, rx_cnt;
|
||||
|
||||
#define RF_ADV_BASE 2400U
|
||||
#define RF_ADV_CHANNEL_37 2
|
||||
#define RF_ADV_CHANNEL_38 26
|
||||
#define RF_ADV_CHANNEL_39 80
|
||||
|
||||
void timer_init(uint8_t timer_id, uint32_t timer_cnt);
|
||||
uint8_t rf_data_config(uint8_t *buff, uint8_t len);
|
||||
uint32_t rf_ack_tx_manage(uint8_t *buff);
|
||||
uint32_t rf_ack_rx_manage(uint8_t *buff);
|
||||
uint8_t rf_adv_packet(uint8_t *buff);
|
||||
void rf_adv_tx_evevt(void);
|
||||
void rf_adv_rx_evevt(void);
|
||||
|
||||
|
||||
//extern rf_data_typedef_t rf_data;
|
||||
|
||||
#endif //__APP_RF24G_EVENT_H__
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* @Descripttion:
|
||||
* @version:
|
||||
* @Author: sueRimn
|
||||
* @Date: 2023-12-12 14:23:55
|
||||
* @LastEditors: sueRimn
|
||||
* @LastEditTime: 2024-06-07 13:46:09
|
||||
*/
|
||||
/*!
|
||||
* \file main.h
|
||||
*
|
||||
* \brief The head file of main.c
|
||||
*
|
||||
* \copyright Revised BSD License, see section \ref LICENSE.
|
||||
*
|
||||
* \code
|
||||
*
|
||||
* _ __ _ ________ _
|
||||
* | |/ /(_)___ / ____/ /_ (_)___
|
||||
* | // / __ \/ / / __ \/ / __ \
|
||||
* / |/ / / / / /___/ / / / / /_/ /
|
||||
* /_/|_/_/_/ /_/\____/_/ /_/_/ .___/
|
||||
* /_/
|
||||
* (C) 2022-2025 XinChip
|
||||
*
|
||||
* \endcode
|
||||
*
|
||||
* \author ( XinChip ) Alex-J
|
||||
*
|
||||
* \author ( XinChip )
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __MAIN_H__
|
||||
#define __MAIN_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/*-----------------------------------------------------------------------------------
|
||||
INCLUDE HEADE FILES
|
||||
------------------------------------------------------------------------------------*/
|
||||
#include "rf_config.h"
|
||||
#include "xc6xxx.h"
|
||||
#include "xc6xxx_rf_2_4g.h"
|
||||
|
||||
/*------------------------------------------------------------------------------------
|
||||
Macros
|
||||
-------------------------------------------------------------------------------------*/
|
||||
#define DEBUG_LOG
|
||||
|
||||
#define RECV_TIMERMS_OUT 1000
|
||||
//#define SEND_TIMERMS_CNT 30
|
||||
#define XC_SEND_NUM 1000U
|
||||
|
||||
#define RF_TX_TIMERx TIMER0_IDX
|
||||
#define RF_RX_TIMERx TIMER0_IDX
|
||||
|
||||
//#define RF_CONFIRMED_VALUE 5
|
||||
|
||||
/*------------------------------------------------------------------------------------
|
||||
TypeDef
|
||||
-------------------------------------------------------------------------------------*/
|
||||
|
||||
/*------------------------------------------------------------------------------------
|
||||
Global Variables
|
||||
-------------------------------------------------------------------------------------*/
|
||||
|
||||
extern uint16_t recv_len;
|
||||
extern uint8_t recv_buf[256];
|
||||
extern bool rf_send_timer_flag;
|
||||
extern bool rf24g_handler_flag;
|
||||
/*------------------------------------------------------------------------------------
|
||||
Exported Functions
|
||||
-------------------------------------------------------------------------------------*/
|
||||
|
||||
uint32_t rf_tx_manage(uint8_t *buff);
|
||||
uint32_t rf_rx_manage(uint8_t *buff);
|
||||
void rf_buff_info(uint8_t *buff, uint8_t len);
|
||||
void rf_2M_reg_info(void);
|
||||
void rf_dump_log(void);
|
||||
uint8_t rf_data_config(uint8_t *buff, uint8_t len);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __MAIN_H__ */
|
||||
Reference in New Issue
Block a user