|
ethercatcpp
|
#include <coe_utilities.h>
Public Member Functions | |
| PDOBuffer ()=delete | |
| PDOBuffer (bool is_tx, uint16_t addr_, uint32_t flags_) | |
| template<typename... T> | |
| PDOBuffer (bool is_tx, uint16_t addr, uint32_t flags, T &&... mappings) | |
| bool | add_mapping (const PDOMapping &mapping, bool may_throw=false) |
| add a mapping to the buffer More... | |
| template<typename... T> | |
| void | add_mappings (T &&... mappings) |
| Fill buffer from a list of mappings. More... | |
| void | bind (uint8_t *data) |
| Bind the buffer to a memory zone. More... | |
| bool | contains_mapping (const PDOMapping &mapping) const |
| Tell whether the buffer contains a given mapping. More... | |
| size_t | mapping_memory_shift (const PDOMapping &mapping) const |
| Get the shift in buffer memory to access mapping data. More... | |
| size_t | entry_memory_shift (const PDOMapping &mapping, std::string_view entry) const |
| Get the shift in buffer memory to access a mapping entry data. More... | |
| template<typename T > | |
| T & | map_memory (const PDOMapping &mapping, std::string_view entry_name) |
| Map the entry of a mapping to a typed reference. More... | |
| template<typename T > | |
| const T & | map_memory (const PDOMapping &mapping, std::string_view entry_name) const |
| Map the entry of a mapping to a typed const reference. More... | |
| template<typename T > | |
| T & | map_memory (const PDOMapping &mapping) |
| Map a mapping to a typed reference. More... | |
| template<typename T > | |
| const T & | map_memory (const PDOMapping &mapping) const |
| Map a mapping to a typed reference. More... | |
| template<typename T , typename U , typename... Other> | |
| std::tuple< T &, U &, Other &... > | map_memory () |
| Map the entire buffer to a typed reference. More... | |
| template<typename T , typename U , typename... Other> | |
| std::tuple< const T &, const U &, const Other &... > | map_memory () const |
| Map the entire buffer to a typed const reference. More... | |
| template<typename T > | |
| T & | map_memory () |
| Map the entire buffer to a typed reference. More... | |
| template<typename T > | |
| const T & | map_memory () const |
| Map the entire buffer to a typed rconst eference. More... | |
| uint16_t | memory_size () const |
| Get size of the buffer in memory. More... | |
| void | define_physical_buffer (SlaveDevice ð_slave) |
| define the physical buffer of an ethercat slave More... | |
| bool | configure (SlaveDevice ð_slave) const |
| Configure an ethercat unit device with the corresponding buffer and mappings. More... | |
| bool | assign (SlaveDevice ð_slave) const |
| Configure an ethercat unit device with the corresponding assigned PDO mappings. More... | |
| void | bind_physical_buffer (SlaveDevice ð_slave) |
| bind internal memory zone to the physical buffer of an ethercat slave More... | |
Private Member Functions | |
| void | check_mapping_throws (const PDOMapping &mapping) const |
| void | check_mapping_size_throws (const PDOMapping &mapping, size_t bytes) const |
| uint8_t * | map_memory_internal (const PDOMapping &mapping, size_t bytes) |
| const uint8_t * | map_memory_internal (const PDOMapping &mapping, size_t bytes) const |
| const uint8_t * | map_memory_internal (const PDOMapping &mapping, std::string_view entry_name, size_t bytes) const |
| uint8_t * | map_memory_internal (const PDOMapping &mapping, std::string_view entry_name, size_t bytes) |
| void | check_entry_throws (const PDOMapping &mapping, std::string_view entry_name, size_t bytes) const |
| size_t | compute_shift (const PDOMapping &mapping, std::string_view entry_name) const |
| const PDOMapping & | access_mapping (size_t idx) const |
| template<typename T > | |
| std::tuple< T & > | map_memory_tuple (size_t mapping_increment) |
| template<typename T , typename U , typename... Other> | |
| std::tuple< T &, U &, Other &... > | map_memory_tuple (size_t mapping_increment) |
| template<typename T , typename U , typename... Other> | |
| std::tuple< const T &, const U &, const Other &... > | map_memory_tuple (size_t mapping_increment) const |
| template<typename T > | |
| std::tuple< const T & > | map_memory_tuple (size_t mapping_increment) const |
Private Attributes | |
| std::vector< const PDOMapping * > | mappings_ |
| uint8_t * | data_ |
| bool | is_tx_ |
| uint16_t | addr_ |
| uint32_t | flags_ |
|
delete |
| ethercatcpp::coe::PDOBuffer::PDOBuffer | ( | bool | is_tx, |
| uint16_t | addr_, | ||
| uint32_t | flags_ | ||
| ) |
|
inline |
|
private |
| bool ethercatcpp::coe::PDOBuffer::add_mapping | ( | const PDOMapping & | mapping, |
| bool | may_throw = false |
||
| ) |
add a mapping to the buffer
| mapping | the mapping to add |
|
inline |
Fill buffer from a list of mappings.
| T | is a variadic template made of any number of PDOMapping |
| mappings | the list of PDO mappings |
| bool ethercatcpp::coe::PDOBuffer::assign | ( | SlaveDevice & | eth_slave | ) | const |
Configure an ethercat unit device with the corresponding assigned PDO mappings.
this call is intended to be used in configuration function (configure_at_init()). Copared to configure() this function only performs assignment but no mapping definition.
| eth_slave | the unit device to configure |
| void ethercatcpp::coe::PDOBuffer::bind | ( | uint8_t * | data | ) |
Bind the buffer to a memory zone.
| data | the pointer to the memory zone to bind |
| void ethercatcpp::coe::PDOBuffer::bind_physical_buffer | ( | SlaveDevice & | eth_slave | ) |
bind internal memory zone to the physical buffer of an ethercat slave
this function must be called during call to master init() function. To do so, use it in init_step function of the device. The call to define_physical_buffer() is not mandatory as long as the physical buffer has been correctly defined with same parameters (addr and flags) as those used in this object. After this call all "map_memory" functions can be used.
| eth_slave | the target unit device |
|
private |
|
private |
|
private |
|
private |
| bool ethercatcpp::coe::PDOBuffer::configure | ( | SlaveDevice & | eth_slave | ) | const |
Configure an ethercat unit device with the corresponding buffer and mappings.
this call is intended to be used in configuration function (configure_at_init()). If your code use predefined mappings and assignment simply do not call this function.
| eth_slave | the unit device to configure |
| bool ethercatcpp::coe::PDOBuffer::contains_mapping | ( | const PDOMapping & | mapping | ) | const |
Tell whether the buffer contains a given mapping.
| mapping | the mapping to check |
| void ethercatcpp::coe::PDOBuffer::define_physical_buffer | ( | SlaveDevice & | eth_slave | ) |
define the physical buffer of an ethercat slave
only advantage using this function is to avoid problem with memory size. This function is intended to be called at unit device construction time
| eth_slave | the target unit device |
| size_t ethercatcpp::coe::PDOBuffer::entry_memory_shift | ( | const PDOMapping & | mapping, |
| std::string_view | entry | ||
| ) | const |
Get the shift in buffer memory to access a mapping entry data.
| mapping | the mapping defining the entry |
| entry | the name of the entry |
|
inline |
Map the entire buffer to a typed reference.
| T | type of the mapped reference |
|
inline |
Map the entire buffer to a typed reference.
| T | type of the mapped reference |
|
inline |
Map the entire buffer to a typed const reference.
| T | type of the mapped reference |
|
inline |
Map the entire buffer to a typed rconst eference.
| T | type of the mapped reference |
|
inline |
Map a mapping to a typed reference.
| T | type of the mapped reference |
|
inline |
Map a mapping to a typed reference.
| T | type of the mapped reference |
|
inline |
Map the entry of a mapping to a typed reference.
| T | type of the mapped reference |
|
inline |
Map the entry of a mapping to a typed const reference.
| T | type of the mapped reference |
|
private |
|
private |
|
private |
|
private |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
| size_t ethercatcpp::coe::PDOBuffer::mapping_memory_shift | ( | const PDOMapping & | mapping | ) | const |
Get the shift in buffer memory to access mapping data.
| mapping | the mapping to get shifting for |
| uint16_t ethercatcpp::coe::PDOBuffer::memory_size | ( | ) | const |
Get size of the buffer in memory.
this function can be used when calling define_physical_buffer to set the adequate size
|
private |
|
private |
|
private |
|
private |
|
private |
1.8.17