Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:24:00

0001 /* SPDX-License-Identifier: BSD-2-Clause */
0002 
0003 /*
0004  *
0005  * Copyright (C) 2024 Kevin Kirspel
0006  *
0007  * Redistribution and use in source and binary forms, with or without
0008  * modification, are permitted provided that the following conditions
0009  * are met:
0010  * 1. Redistributions of source code must retain the above copyright
0011  *    notice, this list of conditions and the following disclaimer.
0012  * 2. Redistributions in binary form must reproduce the above copyright
0013  *    notice, this list of conditions and the following disclaimer in the
0014  *    documentation and/or other materials provided with the distribution.
0015  *
0016  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
0017  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0018  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0019  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
0020  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
0021  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
0022  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
0023  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
0024  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
0025  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
0026  * SUCH DAMAGE.
0027  */
0028 
0029 #ifndef _ALTERA_AVALON_PIO_REGS_H
0030 #define _ALTERA_AVALON_PIO_REGS_H
0031 
0032 #include <bsp_system.h>
0033 
0034 #define ALTERA_AVALON_PIO_DIRECTION_INPUT  0
0035 #define ALTERA_AVALON_PIO_DIRECTION_OUTPUT 1
0036 
0037 #ifdef __cplusplus
0038 extern "C" {
0039 #endif
0040 
0041 typedef struct
0042 {
0043   volatile uint32_t data;
0044   volatile uint32_t direction;
0045   volatile uint32_t interruptmask;
0046   volatile uint32_t edgecapture;
0047   volatile uint32_t outset;
0048   volatile uint32_t outclear;
0049 }altera_avalon_pio_regs;
0050 
0051 #define LED_PIO_REGS (( volatile altera_avalon_pio_regs* )LED_PIO_BASE )
0052 #define USER_DIPSW_REGS (( volatile altera_avalon_pio_regs* )USER_DIPSW_BASE )
0053 #define USER_PB_REGS (( volatile altera_avalon_pio_regs* )USER_PB_BASE )
0054 
0055 #ifdef __cplusplus
0056 }
0057 #endif
0058 
0059 #endif