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) |
IN, OUT, CU, CD는 상승 순간에 동작합니다. 각 카운터·버퍼에 고유한 id를 사용하고 size는 필요한 범위로 작게 설정하십시오.
commands/counter_buffer.1788184327.txt.gz · 마지막으로 수정됨: 저자 127.0.0.1
