Skip to content

Instantly share code, notes, and snippets.

@pamaury
Created September 16, 2015 11:13
Show Gist options
  • Save pamaury/bdb9a1ce0d44cbf8c7c0 to your computer and use it in GitHub Desktop.
Save pamaury/bdb9a1ce0d44cbf8c7c0 to your computer and use it in GitHub Desktop.
example usage
unsigned long value = HW_ICOLL_STATUS; /* read register */
unsigned long status = BR_ICOLL_STATUS(STATUS); /* read register and extract field */
BW_ICOLL_CLR(STATUS(status)); /* (clear interrupt) write register (CLR variant) */
unsigned long ctrl_addr = HW_ICOLL_CTRL_ADDR; /* get address */
/* write register (CLR variant) by ORing fields */
BW_ICOLL_CTRL_CLR(SFTRST(1), CLKGATE(1));
/* write register by ORing fields */
BW_ICOLL_CTRL(TZ_LOCK_V(LOCKED));
/* you can do any combination of the above, using indexes too */
BW_ICOLL_ENABLE(10, CPU0_TZ(1), CPU0_TYPE_V(FIQ), CPU0_PRIO(NMI), CPU1_PRIO(MASKED), CPU2_PRIO(MASKED), CPU3_PRIO(MASKED));
/* can even have several indices */
unsigned value = BR_CPU_GPIO_PORT_IN(10, 7, VALUE);
BW_CPU_GPIO_PORT_OE_SET(12, 3, ENABLE(0x5f), MASK(0x5f));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment