You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
736 B
C++
41 lines
736 B
C++
4 weeks ago
|
/*
|
||
|
* DiscreteOutputs.cpp
|
||
|
*
|
||
|
* Author: Aleksey Gerasimenko
|
||
|
* gerasimenko.aleksey.n@gmail.com
|
||
|
*/
|
||
|
|
||
|
#include "DSP28335/DiscreteOutputs.h"
|
||
|
|
||
|
namespace DSP28335
|
||
|
{
|
||
|
//CONSTRUCTOR
|
||
|
DiscreteOutputs::DiscreteOutputs():
|
||
|
DSP28335::CPUBase(),
|
||
|
_gpio_setup(&DSP28335::GPIO::gpio_dicrete_outputs_setup)
|
||
|
{}//CONSTRUCTOR
|
||
|
|
||
|
|
||
|
void DiscreteOutputs::setup(const DiscreteOutputsSetup& setup)
|
||
|
{
|
||
|
if(m_mode == DSP28335::DiscreteOutputs::UNDEFINED)
|
||
|
{
|
||
|
|
||
|
|
||
|
|
||
|
if(setup.gpio_setup != 0)
|
||
|
{
|
||
|
_gpio_setup = setup.gpio_setup;
|
||
|
(*_gpio_setup)();
|
||
|
|
||
|
m_mode = DSP28335::DiscreteOutputs::OPERATIONAL;
|
||
|
//
|
||
|
}//if
|
||
|
//
|
||
|
}//if
|
||
|
//
|
||
|
//
|
||
|
}//
|
||
|
|
||
|
} /* namespace DSP28335 */
|