2 * Copyright 2005, Broadcom Corporation
5 * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Broadcom Corporation;
6 * the contents of this file may not be disclosed to third parties, copied
7 * or duplicated in any form, in whole or in part, without the prior
8 * written permission of Broadcom Corporation.
10 * Header file for GPIO utility functions.
12 * $Id: bcmgpio.h,v 1.1.1.2 2005/03/07 07:31:19 kanki Exp $
20 #define BCMGPIO_MAXPINS 32
21 #define BCMGPIO_MAXINDEX (BCMGPIO_MAXPINS - 1)
24 typedef enum bcmgpio_dirn
{
29 /* GPIO strobe information */
30 typedef struct bcmgpio_strobe
{
31 int duty_percent
; /* duty cycle of strobe in percent of strobe period */
32 bcm_timer_module_id timer_module
; /* timer module ID obtained by calling bcm_timer_module_init() */
33 unsigned long strobe_period_in_ms
; /* strobe period of the GPIO in milliseconds */
34 unsigned long num_strobes
; /* total number of strobes */
35 int *strobe_done
; /* pointer to memory which is used to signal strobe completion */
38 /* Functions to implement Buttons and LEDs on the AP, using GPIOs */
39 int bcmgpio_connect (int gpio_pin
, bcmgpio_dirn_t gpio_dirn
);
40 int bcmgpio_disconnect (int gpio_pin
);
41 int bcmgpio_in (unsigned long gpio_mask
, unsigned long *value
);
42 int bcmgpio_out (unsigned long gpio_mask
, unsigned long value
);
43 int bcmgpio_strobe_start (int gpio_pin
, bcmgpio_strobe_t
*strobe_info
);
44 int bcmgpio_strobe_stop (int gpio_pin
);
48 #endif /* __bcmgpio_h__ */