ユーザ用ツール

サイト用ツール


ja-jp_commands:counter_buffer

文書の過去の版を表示しています。


カウンタとFIFO・FILO

コマンド 説明
Ictu(id, CU, RESET, PV) CUの立ち上がりエッジを数え、PVに達するとONになります。
Ictd(id, CD, LOAD, PV) LOAD後、CDの立ち上がりエッジごとに減少します。
Ictud(id, CU, CD, RESET, LOAD, PV) 増加・減少をまとめて処理します。
IgetCount(id), IsetCount(id, value) 現在値を読み取りまたは変更します。
IctudDownState(id) Up/Downカウンタの下限完了状態を返します。
FIFO(id, IN, OUT, input, output, size, reset) 先に入れた16ビットデータから順に取り出します。
FILO(id, IN, OUT, input, output, size, reset) 後に入れた16ビットデータから順に取り出します。
void loop() {
  bool countDone = Ictu(0, digitalRead(0), false, 10);
  int32_t countValue = IgetCount(0);
}

コマンドのプロトタイプ

戻り型 コマンドのプロトタイプ
bool Ictu(uint8_t counter_id, bool CU, bool RESET, int32_t PV)
bool Ictd(uint8_t counter_id, bool CD, bool LOAD, int32_t PV)
bool Ictud(uint8_t counter_id, bool CU, bool CD, bool RESET, bool LOAD, int32_t PV)
int32_t IgetCount(uint8_t counter_id)
void IsetCount(uint8_t counter_id, int32_t value)
bool IctudDownState(uint8_t counter_id)
bool FIFO(uint8_t fifo_id, bool IN, bool OUT, uint16_t input, uint16_t &output, uint8_t size, bool reset = false)
bool FILO(uint8_t filo_id, bool IN, bool OUT, uint16_t input, uint16_t &output, uint8_t size, bool reset = false)

INOUTCUCDは立ち上がり時に動作します。各カウンタ・バッファに固有のidを使用し、sizeは必要な範囲で小さく設定してください。

← 内蔵コマンド一覧

ja-jp_commands/counter_buffer.1788785587.txt.gz · 最終更新: by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki