10 #ifndef CHIPSELECT_HPP 11 #define CHIPSELECT_HPP 15 namespace duds {
namespace hardware {
namespace interface {
17 class ChipSelectManager;
28 std::shared_ptr<ChipSelectManager>
mgr;
106 const std::shared_ptr<ChipSelectManager> &
manager()
const {
113 return mgr && (cid >= 0);
119 operator bool ()
const {
136 void modify(
const std::shared_ptr<ChipSelectManager> &csm,
int chipId);
145 void modify(std::shared_ptr<ChipSelectManager> &&csm,
int chipId);
150 void reset() noexcept;
156 #endif // #ifndef CHIPSELECT_HPP int chipId() const
Returns the chip ID of the chip this object will select.
void modify(const std::shared_ptr< ChipSelectManager > &csm, int chipId)
Changes the manager and chip to select.
bool configured() const
Returns true if this object was configured with a chip to select.
An object to wrap together a ChipSelectManager and chip ID to simplify code that needs to repeatedly ...
int cid
The chip to select.
bool haveManager() const
Returns true if this object has an associated manager.
An object used to provide chip select control to a single user at a time.
ChipSelect() noexcept
Initializes the object to a non-configured state.
std::unique_ptr< ChipAccess > access()
Obtains a ChipAccess object.
void reset() noexcept
Returns the object to the default constructed state of not having a manager or a valid chip ID...
const std::shared_ptr< ChipSelectManager > & manager() const
Returns the associated manager object.
std::unique_ptr< ChipAccess > select()
Obtains an access object and selects the chip.
std::shared_ptr< ChipSelectManager > mgr
The manager that will handle the selection.
The base class for all chip selection managers, the classes that handle the output state to select a ...