DUDS
Distributed Update of Data from Something
ChipBinarySelectManager.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  */
12 
13 namespace duds { namespace hardware { namespace interface {
14 
43  std::unique_ptr<DigitalPinAccess> selpin;
44 protected:
45  virtual void select();
46  virtual void deselect();
47 public:
64  std::unique_ptr<DigitalPinAccess> &&dpa,
65  int initSel = 0
66  );
75  virtual bool validChip(int chipId) const noexcept;
86  void setSelectPin(std::unique_ptr<DigitalPinAccess> &&dpa, int initSel = 0);
87 };
88 
89 } } }
90 
std::unique_ptr< DigitalPinAccess > selpin
The access object for the select pin.
virtual bool validChip(int chipId) const noexcept
The only valid chip IDs for this manager are 0 and 1, and they are only valid once a DigitalPinAccess...
void setSelectPin(std::unique_ptr< DigitalPinAccess > &&dpa, int initSel=0)
Sets the DigitalPinAccess object to use for the chip select line.
virtual void deselect()
Deselects the chip identified by cid.
Selects one of two chips using a single pin.
virtual void select()
Selects the chip identified by cid.
The base class for all chip selection managers, the classes that handle the output state to select a ...