001package com.pi4j.io.gpio; 002 003/* 004 * #%L 005 * ********************************************************************** 006 * ORGANIZATION : Pi4J 007 * PROJECT : Pi4J :: Java Library (Core) 008 * FILENAME : GpioPin.java 009 * 010 * This file is part of the Pi4J project. More information about 011 * this project can be found here: http://www.pi4j.com/ 012 * ********************************************************************** 013 * %% 014 * Copyright (C) 2012 - 2013 Pi4J 015 * %% 016 * Licensed under the Apache License, Version 2.0 (the "License"); 017 * you may not use this file except in compliance with the License. 018 * You may obtain a copy of the License at 019 * 020 * http://www.apache.org/licenses/LICENSE-2.0 021 * 022 * Unless required by applicable law or agreed to in writing, software 023 * distributed under the License is distributed on an "AS IS" BASIS, 024 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 025 * See the License for the specific language governing permissions and 026 * limitations under the License. 027 * #L% 028 */ 029 030 031import java.util.Map; 032 033/** 034 * Gpio pin interface. This interface describes all operations over single GPIO pin. 035 * 036 * @author Robert Savage (<a 037 * href="http://www.savagehomeautomation.com">http://www.savagehomeautomation.com</a>) 038 */ 039public interface GpioPin { 040 041 GpioProvider getProvider(); 042 Pin getPin(); 043 044 void setName(String name); 045 String getName(); 046 047 void setTag(Object tag); 048 Object getTag(); 049 050 void setProperty(String key, String value); 051 boolean hasProperty(String key); 052 String getProperty(String key); 053 String getProperty(String key, String defaultValue); 054 Map<String,String> getProperties(); 055 void removeProperty(String key); 056 void clearProperties(); 057 058 void export(PinMode mode); 059 void unexport(); 060 boolean isExported(); 061 062 void setMode(PinMode mode); 063 PinMode getMode(); 064 boolean isMode(PinMode mode); 065 066 void setPullResistance(PinPullResistance resistance); 067 PinPullResistance getPullResistance(); 068 boolean isPullResistance(PinPullResistance resistance); 069 070 GpioPinShutdown getShutdownOptions(); 071 void setShutdownOptions(GpioPinShutdown options); 072 void setShutdownOptions(Boolean unexport); 073 void setShutdownOptions(Boolean unexport, PinState state); 074 void setShutdownOptions(Boolean unexport, PinState state, PinPullResistance resistance); 075 void setShutdownOptions(Boolean unexport, PinState state, PinPullResistance resistance, PinMode mode); 076}