source: svn/trunk/newcon3bcm2_21bu/dta/src/settop_api/bsettop_gpio.h

Last change on this file was 2, checked in by phkim, 11 years ago

1.phkim

  1. revision copy newcon3sk r27
  • Property svn:executable set to *
File size: 2.1 KB
Line 
1/***************************************************************************
2 *     Copyright (c) 2003-2006, Broadcom Corporation
3 *     All Rights Reserved
4 *     Confidential Property of Broadcom Corporation
5 *
6 *  THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE
7 *  AGREEMENT  BETWEEN THE USER AND BROADCOM.  YOU HAVE NO RIGHT TO USE OR
8 *  EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT.
9 *
10 * $brcm_Workfile:  $
11 * $brcm_Revision:  $
12 * $brcm_Date: $
13 *
14 * Module Description:
15 *
16 * Revision History:
17 *
18 * $brcm_Log:  $
19 *
20 ***************************************************************************/
21
22#ifndef BSETTOP_GPIO_H__
23#define BSETTOP_GPIO_H__
24
25#include "bsettop_types.h"
26
27typedef enum bgpio_interrupt_mode
28{
29        eGPIO_Disabled,       /* no interrupt */
30        eGPIO_RisingEdge,     /* interrupt on 0->1 transition */
31        eGPIO_FallingEdge,    /* interrupt on 1->0 transition */
32        eGPIO_Edge,           /* interrupt both a 0->1 and a 1->0 transition */
33        eGPIO_Low,            /* interrupt on a 0 value */
34        eGPIO_High,           /* interrupt on a 1 value */
35        eGPIO_Int_Max
36} bgpio_interrupt_mode;
37
38typedef enum bgpio_mode
39{
40        eGPIO_Input,
41        eGPIO_OutputOpenDrain,
42        eGPIO_OutputPushPull,
43        eGPIO_Mode_Max
44} bgpio_mode;
45
46typedef enum bgpio_type
47{
48        eGPIO_Standard,   /* standard gpio pin */
49        eGPIO_Special,    /* special gpio pin */
50        eGPIO_AStandard,  /* AON gpio pin */
51        eGPIO_ASpecial,   /* AON special gpio pin */
52        eGPIO_Type_Max
53} bgpio_type;
54
55typedef struct bgpio_settings {
56        bgpio_type type;
57        bgpio_mode mode;
58        bgpio_interrupt_mode intMode;
59
60        bsettop_callback user_callback;  /* callback when interrupt is generated */
61        void *user_callback_context;
62} bgpio_settings;
63
64
65typedef struct bgpio *bgpio_t;
66
67#ifdef __cplusplus
68extern "C"
69{
70#endif
71void bgpio_init(void);
72bgpio_t bgpio_open(
73                                        int gpio_num,   /* - gpio number */
74                                        const bgpio_settings *p_settings
75                                        );
76
77void bgpio_close(
78                                        bgpio_t gpio
79                                );
80
81/*
82 * For level trigger interrupt, application should call this function to get additional level triggered interrupt
83 */
84void bgpio_enable_int(bgpio_t gpio);
85
86#ifdef __cplusplus
87}
88#endif
89
90#endif /* BSETTOP_GPIO_H__ */
Note: See TracBrowser for help on using the repository browser.