Skip to content
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

support gravis/snes controller #72

Open
makapuf opened this issue Oct 4, 2016 · 6 comments
Open

support gravis/snes controller #72

makapuf opened this issue Oct 4, 2016 · 6 comments

Comments

@makapuf
Copy link
Owner

makapuf commented Oct 4, 2016

the support of those controllers could be made using a library,

  • writing to the standard interface for controllers gamepad_buttons on gamepad 0

(edit:removed serial related)

@makapuf makapuf added this to the kernel v0.2 milestone Oct 4, 2016
@pulkomandy
Copy link
Contributor

Example for Gravis protocol implementation: https://github.com/pulkomandy/stm32f3/blob/master/src/main.c#L80

@makapuf
Copy link
Owner Author

makapuf commented Nov 15, 2016

I see you're using interrupts, which I'd like to avoid , so would it be possible to poll on the GPIO ? What is the data rate ?
Do you think we could use SPI to deserialize data ?

@makapuf
Copy link
Owner Author

makapuf commented Nov 15, 2016

also, I hestitate to use as a makefile variable -DGRAVIS , an explicit lib call or a dynamic (but how would we use different hardware ?)

@pulkomandy
Copy link
Contributor

I think you can look at the previous commit for a polling version.
My notes about the protocol: http://pulkomandy.tk/_/_Electronique/_Gravis%20Interface%20Protocol

The data rate is about 20 to 25KHz on my controllers. SPI is possible except there is a continuous clock stream and no "chip select" so it won't detect the start and end of frames. You will need to look for the known start pattern (5 consecutive 1 bits) to resynchronize with the bitstream coming from SPI. Once synchronized, the stream has frames of 24bits so you can decode it with a fixed shift.

@pulkomandy
Copy link
Contributor

(and for the SNES: IIRC, it is up to us to generate the clock. This means we can be SPI master, whereas for Gravis, the controller generates the clock and we are SPI slave).

@makapuf
Copy link
Owner Author

makapuf commented Nov 15, 2016

Yes the bitbox1 used snes, it's delightfully easy compared to usb
https://github.com/makapuf/bitbox/blob/rev1/src/lib/gamepad.c

Le 15 nov. 2016 14:17, "Adrien Destugues" notifications@github.com a
écrit :

(and for the SNES: IIRC, it is up to us to generate the clock. This means
we can be SPI master, whereas for Gravis, the controller generates the
clock and we are SPI slave).


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#72 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAlREQz_dZj9a4S_oYtTZ9SjmA627Shfks5q-bDZgaJpZM4KNdIV
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants