Esempio n. 1
0
int main(void)
{
	const uint32_t freq = 2441000000U;

	pin_setup();
	gpio_set(PORT_EN1V8, PIN_EN1V8); /* 1V8 on */
	cpu_clock_init();
	ssp1_init();

	gpio_set(PORT_LED1_3, (PIN_LED1)); /* LED1 on */

	ssp1_set_mode_max2837();
	max2837_setup();
	rffc5071_setup();
	gpio_set(PORT_LED1_3, (PIN_LED2)); /* LED2 on */

	max2837_set_frequency(freq);
	max2837_start();
	max2837_tx();
	gpio_set(PORT_LED1_3, (PIN_LED3)); /* LED3 on */
	while (1);
	max2837_stop();

	return 0;
}
Esempio n. 2
0
void rf_path_init(void) {
	ssp1_set_mode_max5864();
	max5864_shutdown();
	
	ssp1_set_mode_max2837();
	max2837_setup();
	max2837_start();
	
	rffc5071_setup();
	switchctrl_set(switchctrl);
}
Esempio n. 3
0
void rf_path_init(rf_path_t* const rf_path) {
	ssp1_set_mode_max5864();
	max5864_setup(&max5864);
	max5864_shutdown(&max5864);
	
	ssp1_set_mode_max2837();
	max2837_setup(&max2837);
	max2837_start(&max2837);
	
	rffc5071_setup(&rffc5072);
	switchctrl_set(rf_path, switchctrl);
}
Esempio n. 4
0
void set_transceiver_mode(const transceiver_mode_t new_transceiver_mode) {
	baseband_streaming_disable();
	
	transceiver_mode = new_transceiver_mode;
	
	usb_init_buffers_bulk();

	if( transceiver_mode == TRANSCEIVER_MODE_RX ) {
		gpio_clear(PORT_LED1_3, PIN_LED3);
		gpio_set(PORT_LED1_3, PIN_LED2);
		usb_endpoint_init(&usb_endpoint_bulk_in);

		rffc5071_rx(switchctrl);
		//rffc5071_set_frequency(1700, 0); // 2600 MHz IF - 1700 MHz LO = 900 MHz RF
		max2837_start();
		max2837_rx();
	} else if (transceiver_mode == TRANSCEIVER_MODE_TX) {
		gpio_clear(PORT_LED1_3, PIN_LED2);
		gpio_set(PORT_LED1_3, PIN_LED3);
		usb_endpoint_init(&usb_endpoint_bulk_out);

		rffc5071_tx(switchctrl);
		//rffc5071_set_frequency(1700, 0); // 2600 MHz IF - 1700 MHz LO = 900 MHz RF
		max2837_start();
		max2837_tx();
	} else {
		gpio_clear(PORT_LED1_3, PIN_LED2);
		gpio_clear(PORT_LED1_3, PIN_LED3);
		max2837_stop();
		return;
	}

	sgpio_configure(transceiver_mode, true);

	nvic_set_priority(NVIC_SGPIO_IRQ, 0);
	nvic_enable_irq(NVIC_SGPIO_IRQ);
	SGPIO_SET_EN_1 = (1 << SGPIO_SLICE_A);

    sgpio_cpld_stream_enable();
}