Add sun4i port io module header with some macros
[AROS.git] / arch / arm-sun4i / include / hardware / pio.h
blob93577e0bd9f7f1c7494936be91839b06be81cc7a
1 /*
2 Copyright © 2014, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: sun4i port io module
6 Lang: english
7 */
9 #ifndef HARDWARE_SUN4I_PIOH
10 #define HARDWARE_SUN4I_PIOH
12 #ifndef _INTTYPES_H
13 #include <inttypes.h>
14 #endif
16 #define SUN4i_PIO_BASE 0x01C20800
18 enum { PA = 0, PB, PC, PD, PE, PF, PG, PH, PI, PS };
20 #define PIO_CFG0_REG(n) *((volatile uint32_t *) ((uint32_t *) (SUN4i_PIO_BASE+(n*36+0))))
21 #define PIO_CFG1_REG(n) *((volatile uint32_t *) ((uint32_t *) (SUN4i_PIO_BASE+(n*36+4))))
22 #define PIO_CFG2_REG(n) *((volatile uint32_t *) ((uint32_t *) (SUN4i_PIO_BASE+(n*36+8))))
24 #define PIO_CFG3_REG(n) *((volatile uint32_t *) ((uint32_t *) (SUN4i_PIO_BASE+(n*36+12))))
25 #define PIO_DATA_REG(n) *((volatile uint32_t *) ((uint32_t *) (SUN4i_PIO_BASE+(n*36+16))))
26 #define PIO_DRV0_REG(n) *((volatile uint32_t *) ((uint32_t *) (SUN4i_PIO_BASE+(n*36+20))))
27 #define PIO_DRV1_REG(n) *((volatile uint32_t *) ((uint32_t *) (SUN4i_PIO_BASE+(n*36+24))))
28 #define PIO_PUL0_REG(n) *((volatile uint32_t *) ((uint32_t *) (SUN4i_PIO_BASE+(n*36+28))))
29 #define PIO_PUL1_REG(n) *((volatile uint32_t *) ((uint32_t *) (SUN4i_PIO_BASE+(n*36+32))))
31 #define PIO_INT_CFG0_REG *((volatile uint32_t *) ((uint32_t *) (SUN4i_PIO_BASE+(0x200))))
32 #define PIO_INT_CFG1_REG *((volatile uint32_t *) ((uint32_t *) (SUN4i_PIO_BASE+(0x204))))
33 #define PIO_INT_CFG2_REG *((volatile uint32_t *) ((uint32_t *) (SUN4i_PIO_BASE+(0x208))))
34 #define PIO_INT_CFG3_REG *((volatile uint32_t *) ((uint32_t *) (SUN4i_PIO_BASE+(0x20c))))
35 #define PIO_INT_CTL_REG *((volatile uint32_t *) ((uint32_t *) (SUN4i_PIO_BASE+(0x210))))
36 #define PIO_INT_STA_REG *((volatile uint32_t *) ((uint32_t *) (SUN4i_PIO_BASE+(0x214))))
37 #define PIO_INT_DEB_REG *((volatile uint32_t *) ((uint32_t *) (SUN4i_PIO_BASE+(0x218))))
39 #define SDR_PAD_DRV_REG *((volatile uint32_t *) ((uint32_t *) (SUN4i_PIO_BASE+(0x220))))
40 #define SDR_PAD_PIL_REG *((volatile uint32_t *) ((uint32_t *) (SUN4i_PIO_BASE+(0x224))))
42 #endif