// ----------------------------------------------------------------------------------------
//
//  s3c2410a/device/gpio.h
//    
//  Bob Cook Development, Robotics Library
//  http://www.bobcookdev.com/rl/
//    
//  This file provides port access routines for the Samsung S3C2410A processor.
//
//  Copyright (C) 2009 Bob Cook
//
//      This program is free software; you can redistribute it and/or modify it
//      under the terms of the GNU General Public License as published by the
//      Free Software Foundation; either version 2 of the License, or (at your
//      option) any later version.
//    
//      This program is distributed in the hope that it will be useful, but 
//      WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
//      or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
//      for more details.
//    
//      You should have received a copy of the GNU General Public License along
//      with this program; if not, write to the Free Software Foundation, Inc., 
//      51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
//
// ----------------------------------------------------------------------------------------


#if !defined( BCD_S3C2410A_DEVICE_GPIO_H )
#define BCD_S3C2410A_DEVICE_GPIO_H


#include <inttypes.h>


// ----------------------------------------------------------------------------------------

typedef enum 
{
    gpio_mode_input   = 0x00,   // standard input pin
    gpio_mode_output  = 0x01,   // standard output pin
    gpio_mode_special = 0x02    // special function for pin

}   gpio_mode_t;


// ----------------------------------------------------------------------------------------
//  gpio_configure_port?_pin
//
//      Configure the operation mode of the specified pin on the specified port.
//

void gpio_configure_portc_pin( uint8_t pin, gpio_mode_t mode );
void gpio_configure_portf_pin( uint8_t pin, gpio_mode_t mode );


// ----------------------------------------------------------------------------------------
//  gpio_set_port?_pin
//
//      Set (high voltage) the specified pin (bit) on the specified GPIO port.
//

void gpio_set_portc_pin( uint8_t pin );
void gpio_set_portf_pin( uint8_t pin );


// ----------------------------------------------------------------------------------------
//  gpio_clear_port?_pin
//
//      Clear (low voltage) the specified pin (bit) on the specified GPIO port.
//

void gpio_clear_portc_pin( uint8_t pin );
void gpio_clear_portf_pin( uint8_t pin );


#endif  // #if !defined( BCD_S3C2410A_DEVICE_GPIO_H )
// ----------------------------------------------------------------------------------------
//  end of gpio.h
// ----------------------------------------------------------------------------------------

