Skip to content

Commit 05f91f5

Browse files
committed
Add all enums
1 parent 3f67a0b commit 05f91f5

File tree

2 files changed

+95
-0
lines changed

2 files changed

+95
-0
lines changed

ni-fpga-sys/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ description = "Rust bindings to the NI FPGA C API."
88
repository = "https://github.com/first-rust-competition/ni-fpga-rs"
99

1010
[dependencies]
11+
bitflags = "2.4.0"
1112
dlopen = "0.1.8"
1213
dlopen_derive = "0.1.4"

ni-fpga-sys/src/lib.rs

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,100 @@ use dlopen_derive::{WrapperApi, WrapperMultiApi};
6060

6161
pub type NiFpgaApiContainer = Container<NiFpgaApi>;
6262

63+
bitflags::bitflags! {
64+
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
65+
pub struct OpenAttributes: u32 {
66+
const NoRun = 1;
67+
const BitfilePathIsUTF8 = 2;
68+
const BitfileContentsNotPath = 1u32 << 30;
69+
const IgnoreSignatureArgument = 1u32 << 31;
70+
}
71+
}
72+
73+
bitflags::bitflags! {
74+
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
75+
pub struct CloseAttributes: u32 {
76+
const NoResetIfLastSession = 1;
77+
}
78+
}
79+
80+
bitflags::bitflags! {
81+
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
82+
pub struct RunAttribute: u32 {
83+
const WaitUntilDone = 1;
84+
}
85+
}
86+
87+
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
88+
pub enum FpgaViState {
89+
NotRunning = 0,
90+
Invalid = 1,
91+
Running = 2,
92+
NaturallyStopped = 3,
93+
}
94+
95+
bitflags::bitflags! {
96+
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
97+
pub struct Irq: u32 {
98+
const Irq0 = 1u32 << 0;
99+
const Irq1 = 1u32 << 1;
100+
const Irq2 = 1u32 << 2;
101+
const Irq3 = 1u32 << 3;
102+
const Irq4 = 1u32 << 4;
103+
const Irq5 = 1u32 << 5;
104+
const Irq6 = 1u32 << 6;
105+
const Irq7 = 1u32 << 7;
106+
const Irq8 = 1u32 << 8;
107+
const Irq9 = 1u32 << 9;
108+
const Irq10 = 1u32 << 10;
109+
const Irq11 = 1u32 << 11;
110+
const Irq12 = 1u32 << 12;
111+
const Irq13 = 1u32 << 13;
112+
const Irq14 = 1u32 << 14;
113+
const Irq15 = 1u32 << 15;
114+
const Irq16 = 1u32 << 16;
115+
const Irq17 = 1u32 << 17;
116+
const Irq18 = 1u32 << 18;
117+
const Irq19 = 1u32 << 19;
118+
const Irq20 = 1u32 << 20;
119+
const Irq21 = 1u32 << 21;
120+
const Irq22 = 1u32 << 22;
121+
const Irq23 = 1u32 << 23;
122+
const Irq24 = 1u32 << 24;
123+
const Irq25 = 1u32 << 25;
124+
const Irq26 = 1u32 << 26;
125+
const Irq27 = 1u32 << 27;
126+
const Irq28 = 1u32 << 28;
127+
const Irq29 = 1u32 << 29;
128+
const Irq30 = 1u32 << 30;
129+
const Irq31 = 1u32 << 31;
130+
}
131+
}
132+
133+
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
134+
pub enum FifoProperty {
135+
BytesPerElement = 1,
136+
HostBufferAllocationGranularity = 2,
137+
HostBufferSize = 3,
138+
HostBufferMirrorSize = 4,
139+
HostBufferType = 5,
140+
HostBuffer = 6,
141+
FlowControl = 7,
142+
ElementsCurrentlyAcquired = 8,
143+
}
144+
145+
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
146+
pub enum HostBufferType {
147+
AllocatedByRIO = 1,
148+
AllocatedByUser = 2,
149+
}
150+
151+
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
152+
pub enum FifoFlowControl {
153+
Disabled = 1,
154+
Enabled = 2,
155+
}
156+
63157
#[derive(WrapperApi)]
64158
pub struct NiFpgaHmbApi {
65159
NiFpgaDll_OpenHmb: extern "C" fn(

0 commit comments

Comments
 (0)