|
DUDS
|
Distributed Update of Data from Something
|
An object used to provide chip select control to a single user at a time. More...
#include <ChipAccess.hpp>
Public Member Functions | |
| ChipAccess () | |
| Makes a ChipAccess object that has no access. More... | |
| ~ChipAccess () | |
| Relinquishes access. More... | |
| void | changeChip (int chipId) |
| Changes the chip in use while not giving up access to the chip selector. More... | |
| void | deselect () |
| Deselects the chip. More... | |
| void | retire () |
| Relinquish access. More... | |
| void | select () |
| Selects the chip. More... | |
Private Member Functions | |
| ChipAccess (const std::shared_ptr< ChipSelectManager > &m) | |
| Constructs a ChipAccess object for use with the given manager. More... | |
Private Attributes | |
| std::shared_ptr< ChipSelectManager > | manager |
| The manager to which this object is attached. More... | |
Friends | |
| std::unique_ptr< ChipAccess > | ChipSelectManager::access (int) |
| ChipSelectManager::access(int) calls the constructor. More... | |
| void | ChipSelectManager::access (ChipAccess &, int) |
| ChipSelectManager::access(ChipAccess &, int) changes manager. More... | |
An object used to provide chip select control to a single user at a time.
When the object is destroyed, chip select is made available for another user.
Definition at line 22 of file ChipAccess.hpp.
|
inlineprivate |
Constructs a ChipAccess object for use with the given manager.
| m | The manager to access. |
Definition at line 39 of file ChipAccess.hpp.
|
inline |
Makes a ChipAccess object that has no access.
Definition at line 44 of file ChipAccess.hpp.
|
inline |
Relinquishes access.
Definition at line 48 of file ChipAccess.hpp.
|
inline |
Changes the chip in use while not giving up access to the chip selector.
If the chip is the same as the one already in use, nothing happens. If it is different, the validity of the new ID is checked, and if good, deselect() is called to deselect the current chip, then the new ID is recorded.
| chipId | The ID of the chip to use. |
| ChipSelectInvalidChip | The given chipId is invalid. The exception will include the ChipSelectId attribute with the requested chip ID. No changes will be made to the current chip selection state; ownership of access is not lost. |
| ChipSelectInvalidAccess | This is an invalid access object. |
Definition at line 88 of file ChipAccess.hpp.
|
inline |
Deselects the chip.
Definition at line 69 of file ChipAccess.hpp.
Referenced by duds::hardware::devices::displays::HD44780::initialize(), duds::hardware::devices::displays::ST7920::initialize(), duds::hardware::devices::displays::ST7920::sendByte(), duds::hardware::devices::displays::HD44780::sendByte(), and duds::hardware::interface::DigitalPinMasterSyncSerial::stop().
|
inline |
Relinquish access.
Definition at line 54 of file ChipAccess.hpp.
Referenced by duds::hardware::interface::DigitalPinMasterSyncSerial::close(), and ~ChipAccess().
|
inline |
Selects the chip.
Definition at line 63 of file ChipAccess.hpp.
Referenced by duds::hardware::devices::displays::HD44780::initialize(), duds::hardware::devices::displays::ST7920::initialize(), duds::hardware::devices::displays::ST7920::sendByte(), duds::hardware::devices::displays::HD44780::sendByte(), and duds::hardware::interface::DigitalPinMasterSyncSerial::start().
|
friend |
ChipSelectManager::access(int) calls the constructor.
|
friend |
ChipSelectManager::access(ChipAccess &, int) changes manager.
|
private |
The manager to which this object is attached.
Definition at line 34 of file ChipAccess.hpp.
Referenced by duds::hardware::interface::ChipSelectManager::access().