Represent a CANOpen PDO mapping.
More...
#include <coe_utilities.h>
Represent a CANOpen PDO mapping.
◆ const_iterator
◆ iterator
◆ PDOMapping() [1/2]
| ethercatcpp::coe::PDOMapping::PDOMapping |
( |
ObjectDictionary & |
dico, |
|
|
uint8_t |
idx, |
|
|
bool |
is_tx |
|
) |
| |
Construct a new PDOMapping object.
index of the mapping is relative to 0x1600 in RX and 0x1A00 if TX
- Parameters
-
| dico | the dictionary referenced by the PDO mapping |
| idx | index of the mapping |
| is_tx | true if tx (master in) mapping, false if rx (master out) mapping |
◆ PDOMapping() [2/2]
| ethercatcpp::coe::PDOMapping::PDOMapping |
( |
ObjectDictionary & |
dico, |
|
|
uint8_t |
idx, |
|
|
bool |
is_tx, |
|
|
std::initializer_list< std::string_view > |
objects |
|
) |
| |
Construct a new PDOMapping object.
index of the mapping is relative to 0x1600 in RX and 0x1A00 if TX
- Parameters
-
| dico | the dictionary referenced by the PDO mapping |
| idx | index of the mapping |
| is_tx | true if tx (master in) mapping, false if rx (master out) mapping |
| objects | list of objects (in order) that define the mapping |
◆ add_object()
| void ethercatcpp::coe::PDOMapping::add_object |
( |
std::string_view |
obj | ) |
|
add an object to the mapping
- Parameters
-
| obj | the name of the object's entry in dictionary |
◆ begin()
get first iterator on mapped objects
- Returns
- const_iterator
◆ check_buffer()
template<typename T >
| bool ethercatcpp::coe::PDOMapping::check_buffer |
( |
| ) |
|
|
inline |
Check whether a type can be used as a buffer for this mapping.
- Template Parameters
-
| T | the type to check against |
- Returns
- true if type size match, false otherwise
◆ check_entry_size()
| bool ethercatcpp::coe::PDOMapping::check_entry_size |
( |
std::string_view |
obj, |
|
|
size_t |
bytes |
|
) |
| const |
Check whether an entry has corresponding size.
- Parameters
-
| obj | the object to check |
| bytes | the size to check |
- Returns
- true if type size match, false otherwise
◆ check_entry_throws()
| void ethercatcpp::coe::PDOMapping::check_entry_throws |
( |
std::string_view |
obj | ) |
const |
|
private |
◆ configure()
| bool ethercatcpp::coe::PDOMapping::configure |
( |
SlaveDevice & |
eth_slave | ) |
const |
Configure an ethercat unit device with the corresponding mapping.
will reset the mapping in device memory and will reset it accordingly to the mapping description
- Parameters
-
| eth_slave | the unit device to configure |
- Returns
- true i configuration succeeded, false otherwise
◆ dictionary()
Access reference dictionary.
- Returns
- const reference on dictionary used by mapping
◆ end()
get terminal iterator on mapped objects
- Returns
- const_iterator
◆ has_entry()
| bool ethercatcpp::coe::PDOMapping::has_entry |
( |
std::string_view |
entry | ) |
const |
Check whether the mapping use the corresponding entry.
- Parameters
-
| entry | the CANOpen dictionary entry to check |
- Returns
- true if mapping has entry, false otherwise
◆ is_tx()
| bool ethercatcpp::coe::PDOMapping::is_tx |
( |
| ) |
const |
Give the type of mapping (TX or RX)
- Returns
- true if mapping is a TX mapping, false if it is a RX mapping
◆ map_addr()
| uint16_t ethercatcpp::coe::PDOMapping::map_addr |
( |
| ) |
const |
get address of the mapping in device memory
depends on specified TR/RX and index
- Returns
- uint16_t the mapping address
◆ memory_shift()
| size_t ethercatcpp::coe::PDOMapping::memory_shift |
( |
std::string_view |
obj | ) |
const |
Get memory shift to access a given object of the mapping.
- Parameters
-
| obj | the name of the object in dictionary |
- Returns
- size_t the shift to access the object, relative to mapping memory
◆ memory_size()
| size_t ethercatcpp::coe::PDOMapping::memory_size |
( |
| ) |
const |
Get total size in bytes of the mapping.
- Returns
- size_t the size of the mapping
◆ reset()
| void ethercatcpp::coe::PDOMapping::reset |
( |
| ) |
|
◆ index_
| uint8_t ethercatcpp::coe::PDOMapping::index_ |
|
private |
◆ is_tx_
| bool ethercatcpp::coe::PDOMapping::is_tx_ |
|
private |
◆ objects_mapping_
| std::vector<std::pair<uint8_t, uint32_t> > ethercatcpp::coe::PDOMapping::objects_mapping_ |
|
private |
◆ reference_dictionnary_
The documentation for this class was generated from the following file: