Loading files
/*****************************************************************************
GpioInputDaisy.hpp
Copyright (c) 2020 Raphael DINGE
*Tab=3***********************************************************************/
#pragma once
/*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
namespace erb
{
/*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
/*
==============================================================================
Name : ctor
==============================================================================
*/
GpioInputDaisy::GpioInputDaisy (const dsy_gpio_pin & pin, Pull pull)
: _impl ({pin, DSY_GPIO_MODE_INPUT, to_dsy_gpio_pull (pull)})
{
dsy_gpio_init (&_impl);
}
/*
==============================================================================
Name : read
==============================================================================
*/
bool GpioInputDaisy::read ()
{
return dsy_gpio_read (&_impl) != 0;
}
/*\\\ INTERNAL \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
/*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
/*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
/*
==============================================================================
Name : to_dsy_gpio_pull
==============================================================================
*/
dsy_gpio_pull GpioInputDaisy::to_dsy_gpio_pull (Pull pull)
{
switch (pull)
{
case Pull::None:
return DSY_GPIO_NOPULL;
//break;
case Pull::Up:
return DSY_GPIO_PULLUP;
//break;
case Pull::Down:
return DSY_GPIO_PULLDOWN;
//break;
}
return DSY_GPIO_NOPULL;
}
} // namespace erb
/*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
1c962d8cfThis file is pinned to the selected release. Download the original to open it in your design tool.