Beispiel #1
0
void register_led_periph(void) {
	union memmap_fn mem_fn;

	mem_fn.R_fn32 = led_read;
	register_memmap("Simple LED", false, 4, mem_fn, REDLED, BLULED+4);
	mem_fn.W_fn32 = led_write;
	register_memmap("Simple LED", true, 4, mem_fn, REDLED, BLULED+4);

	register_periph_printer(print_leds_line);
}
Beispiel #2
0
void register_sam4l_pm_periph(void) {
	register_reset(sam4l_pm_reset);

	union memmap_fn mem_fn;

	mem_fn.R_fn32 = pm_read;
	register_memmap("SAM4L PM", false, 4, mem_fn, PM_BASE, PM_BASE+PM_SIZE);
	mem_fn.W_fn32 = pm_write;
	register_memmap("SAM4L PM", true, 4, mem_fn, PM_BASE, PM_BASE+PM_SIZE);

	register_periph_printer(print_pm);
}
Beispiel #3
0
void register_periph_m3_prc(void) {
	union memmap_fn mem_fn;

	/*
	mem_fn.R_fn32 = mbus_mmio_rd;
	register_memmap("M3 MBUS MMIO RD", false, 4, mem_fn, MBUS_MMIO_BOT, MBUS_MMIO_TOP+4);
	*/

	mem_fn.W_fn32 = mbus_mmio_wr;
	register_memmap("M3 MBUS MMIO WR", true, 4, mem_fn, MBUS_MMIO_ADDR, MBUS_MMIO_DATA+4);

	mem_fn.R_fn32 = cpu_conf_regs_rd;
	register_memmap("M3 CTL CONF RD", false, 4, mem_fn, MSG_REG0_RD, TSTAMP_REG_RD+4);

	mem_fn.W_fn32 = cpu_conf_regs_wr;
	register_memmap("M3 CTL CONF WR", true, 4, mem_fn, CHIP_ID_REG_WR, TSTAMP_REG_WR+4);

	mem_fn.W_fn32 = pmu_reset_wr;
	register_memmap("M3 CTL PMU RESET", true, 1, mem_fn, PMU_RST_REG_WR, PMU_RST_REG_WR+1);

	/*
	mem_fn.R_fn32 = gpio_read;
	register_memmap("M3 CTL GPIO RD", false, 4, mem_fn, GPIO_BOT, GPIO_TOP);
	mem_fn.W_fn32 = gpio_write;
	register_memmap("M3 CTL GPIO WR",  true, 4, mem_fn, GPIO_BOT, GPIO_TOP);
	*/

	register_periph_printer(print_m3_prc_line);

	/*
	{
		// Connect to ICE Hardware Board
		const char *host = "/tmp/m3_ice_com1";
		const uint16_t baud = 0; // use default baud

		ice = create_ice_instance(host, baud);
	}
	*/
}