Loading...
Searching...
No Matches
io_port.h
Go to the documentation of this file.
/******************************************************************************
The MIT License(MIT)
Embedded Template Library.
https://github.com/ETLCPP/etl
https://www.etlcpp.com
Copyright(c) 2014 John Wellbelove
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files(the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions :
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
******************************************************************************/
#ifndef ETL_IO_PORT_INCLUDED
#define ETL_IO_PORT_INCLUDED
#include "platform.h"
#include "iterator.h"
#include "nullptr.h"
#include "static_assert.h"
#include "utility.h"
#include <stdint.h>
#include "private/diagnostic_cxx_11_extensions_push.h"
namespace etl
{
template <typename, uintptr_t>
class io_port_rw;
namespace private_io_port
{
//***************************************************************************
//***************************************************************************
template <typename TIO_Port>
class iterator : public etl::iterator<ETL_OR_STD::forward_iterator_tag, typename TIO_Port::value_type>
{
public:
//********************************
//********************************
friend TIO_Port;
//********************************
//********************************
template <typename U>
friend class const_iterator;
//********************************
//********************************
typedef TIO_Port io_port_type;
typedef typename TIO_Port::value_type value_type;
//********************************
//********************************
iterator()
: p_iop(ETL_NULLPTR)
{
}
//********************************
//********************************
iterator(const iterator& other)
: p_iop(other.p_iop)
{
}
//********************************
//********************************
iterator& operator=(const iterator& other)
{
p_iop = other.p_iop;
return *this;
}
//********************************
//********************************
io_port_type& operator*()
{
return *p_iop;
}
//********************************
//********************************
const io_port_type& operator*() const
{
return *p_iop;
}
//********************************
//********************************
iterator& operator++()
{
return *this;
}
//********************************
//********************************
iterator operator++(int)
{
return *this;
}
private:
//********************************
//********************************
iterator(io_port_type& iop)
: p_iop(&iop)
{
}
io_port_type* p_iop;
};
//***************************************************************************
//***************************************************************************
template <typename TIO_Port>
class const_iterator : public etl::iterator<ETL_OR_STD::forward_iterator_tag, const typename TIO_Port::value_type>
{
private:
typedef etl::private_io_port::iterator<TIO_Port> iterator_type;
public:
//********************************
//********************************
friend TIO_Port;
//********************************
//********************************
typedef TIO_Port io_port_type;
typedef const typename TIO_Port::value_type value_type;
//********************************
//********************************
const_iterator()
: p_iop(ETL_NULLPTR)
{
}
//********************************
//********************************
const_iterator(const iterator_type& other)
: p_iop(other.p_iop)
{
}
//********************************
//********************************
const_iterator(const const_iterator& other)
: p_iop(other.p_iop)
{
}
//********************************
//********************************
const_iterator& operator=(const iterator_type& other)
{
p_iop = other.p_iop;
return *this;
}
//********************************
//********************************
const_iterator& operator=(const const_iterator& other)
{
p_iop = other.p_iop;
return *this;
}
//********************************
//********************************
const io_port_type& operator*() const
{
return *p_iop;
}
//********************************
//********************************
const_iterator& operator++()
{
return *this;
}
//********************************
//********************************
const_iterator operator++(int)
{
return *this;
}
private:
//********************************
//********************************
const_iterator(const io_port_type& iop)
: p_iop(&iop)
{
}
const io_port_type* p_iop;
};
} // namespace private_io_port
//***************************************************************************
//***************************************************************************
template <typename T, uintptr_t Address = 0>
class io_port_rw
{
public:
ETL_STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
typedef T value_type;
typedef volatile T* pointer;
typedef volatile const T* const_pointer;
typedef volatile T& reference;
typedef volatile const T& const_reference;
typedef etl::private_io_port::iterator<io_port_rw<T, Address> > iterator;
typedef etl::private_io_port::const_iterator<io_port_rw<T, Address> > const_iterator;
//**********************************
//**********************************
iterator iter()
{
return iterator(*this);
}
//**********************************
//**********************************
const_iterator iter() const
{
return const_iterator(*this);
}
//**********************************
//**********************************
const_iterator citer() const
{
return const_iterator(*this);
}
//**********************************
//**********************************
operator value_type() const
{
return *reinterpret_cast<const_pointer>(Address);
}
//**********************************
//**********************************
value_type read() const
{
return *reinterpret_cast<const_pointer>(Address);
}
//**********************************
//**********************************
void write(value_type value_)
{
*reinterpret_cast<pointer>(Address) = value_;
}
//**********************************
//**********************************
io_port_rw& operator=(value_type value_)
{
*reinterpret_cast<pointer>(Address) = value_;
return *this;
}
//**********************************
//**********************************
io_port_rw& operator|=(value_type value)
{
pointer address = reinterpret_cast<pointer>(Address);
value_type temp = *address;
temp |= value;
*address = temp;
return *this;
}
//**********************************
//**********************************
io_port_rw& operator&=(value_type value)
{
pointer address = reinterpret_cast<pointer>(Address);
value_type temp = *address;
temp &= value;
*address = temp;
return *this;
}
//**********************************
//**********************************
io_port_rw& operator^=(value_type value)
{
pointer address = reinterpret_cast<pointer>(Address);
value_type temp = *address;
temp ^= value;
*address = temp;
return *this;
}
//**********************************
//**********************************
io_port_rw& operator<<=(int shift)
{
pointer address = reinterpret_cast<pointer>(Address);
value_type temp = *address;
temp <<= shift;
*address = temp;
return *this;
}
//**********************************
//**********************************
io_port_rw& operator>>=(int shift)
{
pointer address = reinterpret_cast<pointer>(Address);
value_type temp = *address;
temp >>= shift;
*address = temp;
return *this;
}
//**********************************
//**********************************
value_type operator~() const
{
return ~(*reinterpret_cast<pointer>(Address));
}
//**********************************
//**********************************
pointer get_address()
{
return reinterpret_cast<pointer>(Address);
}
//**********************************
//**********************************
const_pointer get_address() const
{
return reinterpret_cast<const_pointer>(Address);
}
private:
io_port_rw& operator=(const io_port_rw&);
};
//***************************************************************************
//***************************************************************************
template <typename T, uintptr_t Address = 0>
class io_port_ro
{
public:
ETL_STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
typedef T value_type;
typedef volatile T* pointer;
typedef volatile const T* const_pointer;
typedef volatile T& reference;
typedef volatile const T& const_reference;
typedef etl::private_io_port::const_iterator<io_port_ro<T, Address> > const_iterator;
//**********************************
//**********************************
const_iterator iter() const
{
return const_iterator(*this);
}
//**********************************
//**********************************
const_iterator citer() const
{
return const_iterator(*this);
}
//**********************************
//**********************************
operator value_type() const
{
return *reinterpret_cast<const_pointer>(Address);
}
//**********************************
//**********************************
value_type read() const
{
return *reinterpret_cast<const_pointer>(Address);
}
//**********************************
//**********************************
pointer get_address()
{
return reinterpret_cast<pointer>(Address);
}
//**********************************
//**********************************
const_pointer get_address() const
{
return reinterpret_cast<const_pointer>(Address);
}
private:
void operator=(value_type value) ETL_DELETE;
io_port_ro& operator=(const io_port_ro&) ETL_DELETE;
};
//***************************************************************************
//***************************************************************************
template <typename T, uintptr_t Address = 0>
class io_port_wo
{
public:
ETL_STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
typedef T value_type;
typedef volatile T* pointer;
typedef volatile const T* const_pointer;
typedef volatile T& reference;
typedef volatile const T& const_reference;
typedef etl::private_io_port::iterator<io_port_wo<T, Address> > iterator;
//**********************************
//**********************************
iterator iter()
{
return iterator(*this);
}
//**********************************
//**********************************
void operator=(value_type value)
{
*reinterpret_cast<pointer>(Address) = value;
}
//**********************************
//**********************************
void write(value_type value_)
{
*reinterpret_cast<pointer>(Address) = value_;
}
//**********************************
//**********************************
pointer get_address()
{
return reinterpret_cast<pointer>(Address);
}
//**********************************
//**********************************
const_pointer get_address() const
{
return reinterpret_cast<const_pointer>(Address);
}
private:
operator value_type() const ETL_DELETE;
io_port_wo& operator=(const io_port_wo&) ETL_DELETE;
};
//***************************************************************************
//***************************************************************************
template <typename T, uintptr_t Address = 0>
class io_port_wos
{
public:
ETL_STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
typedef T value_type;
typedef volatile T* pointer;
typedef volatile const T* const_pointer;
typedef volatile T& reference;
typedef volatile const T& const_reference;
typedef etl::private_io_port::iterator<io_port_wos<T, Address> > iterator;
typedef etl::private_io_port::const_iterator<io_port_wos<T, Address> > const_iterator;
//**********************************
//**********************************
io_port_wos()
: shadow_value(value_type())
{
}
//**********************************
//**********************************
iterator iter()
{
return iterator(*this);
}
//**********************************
//**********************************
const_iterator iter() const
{
return const_iterator(*this);
}
//**********************************
//**********************************
const_iterator citer() const
{
return const_iterator(*this);
}
//**********************************
//**********************************
operator value_type() const
{
return shadow_value;
}
//**********************************
//**********************************
value_type read() const
{
return shadow_value;
}
//**********************************
//**********************************
void write(value_type value_)
{
shadow_value = value_;
*reinterpret_cast<pointer>(Address) = shadow_value;
}
//**********************************
//**********************************
io_port_wos& operator=(value_type value_)
{
shadow_value = value_;
*reinterpret_cast<pointer>(Address) = shadow_value;
return *this;
}
//**********************************
//**********************************
io_port_wos& operator|=(value_type value)
{
shadow_value |= value;
*reinterpret_cast<pointer>(Address) = shadow_value;
return *this;
}
//**********************************
//**********************************
io_port_wos& operator&=(value_type value)
{
shadow_value &= value;
*reinterpret_cast<pointer>(Address) = shadow_value;
return *this;
}
//**********************************
//**********************************
io_port_wos& operator^=(value_type value)
{
shadow_value ^= value;
*reinterpret_cast<pointer>(Address) = shadow_value;
return *this;
}
//**********************************
//**********************************
io_port_wos& operator<<=(int shift)
{
shadow_value <<= shift;
*reinterpret_cast<pointer>(Address) = shadow_value;
return *this;
}
//**********************************
//**********************************
io_port_wos& operator>>=(int shift)
{
shadow_value >>= shift;
*reinterpret_cast<pointer>(Address) = shadow_value;
return *this;
}
//**********************************
//**********************************
value_type operator~() const
{
return ~shadow_value;
}
//**********************************
//**********************************
pointer get_address()
{
return reinterpret_cast<pointer>(Address);
}
private:
io_port_wos& operator=(const io_port_wos&);
value_type shadow_value;
};
//***************************************************************************
//***************************************************************************
template <typename T>
class io_port_rw<T, 0>
{
public:
ETL_STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
typedef T value_type;
typedef volatile T* pointer;
typedef volatile const T* const_pointer;
typedef volatile T& reference;
typedef volatile const T& const_reference;
typedef etl::private_io_port::iterator<io_port_rw<T, 0> > iterator;
typedef etl::private_io_port::const_iterator<io_port_rw<T, 0> > const_iterator;
//**********************************
//**********************************
io_port_rw()
: address(ETL_NULLPTR)
{
}
//**********************************
//**********************************
io_port_rw(void* address_)
: address(reinterpret_cast<pointer>(address_))
{
}
//**********************************
//**********************************
io_port_rw(const io_port_rw& other_)
: address(reinterpret_cast<pointer>(other_.address))
{
}
//**********************************
//**********************************
io_port_rw& operator=(const io_port_rw& other_)
{
address = other_.address;
return *this;
}
//**********************************
//**********************************
iterator iter()
{
return iterator(*this);
}
//**********************************
//**********************************
const_iterator iter() const
{
return const_iterator(*this);
}
//**********************************
//**********************************
const_iterator citer() const
{
return const_iterator(*this);
}
//**********************************
//**********************************
io_port_rw& operator|=(value_type value)
{
value_type temp = *address;
temp |= value;
*address = temp;
return *this;
}
//**********************************
//**********************************
io_port_rw& operator&=(value_type value)
{
value_type temp = *address;
temp &= value;
*address = temp;
return *this;
}
//**********************************
//**********************************
io_port_rw& operator^=(value_type value)
{
value_type temp = *address;
temp ^= value;
*address = temp;
return *this;
}
//**********************************
//**********************************
io_port_rw& operator<<=(int shift)
{
value_type temp = *address;
temp <<= shift;
*address = temp;
return *this;
}
//**********************************
//**********************************
io_port_rw& operator>>=(int shift)
{
value_type temp = *address;
temp >>= shift;
*address = temp;
return *this;
}
//**********************************
//**********************************
value_type operator~() const
{
return ~(*address);
}
//**********************************
//**********************************
void set_address(void* address_)
{
address = reinterpret_cast<pointer>(address_);
}
//**********************************
//**********************************
pointer get_address()
{
return address;
}
//**********************************
//**********************************
const_pointer get_address() const
{
return address;
}
//**********************************
//**********************************
operator value_type() const
{
return *address;
}
//**********************************
//**********************************
value_type read() const
{
return *address;
}
//**********************************
//**********************************
void write(value_type value_)
{
*address = value_;
}
//**********************************
//**********************************
io_port_rw& operator=(value_type value_)
{
*address = value_;
return *this;
}
private:
pointer address;
};
//***************************************************************************
//***************************************************************************
template <typename T>
class io_port_ro<T, 0>
{
public:
ETL_STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
typedef T value_type;
typedef volatile T* pointer;
typedef volatile const T* const_pointer;
typedef volatile T& reference;
typedef volatile const T& const_reference;
typedef etl::private_io_port::const_iterator<io_port_ro<T, 0> > const_iterator;
//**********************************
//**********************************
io_port_ro()
: address(ETL_NULLPTR)
{
}
//**********************************
//**********************************
io_port_ro(void* address_)
: address(reinterpret_cast<pointer>(address_))
{
}
//**********************************
//**********************************
io_port_ro(const io_port_ro& other_)
: address(reinterpret_cast<pointer>(other_.address))
{
}
//**********************************
//**********************************
io_port_ro& operator=(const io_port_ro& other_)
{
address = other_.address;
return *this;
}
//**********************************
//**********************************
const_iterator iter() const
{
return const_iterator(*this);
}
//**********************************
//**********************************
const_iterator citer() const
{
return const_iterator(*this);
}
//**********************************
//**********************************
void set_address(void* address_)
{
address = reinterpret_cast<pointer>(address_);
}
//**********************************
//**********************************
const_pointer get_address() const
{
return address;
}
//**********************************
//**********************************
operator value_type() const
{
return *address;
}
//**********************************
//**********************************
value_type read() const
{
return *address;
}
private:
void operator=(value_type value) ETL_DELETE;
pointer address;
};
//***************************************************************************
//***************************************************************************
template <typename T>
class io_port_wo<T, 0>
{
public:
ETL_STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
typedef T value_type;
typedef volatile T* pointer;
typedef volatile const T* const_pointer;
typedef volatile T& reference;
typedef volatile const T& const_reference;
typedef etl::private_io_port::iterator<io_port_wo<T, 0> > iterator;
//**********************************
//**********************************
io_port_wo()
: address(ETL_NULLPTR)
{
}
//**********************************
//**********************************
io_port_wo(void* address_)
: address(reinterpret_cast<pointer>(address_))
{
}
//**********************************
//**********************************
io_port_wo(const io_port_wo& other_)
: address(reinterpret_cast<pointer>(other_.address))
{
}
//**********************************
//**********************************
io_port_wo& operator=(const io_port_wo& other_)
{
address = other_.address;
return *this;
}
//**********************************
//**********************************
iterator iter()
{
return iterator(*this);
}
//**********************************
//**********************************
void set_address(void* address_)
{
address = reinterpret_cast<pointer>(address_);
}
//**********************************
//**********************************
pointer get_address()
{
return address;
}
//**********************************
//**********************************
const_pointer get_address() const
{
return address;
}
//**********************************
//**********************************
void write(value_type value_)
{
*address = value_;
}
//**********************************
//**********************************
void operator=(value_type value)
{
*address = value;
}
private:
operator value_type() const ETL_DELETE;
pointer address;
};
//***************************************************************************
//***************************************************************************
template <typename T>
class io_port_wos<T, 0>
{
public:
ETL_STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
typedef T value_type;
typedef volatile T* pointer;
typedef volatile const T* const_pointer;
typedef volatile T& reference;
typedef volatile const T& const_reference;
typedef etl::private_io_port::iterator<io_port_wos<T, 0> > iterator;
typedef etl::private_io_port::const_iterator<io_port_wos<T, 0> > const_iterator;
//**********************************
//**********************************
io_port_wos()
: shadow_value(T())
, address(ETL_NULLPTR)
{
}
//**********************************
//**********************************
io_port_wos(void* address_)
: shadow_value(T())
, address(reinterpret_cast<pointer>(address_))
{
}
//**********************************
//**********************************
io_port_wos(const io_port_wos& other_)
: shadow_value(other_.shadow_value)
, address(reinterpret_cast<pointer>(other_.address))
{
}
//**********************************
//**********************************
io_port_wos& operator=(const io_port_wos& other_)
{
shadow_value = other_.shadow_value;
address = other_.address;
return *this;
}
//**********************************
//**********************************
iterator iter()
{
return iterator(*this);
}
//**********************************
//**********************************
const_iterator iter() const
{
return const_iterator(*this);
}
//**********************************
//**********************************
const_iterator citer() const
{
return const_iterator(*this);
}
//**********************************
//**********************************
io_port_wos& operator|=(value_type value)
{
shadow_value |= value;
*address = shadow_value;
return *this;
}
//**********************************
//**********************************
io_port_wos& operator&=(value_type value)
{
shadow_value &= value;
*address = shadow_value;
return *this;
}
//**********************************
//**********************************
io_port_wos& operator^=(value_type value)
{
shadow_value ^= value;
*address = shadow_value;
return *this;
}
//**********************************
//**********************************
io_port_wos& operator<<=(int shift)
{
shadow_value <<= shift;
*address = shadow_value;
return *this;
}
//**********************************
//**********************************
io_port_wos& operator>>=(int shift)
{
shadow_value >>= shift;
*address = shadow_value;
return *this;
}
//**********************************
//**********************************
value_type operator~() const
{
return ~shadow_value;
}
//**********************************
//**********************************
void set_address(void* address_)
{
address = reinterpret_cast<pointer>(address_);
}
//**********************************
//**********************************
pointer get_address()
{
return address;
}
//**********************************
//**********************************
const_pointer get_address() const
{
return address;
}
//**********************************
//**********************************
operator value_type() const
{
return shadow_value;
}
//**********************************
//**********************************
value_type read() const
{
return shadow_value;
}
//**********************************
//**********************************
void write(value_type value_)
{
shadow_value = value_;
*address = shadow_value;
}
//**********************************
//**********************************
io_port_wos& operator=(value_type value_)
{
shadow_value = value_;
*address = shadow_value;
return *this;
}
//**********************************
//**********************************
io_port_wos& operator*()
{
return *this;
}
//**********************************
//**********************************
const_reference operator*() const
{
return shadow_value;
}
private:
value_type shadow_value;
pointer address;
};
} // namespace etl
#include "private/diagnostic_pop.h"
#endif
etl::io_port_ro< T, 0 >::set_address
void set_address(void *address_)
Set the IO port address.
Definition io_port.h:1009
etl::io_port_ro< T, 0 >::get_address
const_pointer get_address() const
Get the IO port address.
Definition io_port.h:1017
etl::io_port_ro< T, 0 >::read
value_type read() const
Read.
Definition io_port.h:1033
etl::io_port_ro< T, 0 >::operator=
io_port_ro & operator=(const io_port_ro &other_)
Assignment.
Definition io_port.h:984
etl::io_port_ro< T, 0 >::citer
const_iterator citer() const
Get a const_iterator to this port.
Definition io_port.h:1001
etl::io_port_ro< T, 0 >::io_port_ro
io_port_ro(void *address_)
Constructor.
Definition io_port.h:968
etl::io_port_ro< T, 0 >::io_port_ro
io_port_ro()
Default constructor.
Definition io_port.h:960
etl::io_port_ro< T, 0 >::iter
const_iterator iter() const
Get a const_iterator to this port.
Definition io_port.h:993
etl::io_port_ro< T, 0 >::io_port_ro
io_port_ro(const io_port_ro &other_)
Copy Constructor.
Definition io_port.h:976
etl::io_port_ro
Read only port.
Definition io_port.h:429
etl::io_port_ro::read
value_type read() const
Read.
Definition io_port.h:469
etl::io_port_ro::citer
const_iterator citer() const
Get a const_iterator to this port.
Definition io_port.h:453
etl::io_port_ro::get_address
const_pointer get_address() const
Get the IO port address.
Definition io_port.h:485
etl::io_port_ro::iter
const_iterator iter() const
Get a const_iterator to this port.
Definition io_port.h:445
etl::io_port_ro::get_address
pointer get_address()
Get the IO port address.
Definition io_port.h:477
etl::io_port_rw< T, 0 >::operator>>=
io_port_rw & operator>>=(int shift)
Right-Shift-Equals operator.
Definition io_port.h:859
etl::io_port_rw< T, 0 >::read
value_type read() const
Read.
Definition io_port.h:911
etl::io_port_rw< T, 0 >::citer
const_iterator citer() const
Get a const_iterator to this port.
Definition io_port.h:803
etl::io_port_rw< T, 0 >::get_address
const_pointer get_address() const
Get the IO port address.
Definition io_port.h:895
etl::io_port_rw< T, 0 >::operator&=
io_port_rw & operator&=(value_type value)
And-Equals operator.
Definition io_port.h:823
etl::io_port_rw< T, 0 >::get_address
pointer get_address()
Get the IO port address.
Definition io_port.h:887
etl::io_port_rw< T, 0 >::operator=
io_port_rw & operator=(const io_port_rw &other_)
Assignment.
Definition io_port.h:778
etl::io_port_rw< T, 0 >::operator<<=
io_port_rw & operator<<=(int shift)
Left-Shift-Equals operator.
Definition io_port.h:847
etl::io_port_rw< T, 0 >::iter
const_iterator iter() const
Get a const_iterator to this port.
Definition io_port.h:795
etl::io_port_rw< T, 0 >::io_port_rw
io_port_rw(const io_port_rw &other_)
Copy Constructor.
Definition io_port.h:770
etl::io_port_rw< T, 0 >::write
void write(value_type value_)
Write.
Definition io_port.h:919
etl::io_port_rw< T, 0 >::set_address
void set_address(void *address_)
Set the IO port address.
Definition io_port.h:879
etl::io_port_rw< T, 0 >::iter
iterator iter()
Get an iterator to this port.
Definition io_port.h:787
etl::io_port_rw< T, 0 >::operator~
value_type operator~() const
Not operator.
Definition io_port.h:871
etl::io_port_rw< T, 0 >::operator|=
io_port_rw & operator|=(value_type value)
Or-Equals operator.
Definition io_port.h:811
etl::io_port_rw< T, 0 >::operator=
io_port_rw & operator=(value_type value_)
Write.
Definition io_port.h:927
etl::io_port_rw< T, 0 >::operator^=
io_port_rw & operator^=(value_type value)
Exclusive-Or-Equals operator.
Definition io_port.h:835
etl::io_port_rw< T, 0 >::io_port_rw
io_port_rw(void *address_)
Constructor.
Definition io_port.h:762
etl::io_port_rw< T, 0 >::io_port_rw
io_port_rw()
Default constructor.
Definition io_port.h:754
etl::io_port_rw
Read write port.
Definition io_port.h:258
etl::io_port_rw::operator&=
io_port_rw & operator&=(value_type value)
And-Equals operator.
Definition io_port.h:345
etl::io_port_rw::operator>>=
io_port_rw & operator>>=(int shift)
Right-Shift-Equals operator.
Definition io_port.h:384
etl::io_port_rw::operator=
io_port_rw & operator=(value_type value_)
Write.
Definition io_port.h:323
etl::io_port_rw::get_address
pointer get_address()
Get the IO port address.
Definition io_port.h:405
etl::io_port_rw::operator^=
io_port_rw & operator^=(value_type value)
Exclusive-Or-Equals operator.
Definition io_port.h:358
etl::io_port_rw::operator~
value_type operator~() const
Not operator.
Definition io_port.h:397
etl::io_port_rw::get_address
const_pointer get_address() const
Get the IO port address.
Definition io_port.h:413
etl::io_port_rw::operator<<=
io_port_rw & operator<<=(int shift)
Left-Shift-Equals operator.
Definition io_port.h:371
etl::io_port_rw::write
void write(value_type value_)
Write.
Definition io_port.h:315
etl::io_port_rw::read
value_type read() const
Read.
Definition io_port.h:307
etl::io_port_rw::operator|=
io_port_rw & operator|=(value_type value)
Or-Equals operator.
Definition io_port.h:332
etl::io_port_rw::iter
iterator iter()
Get an iterator to this port.
Definition io_port.h:275
etl::io_port_rw::iter
const_iterator iter() const
Get a const_iterator to this port.
Definition io_port.h:283
etl::io_port_rw::citer
const_iterator citer() const
Get a const_iterator to this port.
Definition io_port.h:291
etl::io_port_wo< T, 0 >::io_port_wo
io_port_wo(const io_port_wo &other_)
Copy Constructor.
Definition io_port.h:1084
etl::io_port_wo< T, 0 >::set_address
void set_address(void *address_)
Set the IO port address.
Definition io_port.h:1109
etl::io_port_wo< T, 0 >::operator=
io_port_wo & operator=(const io_port_wo &other_)
Assignment.
Definition io_port.h:1092
etl::io_port_wo< T, 0 >::get_address
pointer get_address()
Get the IO port address.
Definition io_port.h:1117
etl::io_port_wo< T, 0 >::iter
iterator iter()
Get an iterator to this port.
Definition io_port.h:1101
etl::io_port_wo< T, 0 >::operator=
void operator=(value_type value)
Write.
Definition io_port.h:1141
etl::io_port_wo< T, 0 >::io_port_wo
io_port_wo(void *address_)
Constructor.
Definition io_port.h:1076
etl::io_port_wo< T, 0 >::write
void write(value_type value_)
Write.
Definition io_port.h:1133
etl::io_port_wo< T, 0 >::get_address
const_pointer get_address() const
Get the IO port address.
Definition io_port.h:1125
etl::io_port_wo< T, 0 >::io_port_wo
io_port_wo()
Default constructor.
Definition io_port.h:1068
etl::io_port_wo
Write only port.
Definition io_port.h:504
etl::io_port_wo::get_address
const_pointer get_address() const
Get the IO port address.
Definition io_port.h:552
etl::io_port_wo::iter
iterator iter()
Get an iterator to this port.
Definition io_port.h:520
etl::io_port_wo::operator=
void operator=(value_type value)
Write.
Definition io_port.h:528
etl::io_port_wo::get_address
pointer get_address()
Get the IO port address.
Definition io_port.h:544
etl::io_port_wo::write
void write(value_type value_)
Write.
Definition io_port.h:536
etl::io_port_wos< T, 0 >::operator=
io_port_wos & operator=(const io_port_wos &other_)
Assignment.
Definition io_port.h:1204
etl::io_port_wos< T, 0 >::get_address
const_pointer get_address() const
Get the IO port address.
Definition io_port.h:1317
etl::io_port_wos< T, 0 >::write
void write(value_type value_)
Write.
Definition io_port.h:1341
etl::io_port_wos< T, 0 >::operator~
value_type operator~() const
Not operator.
Definition io_port.h:1293
etl::io_port_wos< T, 0 >::get_address
pointer get_address()
Get the IO port address.
Definition io_port.h:1309
etl::io_port_wos< T, 0 >::operator^=
io_port_wos & operator^=(value_type value)
Exclusive-Or-Equals operator.
Definition io_port.h:1260
etl::io_port_wos< T, 0 >::set_address
void set_address(void *address_)
Set the IO port address.
Definition io_port.h:1301
etl::io_port_wos< T, 0 >::operator&=
io_port_wos & operator&=(value_type value)
And-Equals operator.
Definition io_port.h:1249
etl::io_port_wos< T, 0 >::operator*
io_port_wos & operator*()
Read / Write.
Definition io_port.h:1360
etl::io_port_wos< T, 0 >::operator=
io_port_wos & operator=(value_type value_)
Write.
Definition io_port.h:1350
etl::io_port_wos< T, 0 >::iter
iterator iter()
Get an iterator to this port.
Definition io_port.h:1214
etl::io_port_wos< T, 0 >::operator*
const_reference operator*() const
Read.
Definition io_port.h:1368
etl::io_port_wos< T, 0 >::operator<<=
io_port_wos & operator<<=(int shift)
Left-Shift-Equals operator.
Definition io_port.h:1271
etl::io_port_wos< T, 0 >::io_port_wos
io_port_wos(void *address_)
Constructor.
Definition io_port.h:1186
etl::io_port_wos< T, 0 >::io_port_wos
io_port_wos()
Default constructor.
Definition io_port.h:1177
etl::io_port_wos< T, 0 >::read
value_type read() const
Read.
Definition io_port.h:1333
etl::io_port_wos< T, 0 >::citer
const_iterator citer() const
Get a const_iterator to this port.
Definition io_port.h:1230
etl::io_port_wos< T, 0 >::iter
const_iterator iter() const
Get a const_iterator to this port.
Definition io_port.h:1222
etl::io_port_wos< T, 0 >::io_port_wos
io_port_wos(const io_port_wos &other_)
Copy Constructor.
Definition io_port.h:1195
etl::io_port_wos< T, 0 >::operator>>=
io_port_wos & operator>>=(int shift)
Right-Shift-Equals operator.
Definition io_port.h:1282
etl::io_port_wos< T, 0 >::operator|=
io_port_wos & operator|=(value_type value)
Or-Equals operator.
Definition io_port.h:1238
etl::io_port_wos
Write only port with shadow register.
Definition io_port.h:571
etl::io_port_wos::iter
const_iterator iter() const
Get a const_iterator to this port.
Definition io_port.h:604
etl::io_port_wos::operator>>=
io_port_wos & operator>>=(int shift)
Right-Shift-Equals operator.
Definition io_port.h:699
etl::io_port_wos::get_address
pointer get_address()
Get the IO port address.
Definition io_port.h:718
etl::io_port_wos::iter
iterator iter()
Get an iterator to this port.
Definition io_port.h:596
etl::io_port_wos::operator<<=
io_port_wos & operator<<=(int shift)
Left-Shift-Equals operator.
Definition io_port.h:688
etl::io_port_wos::write
void write(value_type value_)
Write.
Definition io_port.h:636
etl::io_port_wos::operator=
io_port_wos & operator=(value_type value_)
Write.
Definition io_port.h:645
etl::io_port_wos::operator~
value_type operator~() const
Not operator.
Definition io_port.h:710
etl::io_port_wos::citer
const_iterator citer() const
Get a const_iterator to this port.
Definition io_port.h:612
etl::io_port_wos::io_port_wos
io_port_wos()
Default constructor.
Definition io_port.h:588
etl::io_port_wos::operator^=
io_port_wos & operator^=(value_type value)
Exclusive-Or-Equals operator.
Definition io_port.h:677
etl::io_port_wos::operator&=
io_port_wos & operator&=(value_type value)
And-Equals operator.
Definition io_port.h:666
etl::io_port_wos::operator|=
io_port_wos & operator|=(value_type value)
Or-Equals operator.
Definition io_port.h:655
etl::io_port_wos::read
value_type read() const
Read.
Definition io_port.h:628
etl::private_io_port::const_iterator
Common io_port const_iterator implementation.
Definition io_port.h:155
etl::private_io_port::const_iterator::operator++
const_iterator operator++(int)
Post-increment operator.
Definition io_port.h:234
etl::private_io_port::const_iterator::io_port_type
TIO_Port io_port_type
Types.
Definition io_port.h:170
etl::private_io_port::const_iterator::operator++
const_iterator & operator++()
Pre-increment operator.
Definition io_port.h:226
etl::private_io_port::const_iterator< io_port_rw< T, Address > >::TIO_Port
friend TIO_Port
Definition io_port.h:165
etl::private_io_port::iterator
Common io_port iterator implementation.
Definition io_port.h:60
etl::private_io_port::iterator< io_port_rw< T, Address > >::TIO_Port
friend TIO_Port
Definition io_port.h:66
etl::private_io_port::iterator::io_port_type
TIO_Port io_port_type
Types.
Definition io_port.h:77
etl::private_io_port::iterator::operator++
iterator operator++(int)
Post-increment operator.
Definition io_port.h:132
etl::private_io_port::iterator::operator++
iterator & operator++()
Pre-increment operator.
Definition io_port.h:124
etl::private_io_port::iterator< io_port_rw< T, Address > >::const_iterator
friend class const_iterator
Definition io_port.h:72
diagnostic_cxx_11_extensions_push.h
diagnostic_pop.h
etl::const_iterator
iterator.h
etl
Definition absolute.h:40
nullptr.h
platform.h
etl::value_type
etl::iterator
iterator
Definition iterator.h:482
utility.h