1
0
mirror of git://projects.qi-hardware.com/ben-blinkenlights.git synced 2024-11-19 09:18:05 +02:00
ben-blinkenlights/libubb/include/ubb/regbase.h

50 lines
1.6 KiB
C
Raw Normal View History

2012-12-17 05:44:48 +02:00
/*
* include/ubb/regbase.h - Jz4740 minimum register definitions for UBB
*
* Written 2011-2012 by Werner Almesberger
* Copyright 2011-2012 Werner Almesberger
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#ifndef UBB_REGBASE_H
#define UBB_REGBASE_H
#include <stdint.h>
#define UBB_SOC_BASE 0x10000000
#define UBB_REG_WINDOW 0x4000000
#define REG(n) (*(volatile uint32_t *) (ubb_mem+(n)))
#define REG_PADDR(r) ((unsigned long) ((void *) &(r)-ubb_mem+UBB_SOC_BASE))
extern volatile void *ubb_mem;
#define _GPIO(n) REG(0x0010000+(n))
#define PDPIN _GPIO(0x300) /* port D pin level */
#define PDDAT _GPIO(0x310) /* port D data set */
#define PDDATS _GPIO(0x314) /* port D data set */
#define PDDATC _GPIO(0x318) /* port D data clear */
#define PDPULL _GPIO(0x330) /* port D pull disable */
#define PDPULLS _GPIO(0x334) /* port D pull disable set */
#define PDPULLC _GPIO(0x338) /* port D pull disable clear */
#define PDFUN _GPIO(0x340) /* port D function */
#define PDFUNS _GPIO(0x344) /* port D function set */
#define PDFUNC _GPIO(0x348) /* port D function clear */
#define PDSEL _GPIO(0x350) /* port D select */
#define PDSELS _GPIO(0x354) /* port D select set */
#define PDSELC _GPIO(0x358) /* port D select clear */
#define PDDIR _GPIO(0x360) /* port D direction */
#define PDDIRS _GPIO(0x364) /* port D direction set */
#define PDDIRC _GPIO(0x368) /* port D direction clear */
#endif /* !UBB_REGBASE_H */