예제 #1
0
void RFM70::begin() {

    initHardware();

    rfm70_SPI.begin();
    rfm70_SPI.setDataMode(SPI_MODE0);
    rfm70_SPI.setBitOrder(MSBFIRST);

    // Set the SPI frequency to be one sixteenth of the frequency of the system clock
    rfm70_SPI.setClockDivider(RFM77_DEFAULT_SPI_CLOCK_DIV);
    digitalWrite(_cs, LOW);
    delay(100);

    delayMs(RFM70_BEGIN_INIT_WAIT_MS);
    initRegisters();

    confAddrWidth(3);
    //max power
    configRfPower(3);
    //gain
    configLnaGain(1);
    //default mode is rx mode
    setMode(MODE_PRX);

}
예제 #2
0
void RFM70::begin() {

	initHardware();

	initSPI();

	delayMs(RFM70_BEGIN_INIT_WAIT_MS);
	initRegisters();
#if 0
	confAddrWidth(3);


	//max power
	configRfPower(3);
	//gain
	configLnaGain(1);
	//default mode is rx mode
	setMode(MODE_PRX);
#endif
}