Zephyr API Documentation 4.4.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
ti_am3352_eqep.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: Copyright (c) 2026 Texas Instruments
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
11
12#ifndef ZEPHYR_INCLUDE_DRIVERS_COUNTER_TI_AM3352_EQEP_H_
13#define ZEPHYR_INCLUDE_DRIVERS_COUNTER_TI_AM3352_EQEP_H_
14
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
29
31#define TI_EQEP_ALARM_CHAN_NUM (4)
32
50
64
78
88
98
112
126
136 bool swap_inputs: 1;
137} __packed;
138
160
190
202
210__syscall void ti_eqep_configure_qep(const struct device *dev,
211 const struct ti_eqep_qep_cfg *qep_cfg);
212
220__syscall void ti_eqep_configure_decoder(const struct device *dev,
221 const struct ti_eqep_dec_cfg *dec_cfg);
222
229__syscall void ti_eqep_configure_capture(const struct device *dev,
230 const struct ti_eqep_cap_cfg *cap_cfg);
231
244__syscall int ti_eqep_get_latched_capture_values(const struct device *dev, uint32_t *timer,
245 uint32_t *period, bool scale);
246
250
251#ifdef __cplusplus
252}
253#endif
254
255#include <zephyr/syscalls/ti_am3352_eqep.h>
256
257#endif /* ZEPHYR_INCLUDE_DRIVERS_COUNTER_TI_AM3352_EQEP_H_ */
Main header file for counter driver API.
void ti_eqep_configure_capture(const struct device *dev, const struct ti_eqep_cap_cfg *cap_cfg)
Configure Edge Capture Unit.
int ti_eqep_get_latched_capture_values(const struct device *dev, uint32_t *timer, uint32_t *period, bool scale)
Get latched capture timer and period values.
ti_eqep_cap_clk_prescaler
Capture timer clock prescaler values.
Definition ti_am3352_eqep.h:142
ti_eqep_alarm_channel
EQEP Event Source Identifiers (Logical Channels).
Definition ti_am3352_eqep.h:40
ti_eqep_reset_mode
Position counter reset mode.
Definition ti_am3352_eqep.h:54
ti_eqep_index_latch
Index event latch mode.
Definition ti_am3352_eqep.h:68
ti_eqep_capture_latch
Capture unit latch mode.
Definition ti_am3352_eqep.h:92
ti_eqep_unit_pos_prescaler
Unit position event prescaler values.
Definition ti_am3352_eqep.h:164
ti_eqep_strobe_latch
Strobe event latch mode.
Definition ti_am3352_eqep.h:82
void ti_eqep_configure_qep(const struct device *dev, const struct ti_eqep_qep_cfg *qep_cfg)
Configure QEP Control.
ti_eqep_src
Position counter source selection.
Definition ti_am3352_eqep.h:116
void ti_eqep_configure_decoder(const struct device *dev, const struct ti_eqep_dec_cfg *dec_cfg)
Configure Decoder Unit.
@ TI_EQEP_CAP_CLK_DIV_64
CAPCLK = EQEP_FICLK/64.
Definition ti_am3352_eqep.h:156
@ TI_EQEP_CAP_CLK_DIV_2
CAPCLK = EQEP_FICLK/2.
Definition ti_am3352_eqep.h:146
@ TI_EQEP_CAP_CLK_DIV_16
CAPCLK = EQEP_FICLK/16.
Definition ti_am3352_eqep.h:152
@ TI_EQEP_CAP_CLK_DIV_128
CAPCLK = EQEP_FICLK/128.
Definition ti_am3352_eqep.h:158
@ TI_EQEP_CAP_CLK_DIV_8
CAPCLK = EQEP_FICLK/8.
Definition ti_am3352_eqep.h:150
@ TI_EQEP_CAP_CLK_DIV_32
CAPCLK = EQEP_FICLK/32.
Definition ti_am3352_eqep.h:154
@ TI_EQEP_CAP_CLK_DIV_4
CAPCLK = EQEP_FICLK/4.
Definition ti_am3352_eqep.h:148
@ TI_EQEP_CAP_CLK_DIV_1
CAPCLK = EQEP_FICLK/1.
Definition ti_am3352_eqep.h:144
@ TI_EQEP_ALARM_CHAN_COMPARE
Alarm for position compare unit.
Definition ti_am3352_eqep.h:42
@ TI_EQEP_ALARM_CHAN_INDEX
Alarm for index event.
Definition ti_am3352_eqep.h:46
@ TI_EQEP_ALARM_CHAN_STROBE
Alarm for strobe event.
Definition ti_am3352_eqep.h:44
@ TI_EQEP_ALARM_CHAN_TIMEOUT
Alarm for unit timeout event.
Definition ti_am3352_eqep.h:48
@ TI_EQEP_RESET_MODE_UNIT_TIME
Reset counter on unit timeout event.
Definition ti_am3352_eqep.h:62
@ TI_EQEP_RESET_MODE_MAX
Reset counter after maximum value.
Definition ti_am3352_eqep.h:58
@ TI_EQEP_RESET_MODE_INDEX
Reset counter on index event.
Definition ti_am3352_eqep.h:56
@ TI_EQEP_RESET_MODE_INDEX_ONCE
Reset counter on only first index event.
Definition ti_am3352_eqep.h:60
@ TI_EQEP_INDEX_LATCH_RESERVED
Reserved value.
Definition ti_am3352_eqep.h:70
@ TI_EQEP_INDEX_LATCH_MARKER
Latch counter and direction flag on index marker.
Definition ti_am3352_eqep.h:76
@ TI_EQEP_INDEX_LATCH_FALLING
Latch counter on index's falling edge.
Definition ti_am3352_eqep.h:74
@ TI_EQEP_INDEX_LATCH_RISING
Latch counter on index's rising edge.
Definition ti_am3352_eqep.h:72
@ TI_EQEP_CAPTURE_LATCH_TIMEOUT
Latch counter, capture timer and capture period on timeout.
Definition ti_am3352_eqep.h:96
@ TI_EQEP_CAPTURE_LATCH_CPU
Latch capture timer and capture period on counter read.
Definition ti_am3352_eqep.h:94
@ TI_EQEP_UNIT_POS_DIV_4
UPEVNT = QCLK/4.
Definition ti_am3352_eqep.h:170
@ TI_EQEP_UNIT_POS_DIV_16
UPEVNT = QCLK/16.
Definition ti_am3352_eqep.h:174
@ TI_EQEP_UNIT_POS_DIV_512
UPEVNT = QCLK/512.
Definition ti_am3352_eqep.h:184
@ TI_EQEP_UNIT_POS_DIV_256
UPEVNT = QCLK/256.
Definition ti_am3352_eqep.h:182
@ TI_EQEP_UNIT_POS_DIV_128
UPEVNT = QCLK/128.
Definition ti_am3352_eqep.h:180
@ TI_EQEP_UNIT_POS_DIV_1024
UPEVNT = QCLK/1024.
Definition ti_am3352_eqep.h:186
@ TI_EQEP_UNIT_POS_DIV_2048
UPEVNT = QCLK/2048.
Definition ti_am3352_eqep.h:188
@ TI_EQEP_UNIT_POS_DIV_64
UPEVNT = QCLK/64.
Definition ti_am3352_eqep.h:178
@ TI_EQEP_UNIT_POS_DIV_8
UPEVNT = QCLK/8.
Definition ti_am3352_eqep.h:172
@ TI_EQEP_UNIT_POS_DIV_1
UPEVNT = QCLK/1.
Definition ti_am3352_eqep.h:166
@ TI_EQEP_UNIT_POS_DIV_32
UPEVNT = QCLK/32.
Definition ti_am3352_eqep.h:176
@ TI_EQEP_UNIT_POS_DIV_2
UPEVNT = QCLK/2.
Definition ti_am3352_eqep.h:168
@ TI_EQEP_STROBE_LATCH_RISING
Latch counter on strobe's rising edge.
Definition ti_am3352_eqep.h:84
@ TI_EQEP_STROBE_LATCH_DIR
Latch counter on strobe's rising edge if clockwise and falling edge if anti-clockwise.
Definition ti_am3352_eqep.h:86
@ TI_EQEP_SRC_DIRECTION
Direction Count Mode.
Definition ti_am3352_eqep.h:120
@ TI_EQEP_SRC_DOWN
Down Count Mode.
Definition ti_am3352_eqep.h:124
@ TI_EQEP_SRC_QUADRATURE
Quadrature Count Mode.
Definition ti_am3352_eqep.h:118
@ TI_EQEP_SRC_UP
Up Count Mode.
Definition ti_am3352_eqep.h:122
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
Runtime device structure (in ROM) per driver instance.
Definition device.h:513
Configuration for capture unit register.
Definition ti_am3352_eqep.h:194
enum ti_eqep_cap_clk_prescaler clock_prescaler
Capture timer clock prescaler.
Definition ti_am3352_eqep.h:198
enum ti_eqep_unit_pos_prescaler unit_position_prescaler
Unit position event prescaler.
Definition ti_am3352_eqep.h:200
bool enable
Enable the capture unit.
Definition ti_am3352_eqep.h:196
Configuration for decoder unit register.
Definition ti_am3352_eqep.h:130
bool swap_inputs
Swap quadrature clock inputs.
Definition ti_am3352_eqep.h:136
enum ti_eqep_src source
Counter source selection.
Definition ti_am3352_eqep.h:132
bool rising_edge_only
Only increment/decrement on the rising edges.
Definition ti_am3352_eqep.h:134
Configuration for QEP control register.
Definition ti_am3352_eqep.h:102
enum ti_eqep_reset_mode reset_mode
Counter reset mode.
Definition ti_am3352_eqep.h:104
enum ti_eqep_strobe_latch strobe_latch
Strobe event latch mode.
Definition ti_am3352_eqep.h:108
enum ti_eqep_index_latch index_latch
Index event latch mode.
Definition ti_am3352_eqep.h:106
enum ti_eqep_capture_latch capture_latch
Capture unit latch mode.
Definition ti_am3352_eqep.h:110