V1.0
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
/*!
|
||||
* \file rf_2_4g.c
|
||||
*
|
||||
* \brief Target RF 2.4g implementation
|
||||
*
|
||||
* \copyright Revised BSD License, see section \ref LICENSE.
|
||||
*
|
||||
* \code
|
||||
*
|
||||
* _ __ _ ________ _
|
||||
* | |/ /(_)___ / ____/ /_ (_)___
|
||||
* | // / __ \/ / / __ \/ / __ \
|
||||
* / |/ / / / / /___/ / / / / /_/ /
|
||||
* /_/|_/_/_/ /_/\____/_/ /_/_/ .___/
|
||||
* /_/
|
||||
* (C) 2022-2025 XinChip
|
||||
*
|
||||
* \endcode
|
||||
*
|
||||
* \author ( XinChip ) Alex-J
|
||||
*
|
||||
* \author ( XinChip )
|
||||
*/
|
||||
|
||||
/*-----------------------------------------------------------------------------------
|
||||
INCLUDE HEADE FILES
|
||||
------------------------------------------------------------------------------------*/
|
||||
|
||||
#include "xc6xxx_rf_single.h"
|
||||
#include "xc6xxx.h"
|
||||
|
||||
/*------------------------------------------------------------------------------------
|
||||
Macros
|
||||
-------------------------------------------------------------------------------------*/
|
||||
#define RF_SINGLE 0x01
|
||||
/*------------------------------------------------------------------------------------
|
||||
Functions
|
||||
-------------------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* @brief RF single initialization
|
||||
* @param void
|
||||
*
|
||||
* @retval void
|
||||
*/
|
||||
void rf_single_init(void)
|
||||
{
|
||||
/* Rf modem init*/
|
||||
rf24g_modem_init();
|
||||
|
||||
/* Set up 2.4G RF modem*/
|
||||
rf24g_config();
|
||||
|
||||
/* Set modulation frequency offset to 0 */
|
||||
XC_RF_2_4G->TXPROC_CFG = 0x00;
|
||||
|
||||
/* Set to enter single carrier mode */
|
||||
set_rf_DR(XINCX_RF_TRANS_RATE | RF_SINGLE);
|
||||
/* Set configuration register */
|
||||
XC_RF_2_4G->CFG_TOP = 0x298272;
|
||||
/* Set transmission power */
|
||||
set_rf_power(XINCX_POWER);
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/*!
|
||||
* \file rf_2_4g.h
|
||||
*
|
||||
* \brief The head file of rf_2_4g.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 __XC6XXX_RF_SINGLE_H__
|
||||
#define __XC6XXX_RF_SINGLE_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*-----------------------------------------------------------------------------------
|
||||
INCLUDE HEADE FILES
|
||||
------------------------------------------------------------------------------------*/
|
||||
#include "xc6xxx.h"
|
||||
#include "xc6xxx_rf_2_4g.h"
|
||||
|
||||
/*------------------------------------------------------------------------------------
|
||||
Macros
|
||||
-------------------------------------------------------------------------------------*/
|
||||
|
||||
/*------------------------------------------------------------------------------------
|
||||
Exported Functions
|
||||
-------------------------------------------------------------------------------------*/
|
||||
void rf_single_init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __XC6XXX_RF_SINGLE_H__ */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user