-
Notifications
You must be signed in to change notification settings - Fork 4
API Version 2.0 #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
ThadHouse
wants to merge
59
commits into
first-rust-competition:master
Choose a base branch
from
ThadHouse:dlopenapi
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
API Version 2.0 #32
Changes from 2 commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
738218d
Switch FPGA API's to be dynamically loaded
ThadHouse 13438c9
Finish up changes
ThadHouse b722aaf
Fix first round of review nits
ThadHouse 3551844
Only have FFI code at the low level
ThadHouse 0844fd3
Fix loading
ThadHouse c7c022c
Add HMB as an example of an optional api
ThadHouse ca4785b
Don't make general write functions mut
ThadHouse 3f67a0b
Allow opening a non owning session
ThadHouse 05f91f5
Add all enums
ThadHouse c06fc35
Some reformatting
ThadHouse 33cdbd7
Use enums at high level
ThadHouse 207b3a5
Add all FPGA APIs
ThadHouse bf0a476
Flesh out HMB API
ThadHouse 841b9d8
Add an API to create from an existing session
ThadHouse 3ea872b
Really fix up lifetimes this time
ThadHouse 86376cd
Add typed register API
ThadHouse 75f40e4
Use some lifetime hack to make alternate objects easier
ThadHouse 3a18483
Use traits to access high level values
ThadHouse 0c5d90b
Export high level types, so they can actually be typed out
ThadHouse d2895a2
Add accessors for ffi low level directly
ThadHouse 725045c
Allow building without unstable features
ThadHouse ece6325
Massively improve lifetime holding for registers
ThadHouse 96154d3
Remove missed file
ThadHouse 0679c4d
Hide unsafe API a bit better, don't allow using register API for it
ThadHouse 0f8d8a0
Make enums fixed types too
ThadHouse 3447ae0
Use from for dlopen error coersion
ThadHouse 0f4b378
Switch FPGA API's to be dynamically loaded
ThadHouse 852453a
Merge branch 'master' into dlopenapi
ThadHouse 92f85d4
Fixup running
ThadHouse e89e926
Fix integration tests
ThadHouse 21cf98c
Merge master
ThadHouse 3ecb57c
Make not require unsafe
ThadHouse 85b3620
Fix session
ThadHouse 1de06ef
Remove generated code
ThadHouse e528442
Remove unnecessary
ThadHouse 02fc71d
Lots more cluster work
ThadHouse 050b491
Delete fixed registers
ThadHouse f30d9d0
1 more miss
ThadHouse c9fc506
Add packed number
ThadHouse 3d917b9
Add back in specializations
ThadHouse 7856fa0
Finally found a way to specialize reads and writes
ThadHouse 6911389
Use a builder API
ThadHouse 16d0ea9
Fix enum macros
ThadHouse 5fadba4
Fix lints
ThadHouse 95ae402
Better specialization
ThadHouse ce8c0d2
Test and abstract out much stuff
ThadHouse 84864ce
Split Register Read and Write
ThadHouse b42ce0a
Split read and write, make write unsafe
ThadHouse ff937b2
Remove unsafe
ThadHouse e993fc7
Work on generating a full high level API
ThadHouse ca8e10f
Lots more generation
ThadHouse eb44cbd
Everything needs to explicitly implement datatype
ThadHouse fa19b27
Add register transmute
ThadHouse 684e231
Fix
ThadHouse 5ec06b3
Add overflowing option for FXP
ThadHouse 3892a05
Add raw HMB readers
ThadHouse 82b2aba
Add interrupt manager
ThadHouse a80a72c
Export Interrupt Manager
ThadHouse cffa1d2
Export IRQ
ThadHouse File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
pub fn main() { | ||
println!("cargo:rustc-link-lib=NiFpga"); | ||
} | ||
pub fn main() {} | ||
auscompgeek marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
#![allow(non_snake_case)] | ||
use std::ffi::c_char; | ||
|
||
use dlopen::wrapper::WrapperApi; | ||
|
||
use dlopen_derive::WrapperApi; | ||
|
||
use crate::{Offset, Session, Status}; | ||
|
||
#[derive(WrapperApi)] | ||
pub(crate) struct NiFpgaApi { | ||
NiFpgaDll_Open: extern "C" fn( | ||
bitfile: *const c_char, | ||
signature: *const c_char, | ||
resource: *const c_char, | ||
attribute: u32, | ||
session: *mut Session, | ||
) -> Status, | ||
|
||
NiFpgaDll_Close: extern "C" fn(session: Session, attribute: u32) -> Status, | ||
|
||
NiFpgaDll_ReadBool: | ||
extern "C" fn(session: Session, indicator: Offset, value: *mut bool) -> Status, | ||
|
||
NiFpgaDll_ReadArrayBool: | ||
extern "C" fn(session: Session, indicator: Offset, array: *mut bool, size: usize) -> Status, | ||
NiFpgaDll_WriteBool: extern "C" fn(session: Session, indicator: Offset, value: bool) -> Status, | ||
NiFpgaDll_WriteArrayBool: extern "C" fn( | ||
session: Session, | ||
indicator: Offset, | ||
array: *const bool, | ||
size: usize, | ||
) -> Status, | ||
|
||
NiFpgaDll_ReadU8: extern "C" fn(session: Session, indicator: Offset, value: *mut u8) -> Status, | ||
NiFpgaDll_ReadArrayU8: | ||
extern "C" fn(session: Session, indicator: Offset, array: *mut u8, size: usize) -> Status, | ||
NiFpgaDll_WriteU8: extern "C" fn(session: Session, indicator: Offset, value: u8) -> Status, | ||
NiFpgaDll_WriteArrayU8: | ||
extern "C" fn(session: Session, indicator: Offset, array: *const u8, size: usize) -> Status, | ||
|
||
NiFpgaDll_ReadU16: | ||
extern "C" fn(session: Session, indicator: Offset, value: *mut u16) -> Status, | ||
NiFpgaDll_ReadArrayU16: | ||
extern "C" fn(session: Session, indicator: Offset, array: *mut u16, size: usize) -> Status, | ||
NiFpgaDll_WriteU16: extern "C" fn(session: Session, indicator: Offset, value: u16) -> Status, | ||
NiFpgaDll_WriteArrayU16: extern "C" fn( | ||
session: Session, | ||
indicator: Offset, | ||
array: *const u16, | ||
size: usize, | ||
) -> Status, | ||
|
||
NiFpgaDll_ReadU32: | ||
extern "C" fn(session: Session, indicator: Offset, value: *mut u32) -> Status, | ||
NiFpgaDll_ReadArrayU32: | ||
extern "C" fn(session: Session, indicator: Offset, array: *mut u32, size: usize) -> Status, | ||
NiFpgaDll_WriteU32: extern "C" fn(session: Session, indicator: Offset, value: u32) -> Status, | ||
NiFpgaDll_WriteArrayU32: extern "C" fn( | ||
session: Session, | ||
indicator: Offset, | ||
array: *const u32, | ||
size: usize, | ||
) -> Status, | ||
|
||
NiFpgaDll_ReadU64: | ||
extern "C" fn(session: Session, indicator: Offset, value: *mut u64) -> Status, | ||
NiFpgaDll_ReadArrayU64: | ||
extern "C" fn(session: Session, indicator: Offset, array: *mut u64, size: usize) -> Status, | ||
NiFpgaDll_WriteU64: extern "C" fn(session: Session, indicator: Offset, value: u64) -> Status, | ||
NiFpgaDll_WriteArrayU64: extern "C" fn( | ||
session: Session, | ||
indicator: Offset, | ||
array: *const u64, | ||
size: usize, | ||
) -> Status, | ||
|
||
NiFpgaDll_ReadI8: extern "C" fn(session: Session, indicator: Offset, value: *mut i8) -> Status, | ||
NiFpgaDll_ReadArrayI8: | ||
extern "C" fn(session: Session, indicator: Offset, array: *mut i8, size: usize) -> Status, | ||
NiFpgaDll_WriteI8: extern "C" fn(session: Session, indicator: Offset, value: i8) -> Status, | ||
NiFpgaDll_WriteArrayI8: | ||
extern "C" fn(session: Session, indicator: Offset, array: *const i8, size: usize) -> Status, | ||
|
||
NiFpgaDll_ReadI16: | ||
extern "C" fn(session: Session, indicator: Offset, value: *mut i16) -> Status, | ||
NiFpgaDll_ReadArrayI16: | ||
extern "C" fn(session: Session, indicator: Offset, array: *mut i16, size: usize) -> Status, | ||
NiFpgaDll_WriteI16: extern "C" fn(session: Session, indicator: Offset, value: i16) -> Status, | ||
NiFpgaDll_WriteArrayI16: extern "C" fn( | ||
session: Session, | ||
indicator: Offset, | ||
array: *const i16, | ||
size: usize, | ||
) -> Status, | ||
|
||
NiFpgaDll_ReadI32: | ||
extern "C" fn(session: Session, indicator: Offset, value: *mut i32) -> Status, | ||
NiFpgaDll_ReadArrayI32: | ||
extern "C" fn(session: Session, indicator: Offset, array: *mut i32, size: usize) -> Status, | ||
NiFpgaDll_WriteI32: extern "C" fn(session: Session, indicator: Offset, value: i32) -> Status, | ||
NiFpgaDll_WriteArrayI32: extern "C" fn( | ||
session: Session, | ||
indicator: Offset, | ||
array: *const i32, | ||
size: usize, | ||
) -> Status, | ||
|
||
NiFpgaDll_ReadI64: | ||
extern "C" fn(session: Session, indicator: Offset, value: *mut i64) -> Status, | ||
NiFpgaDll_ReadArrayI64: | ||
extern "C" fn(session: Session, indicator: Offset, array: *mut i64, size: usize) -> Status, | ||
NiFpgaDll_WriteI64: extern "C" fn(session: Session, indicator: Offset, value: i64) -> Status, | ||
NiFpgaDll_WriteArrayI64: extern "C" fn( | ||
session: Session, | ||
indicator: Offset, | ||
array: *const i64, | ||
size: usize, | ||
) -> Status, | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.