DUDS
Distributed Update of Data from Something
ChipMultiplexerSelectManager.hpp
Go to the documentation of this file.
1 /*
2  * This file is part of the DUDS project. It is subject to the BSD-style
3  * license terms in the LICENSE file found in the top-level directory of this
4  * distribution and at https://github.com/jjackowski/duds/blob/master/LICENSE.
5  * No part of DUDS, including this file, may be copied, modified, propagated,
6  * or distributed except according to the terms contained in the LICENSE file.
7  *
8  * Copyright (C) 2017 Jeff Jackowski
9  */
13 
14 namespace duds { namespace hardware { namespace interface {
15 
30  std::unique_ptr<DigitalPinSetAccess> outacc;
31 protected:
32  virtual void select();
33  virtual void deselect();
34 public:
38  ChipMultiplexerSelectManager() = default;
51  ChipMultiplexerSelectManager(std::unique_ptr<DigitalPinSetAccess> &&acc);
56  virtual bool validChip(int chipId) const noexcept;
72  void setAccess(std::unique_ptr<DigitalPinSetAccess> &&acc);
81  std::unique_ptr<DigitalPinSetAccess> releaseAccess();
82 };
83 
84 } } }
virtual void select()
Selects the chip identified by cid.
void setAccess(std::unique_ptr< DigitalPinSetAccess > &&acc)
Sets the access object used to output the number of the chip to select.
std::unique_ptr< DigitalPinSetAccess > outacc
Access used for parallel output.
virtual void deselect()
Deselects the chip identified by cid.
std::unique_ptr< DigitalPinSetAccess > releaseAccess()
Returns the access object that was used by this chip select manager.
ChipMultiplexerSelectManager()=default
Default constructor.
virtual bool validChip(int chipId) const noexcept
Valid chip IDs are greater than zero and can be represented in the same number of bits as there are p...
Selects one of several chips using several pins for parallel output of a number.
The base class for all chip selection managers, the classes that handle the output state to select a ...