Skip to content

Commit

Permalink
update pregenerated bindings to 1.6.1 (fixes #48)
Browse files Browse the repository at this point in the history
Otherwise, no changes needed for stable-1.6 branch
  • Loading branch information
birkenfeld committed Aug 10, 2024
1 parent f73dcf0 commit 5a7d450
Show file tree
Hide file tree
Showing 8 changed files with 185 additions and 104 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
run: |
git clone https://gitlab.com/etherlab.org/ethercat ethercat-git
cd ethercat-git
git checkout stable-1.5
git checkout stable-1.6
./bootstrap
./configure --disable-8139too
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## Unreleased

- Update to stable-1.6 branch of master code (#48)
- Update `pregenerated-bindings` to tag 1.6.1 of the master code

## v0.3.1 (2023-10-14)

- Bump MSRV to 1.63.0
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ environment variable `ETHERCAT_PATH` to the location of a checkout of the IgH
Etherlab repository, *after running `configure` there*.

The IgH repository is located at <https://gitlab.com/etherlab.org/ethercat>.
Please switch to the ``stable-1.5`` branch in the checkout.
Please switch to the ``stable-1.6`` branch in the checkout.

Bindings have been pregenerated for revision `c022ddbcf254` - if you activate
the feature `pregenerated-bindings`, you don't need the master code to build,
but the kernel modules must match that revision.
Bindings have been pregenerated for the tag `1.6.1` - if you activate the
feature `pregenerated-bindings`, you don't need the master code to build, but
the kernel modules must match that revision.

The minimum tested Rust version is 1.63.0.

Expand Down
2 changes: 1 addition & 1 deletion ethercat-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ edition = "2018"
ioctl-sys = "0.5.2"

[build-dependencies]
bindgen = "0.63.0"
bindgen = "0.69.0"
regex = "=1.9.6"
# for 1.63 compatibility
home = "=0.5.5"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* automatically generated by rust-bindgen 0.63.0 */
/* automatically generated by rust-bindgen 0.69.4 */

#[repr(C)]
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
Expand Down Expand Up @@ -86,12 +86,19 @@ pub const EC_MAX_STRING_LENGTH: u32 = 64;
pub const EC_MAX_PORTS: u32 = 4;
pub const EC_MAX_SII_SIZE: u32 = 4096;
pub const EC_MAX_FMMUS: u32 = 16;
pub const EC_MAX_HOSTNAME_SIZE: u32 = 32;
pub const EC_IOCTL_TYPE: u32 = 164;
pub const EC_IOCTL_VERSION_MAGIC: u32 = 31;
pub const EC_IOCTL_VERSION_MAGIC: u32 = 37;
pub const EC_IOCTL_STRING_SIZE: u32 = 64;
pub const EC_MAX_SDO_DATA_SIZE: u32 = 1024;
pub const EC_MAX_IDN_DATA_SIZE: u32 = 1024;
pub const EC_MAX_FLAG_KEY_SIZE: u32 = 128;
pub type in_addr_t = u32;
#[repr(C)]
#[derive(Default, Copy, Clone)]
pub struct in_addr {
pub s_addr: in_addr_t,
}
#[doc = " Master state.\n\n This is used for the output parameter of ecrt_master_state().\n\n \\see ecrt_master_state()."]
#[repr(C)]
#[derive(Default, Copy, Clone)]
Expand Down Expand Up @@ -345,7 +352,7 @@ pub const EC_AL_STATE_OP: ec_al_state_t = 8;
#[doc = " Application-layer state."]
pub type ec_al_state_t = ::std::os::raw::c_uint;
#[doc = " Slave information interface CANopen over EtherCAT details flags."]
#[repr(C, packed)]
#[repr(C)]
#[derive(Default, Copy, Clone)]
pub struct ec_sii_coe_details_t {
pub _bitfield_align_1: [u8; 0],
Expand Down Expand Up @@ -459,7 +466,7 @@ impl ec_sii_coe_details_t {
}
}
#[doc = " Slave information interface general flags."]
#[repr(C, packed)]
#[repr(C)]
#[derive(Default, Copy, Clone)]
pub struct ec_sii_general_flags_t {
pub _bitfield_align_1: [u8; 0],
Expand Down Expand Up @@ -529,6 +536,7 @@ pub struct ec_ioctl_module_t {
#[derive(Default, Copy, Clone)]
pub struct ec_ioctl_master_t {
pub slave_count: u32,
pub scan_index: u32,
pub config_count: u32,
pub domain_count: u32,
pub eoe_handler_count: u32,
Expand Down Expand Up @@ -1066,6 +1074,25 @@ pub struct ec_ioctl_eoe_handler_t {
pub tx_queue_size: u32,
}
#[repr(C)]
#[derive(Default, Copy, Clone)]
pub struct ec_ioctl_eoe_ip_t {
pub slave_position: u16,
pub config_index: u16,
pub mac_address_included: u8,
pub ip_address_included: u8,
pub subnet_mask_included: u8,
pub gateway_included: u8,
pub dns_included: u8,
pub name_included: u8,
pub mac_address: [::std::os::raw::c_uchar; 6usize],
pub ip_address: in_addr,
pub subnet_mask: in_addr,
pub gateway: in_addr,
pub dns: in_addr,
pub name: [::std::os::raw::c_char; 32usize],
pub result: u16,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct ec_ioctl_master_activate_t {
pub process_data: *mut ::std::os::raw::c_void,
Expand Down Expand Up @@ -1197,6 +1224,23 @@ impl Default for ec_ioctl_sc_flag_t {
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct ec_ioctl_sc_state_timeout_t {
pub config_index: u32,
pub from_state: ec_al_state_t,
pub to_state: ec_al_state_t,
pub timeout_ms: u32,
}
impl Default for ec_ioctl_sc_state_timeout_t {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct ec_ioctl_domain_state_t {
pub domain_index: u32,
pub state: *mut ec_domain_state_t,
Expand Down Expand Up @@ -1233,6 +1277,27 @@ impl Default for ec_ioctl_sdo_request_t {
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct ec_ioctl_soe_request_t {
pub config_index: u32,
pub request_index: u32,
pub drive_no: u8,
pub idn: u16,
pub size: usize,
pub data: *mut u8,
pub timeout: u32,
pub state: ec_request_state_t,
}
impl Default for ec_ioctl_soe_request_t {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct ec_ioctl_reg_request_t {
pub config_index: u32,
pub mem_size: usize,
Expand Down
92 changes: 0 additions & 92 deletions ethercat-sys/src/ioctls-v1.5-c022ddbcf254.rs

This file was deleted.

103 changes: 103 additions & 0 deletions ethercat-sys/src/ioctls-v1.6.1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
ioctl!(read MODULE with EC, 0x00; ec_ioctl_module_t);
ioctl!(read MASTER with EC, 0x01; ec_ioctl_master_t);
ioctl!(readwrite SLAVE with EC, 0x02; ec_ioctl_slave_t);
ioctl!(readwrite SLAVE_SYNC with EC, 0x03; ec_ioctl_slave_sync_t);
ioctl!(readwrite SLAVE_SYNC_PDO with EC, 0x04; ec_ioctl_slave_sync_pdo_t);
ioctl!(readwrite SLAVE_SYNC_PDO_ENTRY with EC, 0x05; ec_ioctl_slave_sync_pdo_entry_t);
ioctl!(readwrite DOMAIN with EC, 0x06; ec_ioctl_domain_t);
ioctl!(readwrite DOMAIN_FMMU with EC, 0x07; ec_ioctl_domain_fmmu_t);
ioctl!(readwrite DOMAIN_DATA with EC, 0x08; ec_ioctl_domain_data_t);
ioctl!(none MASTER_DEBUG with EC, 0x09);
ioctl!(none MASTER_RESCAN with EC, 0x0a);
ioctl!(write SLAVE_STATE with EC, 0x0b; ec_ioctl_slave_state_t);
ioctl!(readwrite SLAVE_SDO with EC, 0x0c; ec_ioctl_slave_sdo_t);
ioctl!(readwrite SLAVE_SDO_ENTRY with EC, 0x0d; ec_ioctl_slave_sdo_entry_t);
ioctl!(readwrite SLAVE_SDO_UPLOAD with EC, 0x0e; ec_ioctl_slave_sdo_upload_t);
ioctl!(readwrite SLAVE_SDO_DOWNLOAD with EC, 0x0f; ec_ioctl_slave_sdo_download_t);
ioctl!(readwrite SLAVE_SII_READ with EC, 0x10; ec_ioctl_slave_sii_t);
ioctl!(write SLAVE_SII_WRITE with EC, 0x11; ec_ioctl_slave_sii_t);
ioctl!(readwrite SLAVE_REG_READ with EC, 0x12; ec_ioctl_slave_reg_t);
ioctl!(write SLAVE_REG_WRITE with EC, 0x13; ec_ioctl_slave_reg_t);
ioctl!(readwrite SLAVE_FOE_READ with EC, 0x14; ec_ioctl_slave_foe_t);
ioctl!(write SLAVE_FOE_WRITE with EC, 0x15; ec_ioctl_slave_foe_t);
ioctl!(readwrite SLAVE_SOE_READ with EC, 0x16; ec_ioctl_slave_soe_read_t);
ioctl!(readwrite SLAVE_SOE_WRITE with EC, 0x17; ec_ioctl_slave_soe_write_t);
ioctl!(write SLAVE_EOE_IP_PARAM with EC, 0x18; ec_ioctl_eoe_ip_t);
ioctl!(readwrite CONFIG with EC, 0x19; ec_ioctl_config_t);
ioctl!(readwrite CONFIG_PDO with EC, 0x1a; ec_ioctl_config_pdo_t);
ioctl!(readwrite CONFIG_PDO_ENTRY with EC, 0x1b; ec_ioctl_config_pdo_entry_t);
ioctl!(readwrite CONFIG_SDO with EC, 0x1c; ec_ioctl_config_sdo_t);
ioctl!(readwrite CONFIG_IDN with EC, 0x1d; ec_ioctl_config_idn_t);
ioctl!(readwrite CONFIG_FLAG with EC, 0x1e; ec_ioctl_config_flag_t);
ioctl!(readwrite CONFIG_EOE_IP_PARAM with EC, 0x1f; ec_ioctl_eoe_ip_t);
ioctl!(readwrite EOE_HANDLER with EC, 0x20; ec_ioctl_eoe_handler_t);
ioctl!(none REQUEST with EC, 0x21);
ioctl!(none CREATE_DOMAIN with EC, 0x22);
ioctl!(readwrite CREATE_SLAVE_CONFIG with EC, 0x23; ec_ioctl_config_t);
ioctl!(write SELECT_REF_CLOCK with EC, 0x24; u32);
ioctl!(read ACTIVATE with EC, 0x25; ec_ioctl_master_activate_t);
ioctl!(none DEACTIVATE with EC, 0x26);
ioctl!(arg SEND with EC, 0x27);
ioctl!(none RECEIVE with EC, 0x28);
ioctl!(read MASTER_STATE with EC, 0x29; ec_master_state_t);
ioctl!(readwrite MASTER_LINK_STATE with EC, 0x2a; ec_ioctl_link_state_t);
ioctl!(write APP_TIME with EC, 0x2b; u64);
ioctl!(none SYNC_REF with EC, 0x2c);
ioctl!(write SYNC_REF_TO with EC, 0x2d; u64);
ioctl!(none SYNC_SLAVES with EC, 0x2e);
ioctl!(read REF_CLOCK_TIME with EC, 0x2f; u32);
ioctl!(none SYNC_MON_QUEUE with EC, 0x30);
ioctl!(read SYNC_MON_PROCESS with EC, 0x31; u32);
ioctl!(none RESET with EC, 0x32);
ioctl!(write SC_SYNC with EC, 0x33; ec_ioctl_config_t);
ioctl!(write SC_WATCHDOG with EC, 0x34; ec_ioctl_config_t);
ioctl!(write SC_ADD_PDO with EC, 0x35; ec_ioctl_config_pdo_t);
ioctl!(write SC_CLEAR_PDOS with EC, 0x36; ec_ioctl_config_pdo_t);
ioctl!(write SC_ADD_ENTRY with EC, 0x37; ec_ioctl_add_pdo_entry_t);
ioctl!(write SC_CLEAR_ENTRIES with EC, 0x38; ec_ioctl_config_pdo_t);
ioctl!(readwrite SC_REG_PDO_ENTRY with EC, 0x39; ec_ioctl_reg_pdo_entry_t);
ioctl!(readwrite SC_REG_PDO_POS with EC, 0x3a; ec_ioctl_reg_pdo_pos_t);
ioctl!(write SC_DC with EC, 0x3b; ec_ioctl_config_t);
ioctl!(write SC_SDO with EC, 0x3c; ec_ioctl_sc_sdo_t);
ioctl!(write SC_EMERG_SIZE with EC, 0x3d; ec_ioctl_sc_emerg_t);
ioctl!(readwrite SC_EMERG_POP with EC, 0x3e; ec_ioctl_sc_emerg_t);
ioctl!(write SC_EMERG_CLEAR with EC, 0x3f; ec_ioctl_sc_emerg_t);
ioctl!(readwrite SC_EMERG_OVERRUNS with EC, 0x40; ec_ioctl_sc_emerg_t);
ioctl!(readwrite SC_SDO_REQUEST with EC, 0x41; ec_ioctl_sdo_request_t);
ioctl!(readwrite SC_SOE_REQUEST with EC, 0x42; ec_ioctl_soe_request_t);
ioctl!(readwrite SC_REG_REQUEST with EC, 0x43; ec_ioctl_reg_request_t);
ioctl!(readwrite SC_VOE with EC, 0x44; ec_ioctl_voe_t);
ioctl!(readwrite SC_STATE with EC, 0x45; ec_ioctl_sc_state_t);
ioctl!(write SC_IDN with EC, 0x46; ec_ioctl_sc_idn_t);
ioctl!(write SC_FLAG with EC, 0x47; ec_ioctl_sc_flag_t);
ioctl!(write SC_EOE_IP_PARAM with EC, 0x48; ec_ioctl_eoe_ip_t);
ioctl!(write SC_STATE_TIMEOUT with EC, 0x49; ec_ioctl_sc_state_timeout_t);
ioctl!(arg DOMAIN_SIZE with EC, 0x4a);
ioctl!(arg DOMAIN_OFFSET with EC, 0x4b);
ioctl!(arg DOMAIN_PROCESS with EC, 0x4c);
ioctl!(arg DOMAIN_QUEUE with EC, 0x4d);
ioctl!(readwrite DOMAIN_STATE with EC, 0x4e; ec_ioctl_domain_state_t);
ioctl!(readwrite SDO_REQUEST_INDEX with EC, 0x4f; ec_ioctl_sdo_request_t);
ioctl!(readwrite SDO_REQUEST_TIMEOUT with EC, 0x50; ec_ioctl_sdo_request_t);
ioctl!(readwrite SDO_REQUEST_STATE with EC, 0x51; ec_ioctl_sdo_request_t);
ioctl!(readwrite SDO_REQUEST_READ with EC, 0x52; ec_ioctl_sdo_request_t);
ioctl!(readwrite SDO_REQUEST_WRITE with EC, 0x53; ec_ioctl_sdo_request_t);
ioctl!(readwrite SDO_REQUEST_DATA with EC, 0x54; ec_ioctl_sdo_request_t);
ioctl!(readwrite SOE_REQUEST_IDN with EC, 0x55; ec_ioctl_soe_request_t);
ioctl!(readwrite SOE_REQUEST_TIMEOUT with EC, 0x56; ec_ioctl_soe_request_t);
ioctl!(readwrite SOE_REQUEST_STATE with EC, 0x57; ec_ioctl_soe_request_t);
ioctl!(readwrite SOE_REQUEST_READ with EC, 0x58; ec_ioctl_soe_request_t);
ioctl!(readwrite SOE_REQUEST_WRITE with EC, 0x59; ec_ioctl_soe_request_t);
ioctl!(readwrite SOE_REQUEST_DATA with EC, 0x5a; ec_ioctl_soe_request_t);
ioctl!(readwrite REG_REQUEST_DATA with EC, 0x5b; ec_ioctl_reg_request_t);
ioctl!(readwrite REG_REQUEST_STATE with EC, 0x5c; ec_ioctl_reg_request_t);
ioctl!(readwrite REG_REQUEST_WRITE with EC, 0x5d; ec_ioctl_reg_request_t);
ioctl!(readwrite REG_REQUEST_READ with EC, 0x5e; ec_ioctl_reg_request_t);
ioctl!(write VOE_SEND_HEADER with EC, 0x5f; ec_ioctl_voe_t);
ioctl!(readwrite VOE_REC_HEADER with EC, 0x60; ec_ioctl_voe_t);
ioctl!(write VOE_READ with EC, 0x61; ec_ioctl_voe_t);
ioctl!(write VOE_READ_NOSYNC with EC, 0x62; ec_ioctl_voe_t);
ioctl!(readwrite VOE_WRITE with EC, 0x63; ec_ioctl_voe_t);
ioctl!(readwrite VOE_EXEC with EC, 0x64; ec_ioctl_voe_t);
ioctl!(readwrite VOE_DATA with EC, 0x65; ec_ioctl_voe_t);
ioctl!(write SET_SEND_INTERVAL with EC, 0x66; usize);
Loading

0 comments on commit 5a7d450

Please sign in to comment.