gpio.h File Reference

#include <types.h>
#include <broadway.h>

Go to the source code of this file.

Enumerations

enum  gpio_pin_t {
  GPIO_POWER = (1 << 0), GPIO_SHUTDOWN = (1 << 1), GPIO_FAN_SPEED = (1 << 2), GPIO_DC_DC = (1 << 3),
  GPIO_DI_SPIN = (1 << 4), GPIO_SLOT_LED = (1 << 5), GPIO_EJECT = (1 << 6), GPIO_SLOT_IN = (1 << 7),
  GPIO_SENSOR_BAR = (1 << 8), GPIO_DI_EJECT = (1 << 9), GPIO_EEP_CS = (1 << 10), GPIO_EEP_CLK = (1 << 11),
  GPIO_EEP_MOSI = (1 << 12), GPIO_EEP_MISO = (1 << 13), GPIO_AVE_CLK = (1 << 14), GPIO_AVE_DATA = (1 << 15),
  GPIO_DEBUG0 = (1 << 16), GPIO_DEBUG1 = (1 << 17), GPIO_DEBUG2 = (1 << 18), GPIO_DEBUG3 = (1 << 19),
  GPIO_DEBUG4 = (1 << 20), GPIO_DEBUG5 = (1 << 21), GPIO_DEBUG6 = (1 << 22), GPIO_DEBUG7 = (1 << 23)
}

Functions

int gpio_initialize (void)
 Initialize the GPIO subsystem.
int gpio_shutdown (void)
 Shut down the GPIO subsystem.
gpio_pin_t gpio_read (void)
 Reads GPIO data.
void gpio_write (gpio_pin_t gpios)
 Writes GPIO output data.
void gpio_set (gpio_pin_t gpios)
 Sets GPIO output data bits.
void gpio_clear (gpio_pin_t gpios)
 Clears GPIO output data bits.
void gpio_mask (gpio_pin_t setgpios, gpio_pin_t clrgpios)
 Masks GPIO output data bits.
void gpio_switch (gpio_pin_t gpios)
 Switches GPIO output data bits.
int gpio_direction (gpio_pin_t pin, int dir)
 Sets GPIO direction.

Detailed Description

General Purpose I/O control


Enumeration Type Documentation

enum gpio_pin_t
Enumerator:
GPIO_POWER 

Power button

GPIO_SHUTDOWN 

Shuts down system

GPIO_FAN_SPEED 

Set fan high or low

GPIO_DC_DC 

DC/DC converter power (powers Broadway?). When off, yellow power LED

GPIO_DI_SPIN 

DI spinup disable.

GPIO_SLOT_LED 

Blue disc slot LED

GPIO_EJECT 

Eject button

GPIO_SLOT_IN 

Slot-in button

GPIO_SENSOR_BAR 

Sensor bar power

GPIO_DI_EJECT 

Trigger DI eject

GPIO_EEP_CS 

SEEPROM chip select

GPIO_EEP_CLK 

SEEPROM clock

GPIO_EEP_MOSI 

Data to SEEPROM

GPIO_EEP_MISO 

Data from SEEPROM

GPIO_AVE_CLK 

A/V Encoder I2C clock

GPIO_AVE_DATA 

A/V Encoder I2C data

GPIO_DEBUG0 

Debug Testpoint TP221

GPIO_DEBUG1 

Debug Testpoint TP222

GPIO_DEBUG2 

Debug Testpoint TP223

GPIO_DEBUG3 

Debug Testpoint TP224

GPIO_DEBUG4 

Debug Testpoint TP225

GPIO_DEBUG5 

Debug Testpoint TP226

GPIO_DEBUG6 

Debug Testpoint TP219

GPIO_DEBUG7 

Debug Testpoint TP220


Function Documentation

void gpio_clear ( gpio_pin_t  gpios  ) 

Clears GPIO output data bits.

Parameters:
gpios The GPIO states to clear.
int gpio_direction ( gpio_pin_t  pin,
int  dir 
)

Sets GPIO direction.

Parameters:
dir the new GPIO direction. -1 is input, 1 is output, 0 is no change.
Returns:
The old GPIO direction.
int gpio_initialize ( void   ) 

Initialize the GPIO subsystem.

Initializes the GPIO subsystem, registers the handler for the GPIO interrupt and performs all other required initialization tasks.

Returns:
If initialization was successful, returns 1. Otherwise 0.
See also:
gpio_shutdown()
void gpio_mask ( gpio_pin_t  setgpios,
gpio_pin_t  clrgpios 
)

Masks GPIO output data bits.

Parameters:
setgpios The GPIO states to set.
clrgpios The GPIO states to clear.
gpio_pin_t gpio_read ( void   ) 

Reads GPIO data.

Reads data from the GPIOs.

Returns:
The GPIO state.
void gpio_set ( gpio_pin_t  gpios  ) 

Sets GPIO output data bits.

Parameters:
gpios The GPIO states to set.
int gpio_shutdown ( void   ) 

Shut down the GPIO subsystem.

Shuts down the GPIO subsystem, unregisters the handler for the GPIO interrupt and performs all other required shut down tasks.

Returns:
If shut down was successful, returns 1. Otherwise 0.
See also:
gpio_initialize()
void gpio_switch ( gpio_pin_t  gpios  ) 

Switches GPIO output data bits.

Parameters:
gpios The GPIO states to switch.
void gpio_write ( gpio_pin_t  gpios  ) 

Writes GPIO output data.

Parameters:
gpios The GPIO state to output.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines
Generated by  doxygen 1.6.3