1 /* $NetBSD: bcm2835_gpioreg.h,v 1.2 2013/04/14 15:11:52 skrll Exp $ */ 2 3 /* 4 * Copyright (c) 2013 Jonathan A. Kollasch 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 1. Redistributions of source code must retain the above copyright 11 * notice, this list of conditions and the following disclaimer. 12 * 2. Redistributions in binary form must reproduce the above copyright 13 * notice, this list of conditions and the following disclaimer in the 14 * documentation and/or other materials provided with the distribution. 15 * 16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 20 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29 #ifndef _BROADCOM_BCM2835_GPIOREG_H_ 30 #define _BROADCOM_BCM2835_GPIOREG_H_ 31 32 #define BCM2835_GPIO_GPFSEL(x) (0x000 + (x) * sizeof(uint32_t)) 33 #define BCM2835_GPIO_GPFSEL_PINS_PER_REGISTER 10 34 #define BCM2835_GPIO_GPFSEL_BITS_PER_PIN 3 35 36 #define BCM2835_GPIO_IN 00 37 #define BCM2835_GPIO_OUT 01 38 #define BCM2835_GPIO_ALT5 02 39 #define BCM2835_GPIO_ALT4 03 40 #define BCM2835_GPIO_ALT0 04 41 #define BCM2835_GPIO_ALT1 05 42 #define BCM2835_GPIO_ALT2 06 43 #define BCM2835_GPIO_ALT3 07 44 45 #endif /* _BROADCOM_BCM2835_GPIOREG_H_ */ 46