2012-07-16 13:13:35 +00:00
|
|
|
/*
|
|
|
|
* \brief Client-side Gpio session interface
|
|
|
|
* \author Ivan Loskutov <ivan.loskutov@ksyslabs.org>
|
2013-05-06 12:33:30 +00:00
|
|
|
* \author Stefan Kalkowski <Stefan.kalkowski@genode-labs.com>
|
2012-07-16 13:13:35 +00:00
|
|
|
* \date 2012-06-23
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2012 Ksys Labs LLC
|
2015-04-14 11:56:26 +00:00
|
|
|
* Copyright (C) 2012-2015 Genode Labs GmbH
|
2012-07-16 13:13:35 +00:00
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
|
|
|
* under the terms of the GNU General Public License version 2.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _INCLUDE__GPIO_SESSION_H__CLIENT_H_
|
|
|
|
#define _INCLUDE__GPIO_SESSION_H__CLIENT_H_
|
|
|
|
|
|
|
|
#include <gpio_session/capability.h>
|
|
|
|
#include <base/rpc_client.h>
|
|
|
|
|
2015-03-04 20:12:14 +00:00
|
|
|
namespace Gpio { struct Session_client; }
|
|
|
|
|
|
|
|
|
|
|
|
struct Gpio::Session_client : Genode::Rpc_client<Session>
|
|
|
|
{
|
|
|
|
explicit Session_client(Session_capability session)
|
|
|
|
: Genode::Rpc_client<Session>(session) { }
|
|
|
|
|
2015-04-14 11:56:26 +00:00
|
|
|
void direction(Direction d) override { call<Rpc_direction>(d); }
|
|
|
|
void write(bool level) override { call<Rpc_write>(level); }
|
|
|
|
bool read() override { return call<Rpc_read>(); }
|
|
|
|
void debouncing(unsigned int us) override { call<Rpc_debouncing>(us); }
|
2015-03-04 20:12:14 +00:00
|
|
|
|
2015-04-14 11:56:26 +00:00
|
|
|
Genode::Irq_session_capability irq_session(Irq_type type) override {
|
|
|
|
return call<Rpc_irq_session>(type); }
|
2015-03-04 20:12:14 +00:00
|
|
|
};
|
2012-07-16 13:13:35 +00:00
|
|
|
|
2013-05-06 12:33:30 +00:00
|
|
|
#endif /* _INCLUDE__GPIO_SESSION_H__CLIENT_H_ */
|