40 lines
643 B
C++
40 lines
643 B
C++
/*
|
||
* 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_ */
|