MotorControlModuleSDFM_TMS3.../Projects/EFC_Communication/UMLibrary/driver/Demux.hh
2024-06-07 11:12:56 +03:00

40 lines
643 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* Demux.h
*
* Created on: 23 окт. 2019 г.
* Author: user
*/
#ifndef SOURCE_DRIVER_DEMUX_H_
#define SOURCE_DRIVER_DEMUX_H_
#include "../peripheral/IPort.hh"
namespace driver {
class Demux {
public:
enum SelectPinStrategy : unsigned short {
set_clear,
clear_set,
};
Demux( peripheral::IPort & gpio_port, unsigned long pin_mask, SelectPinStrategy strategy );
void select( unsigned short pin );
virtual ~Demux() = default;
private:
peripheral::IPort & gpio_port;
const unsigned long pin_mask;
const SelectPinStrategy strategy;
};
}
#endif /* SOURCE_DRIVER_DEMUX_H_ */