31 #ifndef ETL_IO_PORT_INCLUDED
32 #define ETL_IO_PORT_INCLUDED
51 template <
typename T, u
intptr_t ADDRESS = 0>
56 typedef volatile T* pointer;
57 typedef volatile const T* const_pointer;
58 typedef volatile T& reference;
59 typedef volatile const T& const_reference;
64 return *
reinterpret_cast<const_pointer
>(ADDRESS);
70 return *
reinterpret_cast<const_pointer
>(ADDRESS);
76 *
reinterpret_cast<pointer
>(ADDRESS) = value_;
82 *
reinterpret_cast<pointer
>(ADDRESS) = value_;
89 return *
reinterpret_cast<pointer
>(ADDRESS);
95 return *
reinterpret_cast<const_pointer
>(ADDRESS);
113 return reinterpret_cast<pointer
>(ADDRESS);
119 return reinterpret_cast<const_pointer
>(ADDRESS);
131 template <
typename T, u
intptr_t ADDRESS = 0>
136 typedef volatile T* pointer;
137 typedef volatile const T* const_pointer;
138 typedef volatile T& reference;
139 typedef volatile const T& const_reference;
144 return *
reinterpret_cast<const_pointer
>(ADDRESS);
150 return *
reinterpret_cast<const_pointer
>(ADDRESS);
156 return *
reinterpret_cast<const_pointer
>(ADDRESS);
174 return reinterpret_cast<pointer
>(ADDRESS);
180 return reinterpret_cast<const_pointer
>(ADDRESS);
186 void operator =(T value);
195 template <
typename T, u
intptr_t ADDRESS = 0>
200 typedef volatile T* pointer;
201 typedef volatile const T* const_pointer;
202 typedef volatile T& reference;
203 typedef volatile const T& const_reference;
208 *
reinterpret_cast<pointer
>(ADDRESS) = value;
214 *
reinterpret_cast<pointer
>(ADDRESS) = value_;
238 return reinterpret_cast<pointer
>(ADDRESS);
244 return reinterpret_cast<const_pointer
>(ADDRESS);
259 template <
typename T, u
intptr_t ADDRESS = 0>
264 typedef volatile T* pointer;
265 typedef volatile const T* const_pointer;
266 typedef volatile T& reference;
267 typedef volatile const T& const_reference;
290 shadow_value = value_;
291 *
reinterpret_cast<pointer
>(ADDRESS) = shadow_value;
297 shadow_value = value_;
298 *
reinterpret_cast<pointer
>(ADDRESS) = shadow_value;
329 return reinterpret_cast<pointer
>(ADDRESS);
344 template <
typename T>
349 typedef volatile T* pointer;
350 typedef volatile const T* const_pointer;
351 typedef volatile T& reference;
352 typedef volatile const T& const_reference;
356 : address(ETL_NULLPTR)
362 : address(reinterpret_cast<pointer>(address_))
368 : address(reinterpret_cast<pointer>(other_.address))
375 address = other_.address;
382 address =
reinterpret_cast<pointer
>(address_);
455 template <
typename T>
460 typedef volatile T* pointer;
461 typedef volatile const T* const_pointer;
462 typedef volatile T& reference;
463 typedef volatile const T& const_reference;
467 : address(ETL_NULLPTR)
473 : address(reinterpret_cast<pointer>(address_))
479 : address(reinterpret_cast<pointer>(other_.address))
486 address = other_.address;
493 address =
reinterpret_cast<pointer
>(address_);
535 void operator =(T value);
544 template <
typename T>
549 typedef volatile T* pointer;
550 typedef volatile const T* const_pointer;
551 typedef volatile T& reference;
552 typedef volatile const T& const_reference;
556 : address(ETL_NULLPTR)
562 : address(reinterpret_cast<pointer>(address_))
568 : address(reinterpret_cast<pointer>(other_.address))
575 address = other_.address;
582 address =
reinterpret_cast<pointer
>(address_);
639 template <
typename T>
644 typedef volatile T* pointer;
645 typedef volatile const T* const_pointer;
646 typedef volatile T& reference;
647 typedef volatile const T& const_reference;
708 : address(ETL_NULLPTR)
714 : address(reinterpret_cast<pointer>(address_))
720 : shadow_value(other_.shadow_value),
721 address(reinterpret_cast<pointer>(other_.address))
728 shadow_value = other_.shadow_value;
729 address = other_.address;
736 address =
reinterpret_cast<pointer
>(address_);
772 shadow_value = value_;
773 *address = shadow_value;
779 shadow_value = value_;
780 *address = shadow_value;
void set_address(void *address_)
Set the IO port address.
Definition: io_port.h:491
const_pointer get_address() const
Get the IO port address.
Definition: io_port.h:497
T read() const
Read.
Definition: io_port.h:509
io_port_ro(void *address_)
Constructor.
Definition: io_port.h:472
io_port_ro()
Default constructor.
Definition: io_port.h:466
io_port_ro(const io_port_ro &other_)
Copy Constructor.
Definition: io_port.h:478
Read only port.
Definition: io_port.h:133
T read() const
Read.
Definition: io_port.h:148
pointer get_address()
Get the IO port address.
Definition: io_port.h:172
io_port_ro & operator++()
Increment.
Definition: io_port.h:160
const_pointer get_address() const
Get the IO port address.
Definition: io_port.h:178
const_reference operator*() const
Read.
Definition: io_port.h:154
const_pointer get_address() const
Get the IO port address.
Definition: io_port.h:392
pointer get_address()
Get the IO port address.
Definition: io_port.h:386
T read() const
Read.
Definition: io_port.h:404
io_port_rw(const io_port_rw &other_)
Copy Constructor.
Definition: io_port.h:367
void set_address(void *address_)
Set the IO port address.
Definition: io_port.h:380
io_port_rw(void *address_)
Constructor.
Definition: io_port.h:361
io_port_rw()
Default constructor.
Definition: io_port.h:355
void write(T value_)
Write.
Definition: io_port.h:410
Read write port.
Definition: io_port.h:53
T read() const
Read.
Definition: io_port.h:68
reference operator*()
Read / Write.
Definition: io_port.h:87
io_port_rw & operator++()
Increment.
Definition: io_port.h:99
pointer get_address()
Get the IO port address.
Definition: io_port.h:111
const_pointer get_address() const
Get the IO port address.
Definition: io_port.h:117
io_port_rw & operator=(T value_)
Write.
Definition: io_port.h:80
void write(T value_)
Write.
Definition: io_port.h:74
io_port_wo(const io_port_wo &other_)
Copy Constructor.
Definition: io_port.h:567
void set_address(void *address_)
Set the IO port address.
Definition: io_port.h:580
pointer get_address()
Get the IO port address.
Definition: io_port.h:586
io_port_wo(void *address_)
Constructor.
Definition: io_port.h:561
void write(T value_)
Write.
Definition: io_port.h:598
const_pointer get_address() const
Get the IO port address.
Definition: io_port.h:592
io_port_wo()
Default constructor.
Definition: io_port.h:555
Write only port.
Definition: io_port.h:197
io_port_wo & operator*()
Write.
Definition: io_port.h:218
const_pointer get_address() const
Get the IO port address.
Definition: io_port.h:242
void write(T value_)
Write.
Definition: io_port.h:212
pointer get_address()
Get the IO port address.
Definition: io_port.h:236
io_port_wo & operator++()
Increment.
Definition: io_port.h:224
void operator=(T value)
Write.
Definition: io_port.h:206
Definition: io_port.h:641
const_pointer get_address() const
Get the IO port address.
Definition: io_port.h:746
iterator get_iterator()
Get the iterator.
Definition: io_port.h:752
pointer get_address()
Get the IO port address.
Definition: io_port.h:740
void set_address(void *address_)
Set the IO port address.
Definition: io_port.h:734
void write(T value_)
Write.
Definition: io_port.h:770
io_port_wos(void *address_)
Constructor.
Definition: io_port.h:713
io_port_wos()
Default constructor.
Definition: io_port.h:707
T read() const
Read.
Definition: io_port.h:764
io_port_wos(const io_port_wos &other_)
Copy Constructor.
Definition: io_port.h:719
Write only port with shadow register.
Definition: io_port.h:261
void write(T value_)
Write.
Definition: io_port.h:288
io_port_wos & operator*()
Read / Write.
Definition: io_port.h:303
io_port_wos & operator=(T value_)
Write.
Definition: io_port.h:295
T read() const
Read.
Definition: io_port.h:282
io_port_wos()
Default constructor.
Definition: io_port.h:270
pointer get_address()
Get the IO port address.
Definition: io_port.h:327
io_port_wos & operator++()
Increment.
Definition: io_port.h:315
Definition: absolute.h:37
iterator
Definition: iterator.h:422