mirs_esp_pio
読み取り中…
検索中…
一致する文字列を見つけられません
Encoder クラス

AMT103-V 直交エンコーダ(PCNT ハードウェア4逓倍計数)。 [詳解]

#include <Encoder.hpp>

公開メンバ関数

 Encoder (uint8_t pin_a, uint8_t pin_b)
void begin ()
int64_t getCount () const
void reset ()
uint32_t countsPerRev () const

静的公開変数類

static constexpr uint32_t PULSES_PER_REV = 2048
static constexpr uint32_t MULTIPLIER = 4
static constexpr int16_t PCNT_LIMIT = 20000

詳解

AMT103-V 直交エンコーダ(PCNT ハードウェア4逓倍計数)。

  • デフォルト 2048 PPR × 4逓倍 = 8192 カウント/回転。
  • ESP32 ハードウェア PCNT を使用して CPU 負荷ゼロで計数。
  • PCNTドライバの累積機能で16-bitカウンタの折返しを吸収し、 連続カウント値として取得します。

Encoder.hpp の 15 行目に定義があります。

構築子と解体子

◆ Encoder()

Encoder::Encoder ( uint8_t pin_a,
uint8_t pin_b )

Encoder.cpp の 9 行目に定義があります。

関数詳解

◆ begin()

void Encoder::begin ( )

Encoder.cpp の 14 行目に定義があります。

◆ countsPerRev()

uint32_t Encoder::countsPerRev ( ) const
inline

Encoder.hpp の 26 行目に定義があります。

◆ getCount()

int64_t Encoder::getCount ( ) const

Encoder.cpp の 65 行目に定義があります。

◆ reset()

void Encoder::reset ( )

Encoder.cpp の 85 行目に定義があります。

メンバ詳解

◆ MULTIPLIER

uint32_t Encoder::MULTIPLIER = 4
staticconstexpr

Encoder.hpp の 18 行目に定義があります。

◆ PCNT_LIMIT

int16_t Encoder::PCNT_LIMIT = 20000
staticconstexpr

Encoder.hpp の 19 行目に定義があります。

◆ PULSES_PER_REV

uint32_t Encoder::PULSES_PER_REV = 2048
staticconstexpr

Encoder.hpp の 17 行目に定義があります。


このクラス詳解は次のファイルから抽出されました: