⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rfoverrideoutputpower.c

📁 ti-Chipcon CC1010 1G以下Soc源码库。包括rf,powermodes,clockmodes,flashRW,interrupts,timer,pwm,uart...所有底层驱动源码
💻 C
字号:
/*****************************************************************************
 *                                                                           *
 *        **********                                                         *
 *       ************                                                        *
 *      ***        ***                                                       *
 *      ***   +++   ***                                                      *
 *      ***   + +   ***                                                      *
 *      ***   +                            CHIPCON CC1010                    *
 *      ***   + +   ***                 HAL - RFOverrideOutputPower          *
 *      ***   +++   ***                                                      *
 *      ***       ***                                                        *
 *       ***********                                                         *
 *        *********                                                          *
 *                                                                           *
 *****************************************************************************
 *                                                                           *
 *****************************************************************************
 * Author:              ROH                                                  *
 *****************************************************************************
 * Revision history:                                                         *
 *                                                                           *
 * $Log: RFOverrideOutputPower.c,v $
 * Revision 1.1  2002/10/14 13:04:34  tos
 * Initial version in CVS.
 *
 *                                                                           *
 ****************************************************************************/

#include <chipcon/hal.h>

// Variables that are used to override baudrate and PA output power
extern byte xdata   hal_dataformat_override, 
                    hal_baudrate_override, 
                    hal_pa_pow_override,
                    hal_modem0_original,
                    hal_pa_pow_original;

//----------------------------------------------------------------------------
//  halRFOverrideOutputPower(...)
//
//  Description:
//      Function used to override the dataformat specified by an RX/TX-pair.
//      If this function is called before halRFSetRxTxOff(...) it uses
//      the parameter passed to this function instead of whatever the
//      RX/TX-pair defines. If it is passed during an RF-operation, i.e. after
//      halRFSetRxTxOff(...) is called, the parameter passed is immediately
//      updated in hardware.
//
//  Arguments:
//      byte txPower
//          A value between 1 and 28 indicates desired power level -- 28 is
//          highest and 1 lowest. Some useful constants are defined below.
//          The override is turned off by passing 0 or RF_NO_OVERRIDE.
//
//  Return value:
//      void
//----------------------------------------------------------------------------
void halRFOverrideOutputPower(byte txPower) {

    // Adjust format of txPower
    if (txPower&0x0F) {      // > 15
        txPower=((txPower-16)<<4)+0x30;
        if (!txPower)
            txPower=0xFF;
    }
    
    if (hal_pa_pow_override=txPower)
        PA_POW=txPower;
    else
        PA_POW=hal_pa_pow_original;
}    

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -