-
Notifications
You must be signed in to change notification settings - Fork 15
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
[FEATURE REQUEST] Asynchronous Bit Bang Mode allowing to receive D0 .. D7 #9
Comments
Oooooooh! That's what that function was for! I thought it was for reading the Anyway, moment of clarity aside I pushed a branch use libftd2xx::{BitMode, Ftdi, FtdiCommon, TimeoutError};
fn main() -> Result<(), TimeoutError> {
let mut ft = Ftdi::new()?;
let mask: u8 = 0x00;
ft.set_bit_mode(mask, BitMode::AsyncBitbang)?;
let mode = ft.bit_mode()?;
for pin_index in 0..8 {
if mode & (1 << pin_index) == 0 {
println!("Pin {}: Off", pin_index);
} else {
println!("Pin {}: On", pin_index);
}
}
ft.close()?;
Ok(())
} Gave it a go with my FT232H, and it seems to work as expected when I tie ADBUS6 to GND.
Can you give this a go and let me know if it solves the issue? |
I did a 0.13.0 release with the content of the |
Wow, this is great news! I'm going to test it in my board and back with some feedback. Indeed, the Another awesome feature to use with |
That's a neat function that I have not gotten to yet! Do you know what It looks like I can just call into |
The example Regarding |
I implemented the dependency methods ( I did hit one snag on the Windows side. There is a disconnect that needs to be resolved here - but I am not yet sure where. Thinking out loud:
Do you have any guidance here? I usually use Linux at work and at home so these Windows things are still new to me 😄 |
Thanks for starting this great feature! The wide strings are commonly used in Rust world, so the I have a naive tip. Maybe adding files like You have written clean and easy-to-use interfaces. I'm going to check the new branch and back with some feedback ... (and try to help you in the implementation for Windows) |
Oh, whoops, I missed the giant purple box at the bottom of the Microsoft docs that explains this, thanks for pointing that out, makes much more sense now!
That's definitely a better more ergonomic way to lay this out than what I was thinking of 👍 |
Hi.
Thanks for this awesome library!
So, it would be nice to allow to receive the data
D0
..D7
from the board in asynchronous bit bang mode. For example, supposing a circuit uses a FT232R with its pins 1 (D0), 5 (D1), 3 (D2), 11 (D3), 2 (D4), 9 (D5), 10 (D6) and 6 (D7) mapped to eight switches with pull-up resistors, it would be possible to detect if the switches are ON or OFF. Below a small example showing how to do that in C code:A good reference for implementation is the official app note AN_232R-01 (topic 2 Asynchronous Bit Bang Mode) available at: https://www.ftdichip.com/Support/Documents/AppNotes/AN_232R-01_Bit_Bang_Mode_Available_For_FT232R_and_Ft245R.pdf
cheers
The text was updated successfully, but these errors were encountered: