
www.ti.com
Software Overview
5.5.1
program_TRF4903_word()
This function configures one of the five registers of the TRF4903 transceiver. Here is a sample code on
how to use this function so that you can program all five registers:
struct REGA_BITS{
unsigned long BND:2;
//1-0 Band of operation
unsigned long CP_Acc:2;
//3-2
speed up time for the CP
unsigned long reserved0:1
unsigned long TX:1;
//5
unsigned long PA0:2;
//7-6
unsigned long B_DIV_M0:9; //16-8
Mode 0 = Transmit
unsigned long A_DIV_M0:5; //21-17
unsigned long ADDR:2;
//23-22
};
union TRF_REGA{
unsigned long all;
struct REGA_BITS bit;
};
struct TRF_REG{
union TRF_REGA a;
union TRF_REGB b;
union TRF_REGC c;
union TRF_REGD d;
union TRF_REGE e;
};
void configure_trf4903(void)
{
int pointer;
P4OUT&=0xfe;
pointer=(int)f_sel;
trf4903.a.bit.B_DIV_M0=MAIN_B_T[pointer];
trf4903.a.bit.A_DIV_M0=MAIN_A_T[pointer];
program_TRF4903_word(trf4903.a.all);
trf4903.b.bit.B_DIV_M1=MAIN_B_R[pointer];
trf4903.b.bit.A_DIV_M1=MAIN_A_R[pointer];
program_TRF4903_word(trf4903.b.all);
program_TRF4903_word(trf4903.c.all);
trf4903.d.bit.XTAL_Tune = XTAL_OFFSET;
program_TRF4903_word(trf4903.d.all);
program_TRF4903_word(trf4903.e.all);
5.5.2
send_RF(unsigned int, unsigned int*)
This function is used to transmit a packet of wireless data stream. Here is an example of how it is used:
union RF_XMIT_PACKET{
unsigned int w[MAXWORD];
unsigned char b[MAXBYTE];
}xmit;
void SendRFWithModeSelect(unsigned int ByteCnt)
{
switch(trf4903.e.bit.TXM){
case 0:
send_RF(ByteCnt,xmit.w);
break;
case 1:
trf4903.e.bit.MUX = 1; //set to DCLK mode
program_TRF4903_word(trf4903.e.all);
send_RF_DCLK(ByteCnt,xmit.w);
break;
}
}
TRF4903 With MSP430 Demonstration and Development Evaluation Kit
SWRU010A – October 2004 – Revised May 2005
19