Esempio n. 1
0
void system_setup(void)
{
    clock_setup();
    mco_setup();
    usb_setup();
    systick_setup();
    rng_setup();
    battery_setup();

    speaker_setup();
    jack_setup();
    // setup pad and screen
    interface_setup();

    // setup and reset SAM2695
    sam2695_setup();
    wait_ms(100);
    sam2695_reset();

    usbmidi_setup();

    // init gfx and fill screen
    gfx_init(ssd1306_drawpixel, SSD1306_WIDTH, SSD1306_HEIGHT, GFX_FONT_SMALL);
    gfx_setRotation(GFX_ROT_180);
    gfx_fillScreen(OLED_BLACK);
    gfx_setTextColor(OLED_WHITE, OLED_BLACK);
//    gfx_setTextWrap(1);
    gfx_setTextSize(1);
    ssd1306_display();
}
Esempio n. 2
0
void radio_hangup()
{
	radio_cmd("at+chld=1\r\n", 10);
	radio_cmd("at+xctms=0\r\n", 10);
	audiohw_switch_normal_call(FALSE);
	speaker_setup();
}
Esempio n. 3
0
int radio_setup_2g()
{
	gpio_pin_output(RADIO_GPIO_BB_MUX_SEL, OFF);

	gpio_pulldown_configure(RADIO_BB_PULLDOWN, GPIOPDDown);

	gpio_pin_output(RADIO_GPIO_BB_ON, OFF);
	udelay(100000);
	gpio_pin_output(RADIO_GPIO_RADIO_ON, ON);
	udelay(100000);
	gpio_pin_output(RADIO_GPIO_BB_RESET, ON);
	udelay(100000);
	gpio_pin_output(RADIO_GPIO_BB_RESET, OFF);
	udelay(100000);

	gpio_pin_use_as_input(RADIO_GPIO_BB_DETECT);
	if(gpio_pin_state(RADIO_GPIO_BB_DETECT) != 0)
	{
		bufferPrintf("radio: comm board not present, powered on, or at+xdrv=10,2 had been issued.\r\n");
		return -1;
	}

	bufferPrintf("radio: comm board detected.\r\n");

    
	if(!radio_wait_for_ok(10))
	{
		bufferPrintf("radio: no response from baseband!\r\n");
		return -1;
	}
  

	bufferPrintf("radio: setting speed to 750000 baud.\r\n");

	radio_write("at+ipr=750000\r\n");

	// wait a millisecond for the command to totally clear uart
	// I wasn't able to detect this condition with uart registers (looking at FIFO count, transmitter empty)
	udelay(1000);

	uart_set_baud_rate(RADIO_UART, 750000);

	if(!radio_wait_for_ok(10))
	{
		bufferPrintf("radio: no response from baseband!\r\n");
		return -1;
	}

	RadioAvailable = TRUE;

	bufferPrintf("radio: ready.\r\n");

	speaker_setup();

	return 0;
}
Esempio n. 4
0
int radio_setup_3g()
{
	gpio_pulldown_configure(RADIO_BB_PULLDOWN, GPIOPDDown);

	pmu_gpio(RADIO_GPIO_BB_ON, TRUE, OFF);
	udelay(100000);
	gpio_pin_output(RADIO_GPIO_RADIO_ON, ON);
	udelay(100000);
	gpio_pin_output(RADIO_GPIO_BB_RESET, ON);
	udelay(100000);
	gpio_pin_output(RADIO_GPIO_BB_RESET, OFF);
	udelay(100000);

	gpio_pin_use_as_input(RADIO_GPIO_RESET_DETECT);
	if(gpio_pin_state(RADIO_GPIO_RESET_DETECT) != 1)
	{
		bufferPrintf("radio: comm board not present, powered on, or at+xdrv=10,2 had been issued.\r\n");
		return -1;
	}

	bufferPrintf("radio: comm board detected.\r\n");

	if(!radio_wait_for_ok(10))
	{
		bufferPrintf("radio: no response from baseband!\r\n");
		return -1;
	}

	RadioAvailable = TRUE;

	bufferPrintf("radio: ready.\r\n");

	speaker_setup();

	return 0;
}