OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [LINUX_2_4_26_OR32/] [linux/] [linux-2.4/] [include/] [asm-sh/] [hd64465_gpio.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1275 phoenix
#ifndef _ASM_SH_HD64465_GPIO_
2
#define _ASM_SH_HD64465_GPIO_ 1
3
/*
4
 * $Id: hd64465_gpio.h,v 1.1.1.1 2004-04-15 02:37:31 phoenix Exp $
5
 *
6
 * Hitachi HD64465 companion chip: General Purpose IO pins support.
7
 * This layer enables other device drivers to configure GPIO
8
 * pins, get and set their values, and register an interrupt
9
 * routine for when input pins change in hardware.
10
 *
11
 * by Greg Banks <gbanks@pocketpenguins.com>
12
 * (c) 2000 PocketPenguins Inc.
13
 */
14
#include <asm/hd64465.h>
15
 
16
/* Macro to construct a portpin number (used in all
17
 * subsequent functions) from a port letter and a pin
18
 * number, e.g. HD64465_GPIO_PORTPIN('A', 5).
19
 */
20
#define HD64465_GPIO_PORTPIN(port,pin)  (((port)-'A')<<3|(pin))
21
 
22
/* Pin configuration constants for _configure() */
23
#define HD64465_GPIO_FUNCTION2  0        /* use the pin's *other* function */
24
#define HD64465_GPIO_OUT        1       /* output */
25
#define HD64465_GPIO_IN_PULLUP  2       /* input, pull-up MOS on */
26
#define HD64465_GPIO_IN         3       /* input */
27
 
28
/* Configure a pin's direction */
29
extern void hd64465_gpio_configure(int portpin, int direction);
30
 
31
/* Get, set value */
32
extern void hd64465_gpio_set_pin(int portpin, unsigned int value);
33
extern unsigned int hd64465_gpio_get_pin(int portpin);
34
extern void hd64465_gpio_set_port(int port, unsigned int value);
35
extern unsigned int hd64465_gpio_get_port(int port);
36
 
37
/* mode constants for _register_irq() */
38
#define HD64465_GPIO_FALLING    0
39
#define HD64465_GPIO_RISING     1
40
 
41
/* Interrupt on external value change */
42
extern void hd64465_gpio_register_irq(int portpin, int mode,
43
        void (*handler)(int portpin, void *dev), void *dev);
44
extern void hd64465_gpio_unregister_irq(int portpin);
45
 
46
#endif /* _ASM_SH_HD64465_GPIO_  */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.