xref: /openbmc/phosphor-hwmon/gpio_handle.hpp (revision 94539af60991235bc921c848ab1aba47485265b3)
1b28f432aSPatrick Venture #pragma once
2b28f432aSPatrick Venture 
3b28f432aSPatrick Venture #include <gpioplus/handle.hpp>
4e8771fd4SPatrick Williams 
5b28f432aSPatrick Venture #include <memory>
6b28f432aSPatrick Venture #include <string>
7b28f432aSPatrick Venture 
8b28f432aSPatrick Venture namespace gpio
9b28f432aSPatrick Venture {
10b28f432aSPatrick Venture 
11b28f432aSPatrick Venture /**
12b28f432aSPatrick Venture  * Method called to validate inputs and create a GpioHandle.
13b28f432aSPatrick Venture  *
14b28f432aSPatrick Venture  * @param[in] gpiochip - gpiochip id as string, e.g. "0", or "1"
15b28f432aSPatrick Venture  * @param[in] line - gpio line offset as string.
16e3e0f97dSPatrick Venture  * @return A gpioplus::HandleInterface on success nullptr on failure.
17b28f432aSPatrick Venture  */
18*94539af6SPatrick Williams std::unique_ptr<gpioplus::HandleInterface> BuildGpioHandle(
19*94539af6SPatrick Williams     const std::string& gpiochip, const std::string& line);
20b28f432aSPatrick Venture 
21b28f432aSPatrick Venture } // namespace gpio
22