Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: UoY-32C-lab8-exercise UoY-32C-lab5-lsm303d
LSM303D::RWRegister< T > Class Template Reference
Read-write register class. More...
#include <LSM303D.h>
Inherits LSM303D::Register< T >.
Protected Member Functions | |
void | write (T const &data) |
Explicit write method. | |
virtual T | read () const |
Explicit read method with cache. | |
RWRegister & | operator= (T const &data) |
Equivalent to write(). | |
RWRegister & | operator= (int const &data) |
Equivalent to write(), with an explicit int parameter. | |
RWRegister & | operator|= (T const &data) |
Or-assignment operator. | |
RWRegister & | operator|= (int const &data) |
Or-assignment operator, with an explicit int parameter. | |
RWRegister & | operator&= (T const &data) |
And-assignment operator. | |
RWRegister & | operator&= (int const &data) |
And-assignment operator, with an explicit int parameter. | |
Friends | |
class | LSM303D |
Detailed Description
template<class T>
class LSM303D::RWRegister< T >
Read-write register class.
- Template Parameters:
-
T The underlying data type of the register. Provides an interface onto the writable registers of the LSM303D. Operator overloading means that it can be treated as a variable of type T for most purposes. Assignment from int is also explicitly supported to allow integer literals to be used without qualification or casting. The register value is cached on first read and updated on write, so read accesses do not use the I2C bus.
Definition at line 104 of file LSM303D.h.
Member Function Documentation
RWRegister& operator&= | ( | T const & | data ) | [protected] |
RWRegister& operator&= | ( | int const & | data ) | [protected] |
RWRegister& operator= | ( | int const & | data ) | [protected] |
RWRegister& operator= | ( | T const & | data ) | [protected] |
RWRegister& operator|= | ( | T const & | data ) | [protected] |
RWRegister& operator|= | ( | int const & | data ) | [protected] |
virtual T read | ( | ) | const [protected, virtual] |
Explicit read method with cache.
- Returns:
- The current value of the register, from cache if available.
Reimplemented from LSM303D::Register< T >.
Generated on Fri Jul 15 2022 15:42:00 by
