/*************************************************************************** * Copyright (c) 2003-2006, Broadcom Corporation * All Rights Reserved * Confidential Property of Broadcom Corporation * * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. * * $brcm_Workfile: $ * $brcm_Revision: $ * $brcm_Date: $ * * Module Description: * * Revision History: * * $brcm_Log: $ * ***************************************************************************/ #ifndef BSETTOP_GPIO_H__ #define BSETTOP_GPIO_H__ #include "bsettop_types.h" typedef enum bgpio_interrupt_mode { eGPIO_Disabled, /* no interrupt */ eGPIO_RisingEdge, /* interrupt on 0->1 transition */ eGPIO_FallingEdge, /* interrupt on 1->0 transition */ eGPIO_Edge, /* interrupt both a 0->1 and a 1->0 transition */ eGPIO_Low, /* interrupt on a 0 value */ eGPIO_High, /* interrupt on a 1 value */ eGPIO_Int_Max } bgpio_interrupt_mode; typedef enum bgpio_mode { eGPIO_Input, eGPIO_OutputOpenDrain, eGPIO_OutputPushPull, eGPIO_Mode_Max } bgpio_mode; typedef enum bgpio_type { eGPIO_Standard, /* standard gpio pin */ eGPIO_Special, /* special gpio pin */ eGPIO_AStandard, /* AON gpio pin */ eGPIO_ASpecial, /* AON special gpio pin */ eGPIO_Type_Max } bgpio_type; typedef struct bgpio_settings { bgpio_type type; bgpio_mode mode; bgpio_interrupt_mode intMode; bsettop_callback user_callback; /* callback when interrupt is generated */ void *user_callback_context; } bgpio_settings; typedef struct bgpio *bgpio_t; #ifdef __cplusplus extern "C" { #endif void bgpio_init(void); bgpio_t bgpio_open( int gpio_num, /* - gpio number */ const bgpio_settings *p_settings ); void bgpio_close( bgpio_t gpio ); /* * For level trigger interrupt, application should call this function to get additional level triggered interrupt */ void bgpio_enable_int(bgpio_t gpio); #ifdef __cplusplus } #endif #endif /* BSETTOP_GPIO_H__ */