How to talk with milkymist cores

From Milkymist Wiki

Revision as of 02:42, 28 October 2011 by Kristianpaul (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Basically Memory-mapped I/O http://wikimedia.org/wikipedia/en/wiki/MMIO

Some sniptes

/* PLEASE notice the use of volatile */

volatile unsigned int *my_peripheral;

/* peripheral memory mapped at 0xc0001004 */

my_peripheral = (unsigned int *)0xc0001004;

/* write word to peripheral */

  • my_peripheral = 0xbaadf00d;

/* read word from peripheral */

printf("Result: %08x\n", *my_peripheral);


also


  1. define MM_READ(reg) (*((volatile unsigned int *)(reg)))
  2. define MM_WRITE(reg, val) *((volatile unsigned int *)(reg)) = val
Personal tools