Exemple #1
0
void RFSendData(void)
{
	arrMOSI[0] = 0;
	RFReceive(1);
	arrMOSI[1] = ((arrMISO[1] | 0b00000010) & 0b11111110);
	RFSend(1);
  
	arrMOSI[0] = 0xA0;

	arrMOSI[1] = 0x06;
	arrMOSI[2] = 'S';
	arrMOSI[3] = 'U';
	arrMOSI[4] = 'C';
	arrMOSI[5] = 'K';
	arrMOSI[6] = perc;
	
	if (disp1 == ss_dp)
		arrMOSI[7] = disp2;
	else arrMOSI[7] = disp1;
  
	RFSend(7);
	PORTD |= (1<<nrfCE);      
	for (volatile uint8_t wait = 0; wait < 120; wait++) {}
	PORTD &= ~(1<<nrfCE);      
}
Exemple #2
0
void RFSetAddress(void) //To 0066996699
{
	arrMOSI[0] = 0x0A;
	arrMOSI[1] = 0x99;
	arrMOSI[2] = 0x66;
	arrMOSI[3] = 0x99;
	arrMOSI[4] = 0x66;
	arrMOSI[5] = 0x00;
	RFSend(5);
	arrMOSI[0] = 0x10;
	RFSend(5);
}
Exemple #3
0
void RFRetries(uint8_t number)
{
	number |= 0xF0;  //Retransmit delay 4000us
	arrMOSI[0] = 0x04;
	arrMOSI[1] = number;
	RFSend(1);
}
Exemple #4
0
void RFAutoACK(uint8_t enable)
{
	arrMOSI[0] = 0x01;
	if (enable > 0)
		arrMOSI[1] = 0x3F;
	else
		arrMOSI[1] = 0x00;
    
	RFSend(1);
}
void main(){
    SerialSetup();
    RFSend(array);
    while(1)
    {
        if (PORTAbits.RA4 == 0)
        {
            Clear_Rx_Buffer();
        }
    }
}
Exemple #6
0
void RFEnaDynPayloads(void)
{
	arrMOSI[0] = 0x1D;
	RFReceive(1);
	arrMOSI[1] = (arrMISO[1] | 0b00000100);
	RFSend(1);
	RFReceive(1);
	if (arrMISO[1] == 0)
	{
		arrMOSI[0] = 0x50;
		RFSend(0);
		arrMOSI[0] = 0x73; 
		RFSend(0);
		arrMOSI[0] = 0x1D;
		RFReceive(1);
		arrMOSI[1] = (arrMISO[1] | 0b00000100); 
		RFSend(1);
	}

	arrMOSI[0] = 0x1C;
	arrMOSI[1] = 0x3F;
	RFSend(1);
}
Exemple #7
0
void RFBegin(void)
{
	PORTD &= ~(1<<nrfCE); 
	PORTC |= (1<<nrfCSN);      
	_delay_ms(5);
 
	arrMOSI[0] = 0x04;
	arrMOSI[1] = 0b01011111;
	RFSend(1);
  
	arrMOSI[0] = 0x06;
	arrMOSI[1] = 0b00000111;
	RFSend(1);

	arrMOSI[0] = 0x00;
	RFReceive(1);
	arrMOSI[1] = (arrMISO[1] | 0b00001100);
	RFSend(1);

	arrMOSI[0] = 0x1C;
	arrMOSI[1] = 0b00000000;
	RFSend(1);

	arrMOSI[0] = 0x07;
	arrMOSI[1] = 0b01110000;
	RFSend(1);

	arrMOSI[0] = 0x05;
	arrMOSI[1] = 76;      //Channel 76 decimal
	RFSend(1);
   
	PORTC &= ~(1<<nrfCSN);      

	arrMOSI[0] = 0xE2;
	RFSend(0);

	arrMOSI[0] = 0xE1;
	RFSend(0);
  
	PORTC |= (1<<nrfCSN);      
}