Закрепи табуляцию и размещение скобок в настройках проекта. Примени единый стиль к собственным исходникам.
38 lines
1.1 KiB
C
38 lines
1.1 KiB
C
#ifndef ZYNQ_LA_H
|
|
#define ZYNQ_LA_H
|
|
#include <stdint.h>
|
|
/* All wire words are little endian. One request per TCP connection, port 37572.
|
|
* Request: magic, version, count, divider, level_mask, level_value, edge_mask,
|
|
* edge_value, test_enable, test_divider, test_duty (11 uint32 = 44 bytes).
|
|
* test_enable: 0 off, 1 PWM duty/256, 2 fast binary divided square waves.
|
|
* Reply: magic, version, status, clock_hz, divider, count, channels, flags
|
|
* (8 uint32 = 32 bytes), then count uint8 samples on success.
|
|
* flags bit 0: bounded snapshot, gaps between requests. No pre-trigger samples.
|
|
* Status: 0 success, 1 invalid request, 2 capture timeout, 3 hardware fault.
|
|
*/
|
|
#define ZLA_MAGIC UINT32_C(0x31414c5a)
|
|
#define ZLA_REQUEST UINT32_C(0x52414c5a)
|
|
#define ZLA_PORT 37572
|
|
#define ZLA_MAX_SAMPLES 65536
|
|
enum zla_register
|
|
{
|
|
ZLA_ID = 0,
|
|
ZLA_STATUS = 4,
|
|
ZLA_CLOCK = 8,
|
|
ZLA_DEPTH = 12,
|
|
ZLA_COUNT = 16,
|
|
ZLA_DIVIDER = 20,
|
|
ZLA_LEVEL_MASK = 24,
|
|
ZLA_LEVEL_VALUE = 28,
|
|
ZLA_EDGE_MASK = 32,
|
|
ZLA_EDGE_VALUE = 36,
|
|
ZLA_COMMAND = 40,
|
|
ZLA_INDEX = 44,
|
|
ZLA_DATA = 48,
|
|
ZLA_CAPTURED = 52,
|
|
ZLA_TEST_DIVIDER = 56,
|
|
ZLA_TEST_DUTY = 60,
|
|
ZLA_TEST_ENABLE = 64
|
|
};
|
|
#endif
|