group::QEI

The Quadrature Encoder Interface (QEI) provides to MCUs’ hardware encoders used to monitor the speed and direction of motors and other rotary devices.

More information about accessing peripheral IO is in the Device Interface section.

Details

defineQEI_VERSION


defineQEI_IOC_IDENT_CHAR


defineQEI_SAMPLE_T


defineI_QEI_GETVERSION


defineI_QEI_GETINFO


defineI_QEI_SETATTR


defineI_QEI_SETACTION


defineI_QEI_GET

This request reads the QEI position.

Example:

u32 value;
value = ioctl(qei_fd, I_QEI_READ);

defineI_QEI_GETVELOCITY

This request reads the QEI velocity.

Example:

int32_t velocity;
velocity = ioctl(qei_fd, I_QEI_GETVELOCITY);

defineI_QEI_GET_VELOCITY


defineI_QEI_GETINDEX

This request reads the QEI index counter.

Example:

int32_t index_pulses;
index_pulses = ioctl(qei_fd, I_QEI_GETINDEX);

defineI_QEI_GET_INDEX


defineI_QEI_TOTAL


enumqei_flag_t

  • QEI_FLAG_NONE
  • QEI_FLAG_SET Set the QEI attributes
  • QEI_FLAG_IS_INVERT_DIR Invert the direction
  • QEI_FLAG_IS_SIGNAL_MODE Use signal mode
  • QEI_FLAG_IS_DOUBLE_EDGE Count both edges
  • QEI_FLAG_IS_INVERT_INDEX Invert the index
  • QEI_FLAG_RESET Reset the QEI
  • QEI_FLAG_IS_RESET_POS Reset the position
  • QEI_FLAG_IS_RESET_VELOCITY Reset the velocity
  • QEI_FLAG_IS_RESET_INDEX Reset the index count
  • QEI_FLAG_IS_RESET_POS_ONINDEX Reset the position on the next index pulse

This defines the bits used in the “mode” member of qei_attr_t.



date: “2019-06-27” layout: post title: struct::qei_info_t katex: true

categories: struct

Methods

Details

public u32o_flags


public u32o_events


public u32resd



date: “2019-06-27” layout: post title: struct::qei_pin_assignment_t katex: true

categories: struct

Methods

Details

publicmcu_pin_ta


publicmcu_pin_tb


publicmcu_pin_tidx



date: “2019-06-27” layout: post title: struct::qei_attr_t katex: true

categories: struct

This structure defines how the control structure for opening or reconfiguring the QEI port.

Methods

Details

public u32o_flags

Flag bitmask


public qei_pin_assignment_tpin_assignment

Pin assignment


public u32freq


public u32top

Maximum value


public u32velocity_freq


public u32max_position

The maximum position (QEI rolls over at this point)


public u32velocity_comp

The Velocity compare value


public u32filter

The filter coefficient (0 to disable)


public u32resd


X

Thanks for Coming!

Subscribe to news and updates