int main(void) { try { // Configure the clock clock_configure(); // Initialise the Serial serial_init(&Serial, true); serial_input_handler(&input_manager_process); serial_println("Console initialised"); // Initialise the AD9833 and Pulse geneator. These can be controlled via the serial port ad9833_init(&Timer); serial_println("AD9833 initialised"); pulse_generator_init(&Pulse); serial_println("Pulse Generator initialised"); // Some tests // flash_light_test(); // pulse_test(); } catch(RuntimeException) { serial_println(E4C_EXCEPTION.message); } while (1); }
static void audio_init(void) { gpio_function_select(40, GPIO_ALT_0); gpio_function_select(45, GPIO_ALT_0); pause(2); clock_configure(CLOCK_OSCILLATOR, 2.0); pause(2); pwm_disable(); pwm_set_range(0x400, 0x400); pwm_enable(2); pause(2); }