31#ifndef ETL_IO_PORT_INCLUDED
32#define ETL_IO_PORT_INCLUDED
49 template <
typename T, u
intptr_t ADDRESS = 0>
54 typedef volatile T* pointer;
55 typedef volatile const T* const_pointer;
56 typedef volatile T& reference;
57 typedef volatile const T& const_reference;
62 return *
reinterpret_cast<const_pointer
>(ADDRESS);
68 return *
reinterpret_cast<const_pointer
>(ADDRESS);
74 *
reinterpret_cast<pointer
>(ADDRESS) = value_;
80 *
reinterpret_cast<pointer
>(ADDRESS) = value_;
87 return *
reinterpret_cast<pointer
>(ADDRESS);
93 return *
reinterpret_cast<const_pointer
>(ADDRESS);
111 return reinterpret_cast<pointer
>(ADDRESS);
117 return reinterpret_cast<const_pointer
>(ADDRESS);
129 template <
typename T, u
intptr_t ADDRESS = 0>
134 typedef volatile T* pointer;
135 typedef volatile const T* const_pointer;
136 typedef volatile T& reference;
137 typedef volatile const T& const_reference;
142 return *
reinterpret_cast<const_pointer
>(ADDRESS);
148 return *
reinterpret_cast<const_pointer
>(ADDRESS);
154 return *
reinterpret_cast<const_pointer
>(ADDRESS);
172 return reinterpret_cast<pointer
>(ADDRESS);
178 return reinterpret_cast<const_pointer
>(ADDRESS);
184 void operator =(T value);
193 template <
typename T, u
intptr_t ADDRESS = 0>
198 typedef volatile T* pointer;
199 typedef volatile const T* const_pointer;
200 typedef volatile T& reference;
201 typedef volatile const T& const_reference;
206 *
reinterpret_cast<pointer
>(ADDRESS) = value;
212 *
reinterpret_cast<pointer
>(ADDRESS) = value_;
236 return reinterpret_cast<pointer
>(ADDRESS);
242 return reinterpret_cast<const_pointer
>(ADDRESS);
257 template <
typename T, u
intptr_t ADDRESS = 0>
262 typedef volatile T* pointer;
263 typedef volatile const T* const_pointer;
264 typedef volatile T& reference;
265 typedef volatile const T& const_reference;
288 shadow_value = value_;
289 *
reinterpret_cast<pointer
>(ADDRESS) = shadow_value;
295 shadow_value = value_;
296 *
reinterpret_cast<pointer
>(ADDRESS) = shadow_value;
327 return reinterpret_cast<pointer
>(ADDRESS);
342 template <
typename T>
347 typedef volatile T* pointer;
348 typedef volatile const T* const_pointer;
349 typedef volatile T& reference;
350 typedef volatile const T& const_reference;
354 : address(ETL_NULLPTR)
360 : address(reinterpret_cast<pointer>(address_))
366 : address(reinterpret_cast<pointer>(other_.address))
373 address = other_.address;
380 address =
reinterpret_cast<pointer
>(address_);
453 template <
typename T>
458 typedef volatile T* pointer;
459 typedef volatile const T* const_pointer;
460 typedef volatile T& reference;
461 typedef volatile const T& const_reference;
465 : address(ETL_NULLPTR)
471 : address(reinterpret_cast<pointer>(address_))
477 : address(reinterpret_cast<pointer>(other_.address))
484 address = other_.address;
491 address =
reinterpret_cast<pointer
>(address_);
533 void operator =(T value);
542 template <
typename T>
547 typedef volatile T* pointer;
548 typedef volatile const T* const_pointer;
549 typedef volatile T& reference;
550 typedef volatile const T& const_reference;
554 : address(ETL_NULLPTR)
560 : address(reinterpret_cast<pointer>(address_))
566 : address(reinterpret_cast<pointer>(other_.address))
573 address = other_.address;
580 address =
reinterpret_cast<pointer
>(address_);
637 template <
typename T>
642 typedef volatile T* pointer;
643 typedef volatile const T* const_pointer;
644 typedef volatile T& reference;
645 typedef volatile const T& const_reference;
706 : address(ETL_NULLPTR)
712 : address(reinterpret_cast<pointer>(address_))
718 : shadow_value(other_.shadow_value),
719 address(reinterpret_cast<pointer>(other_.address))
726 shadow_value = other_.shadow_value;
727 address = other_.address;
734 address =
reinterpret_cast<pointer
>(address_);
770 shadow_value = value_;
771 *address = shadow_value;
777 shadow_value = value_;
778 *address = shadow_value;
void set_address(void *address_)
Set the IO port address.
Definition: io_port.h:489
const_pointer get_address() const
Get the IO port address.
Definition: io_port.h:495
T read() const
Read.
Definition: io_port.h:507
io_port_ro(void *address_)
Constructor.
Definition: io_port.h:470
io_port_ro()
Default constructor.
Definition: io_port.h:464
io_port_ro(const io_port_ro &other_)
Copy Constructor.
Definition: io_port.h:476
Read only port.
Definition: io_port.h:131
io_port_ro & operator++()
Increment.
Definition: io_port.h:158
T read() const
Read.
Definition: io_port.h:146
pointer get_address()
Get the IO port address.
Definition: io_port.h:170
const_pointer get_address() const
Get the IO port address.
Definition: io_port.h:176
const_reference operator*() const
Read.
Definition: io_port.h:152
const_pointer get_address() const
Get the IO port address.
Definition: io_port.h:390
pointer get_address()
Get the IO port address.
Definition: io_port.h:384
T read() const
Read.
Definition: io_port.h:402
io_port_rw(const io_port_rw &other_)
Copy Constructor.
Definition: io_port.h:365
void set_address(void *address_)
Set the IO port address.
Definition: io_port.h:378
io_port_rw(void *address_)
Constructor.
Definition: io_port.h:359
io_port_rw()
Default constructor.
Definition: io_port.h:353
void write(T value_)
Write.
Definition: io_port.h:408
Read write port.
Definition: io_port.h:51
T read() const
Read.
Definition: io_port.h:66
reference operator*()
Read / Write.
Definition: io_port.h:85
pointer get_address()
Get the IO port address.
Definition: io_port.h:109
const_pointer get_address() const
Get the IO port address.
Definition: io_port.h:115
io_port_rw & operator=(T value_)
Write.
Definition: io_port.h:78
io_port_rw & operator++()
Increment.
Definition: io_port.h:97
void write(T value_)
Write.
Definition: io_port.h:72
io_port_wo(const io_port_wo &other_)
Copy Constructor.
Definition: io_port.h:565
void set_address(void *address_)
Set the IO port address.
Definition: io_port.h:578
pointer get_address()
Get the IO port address.
Definition: io_port.h:584
io_port_wo(void *address_)
Constructor.
Definition: io_port.h:559
void write(T value_)
Write.
Definition: io_port.h:596
const_pointer get_address() const
Get the IO port address.
Definition: io_port.h:590
io_port_wo()
Default constructor.
Definition: io_port.h:553
Write only port.
Definition: io_port.h:195
const_pointer get_address() const
Get the IO port address.
Definition: io_port.h:240
void write(T value_)
Write.
Definition: io_port.h:210
pointer get_address()
Get the IO port address.
Definition: io_port.h:234
io_port_wo & operator*()
Write.
Definition: io_port.h:216
void operator=(T value)
Write.
Definition: io_port.h:204
io_port_wo & operator++()
Increment.
Definition: io_port.h:222
Definition: io_port.h:639
const_pointer get_address() const
Get the IO port address.
Definition: io_port.h:744
iterator get_iterator()
Get the iterator.
Definition: io_port.h:750
pointer get_address()
Get the IO port address.
Definition: io_port.h:738
void set_address(void *address_)
Set the IO port address.
Definition: io_port.h:732
void write(T value_)
Write.
Definition: io_port.h:768
io_port_wos(void *address_)
Constructor.
Definition: io_port.h:711
io_port_wos()
Default constructor.
Definition: io_port.h:705
T read() const
Read.
Definition: io_port.h:762
io_port_wos(const io_port_wos &other_)
Copy Constructor.
Definition: io_port.h:717
Write only port with shadow register.
Definition: io_port.h:259
io_port_wos & operator=(T value_)
Write.
Definition: io_port.h:293
void write(T value_)
Write.
Definition: io_port.h:286
io_port_wos & operator++()
Increment.
Definition: io_port.h:313
T read() const
Read.
Definition: io_port.h:280
io_port_wos()
Default constructor.
Definition: io_port.h:268
pointer get_address()
Get the IO port address.
Definition: io_port.h:325
io_port_wos & operator*()
Read / Write.
Definition: io_port.h:301
bitset_ext
Definition: absolute.h:38
iterator
Definition: iterator.h:399