Writing a USB driver

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Aniruddha Chaphekar
    New Member
    • Aug 2007
    • 5

    Writing a USB driver

    I want to use a simple footswitch to connect to the usb port. When the footswitch is pressed, I'd like the computer to read it as an 'enter' command from the keyboard.
    This is for running video recording software on the comp. during surgery. The 'enter' command allows you to toggle between recording and pausing. A footswitch will ensure that i don't have to ask someone else to do it for me.
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Heya, Aniruddha. Welcome to TSDN!

    What programming language will you be using to build the driver?

    Comment

    • bartonc
      Recognized Expert Expert
      • Sep 2006
      • 6478

      #3
      Originally posted by Aniruddha Chaphekar
      I want to use a simple footswitch to connect to the usb port. When the footswitch is pressed, I'd like the computer to read it as an 'enter' command from the keyboard.
      This is for running video recording software on the comp. during surgery. The 'enter' command allows you to toggle between recording and pausing. A footswitch will ensure that i don't have to ask someone else to do it for me.
      Shortcut:
      • Taka apart a (second) USB mouse
      • Remove the ball so no movement is registered from this mouse
      • Plug in the mouse - the PC will see it and use it in tandem with the first mouse
      • Put it on the floor
      • Use the first mouse to position the cursor over the "pause/record" button
      • Click the mouse on the floor with your foot

      Comment

      • Aniruddha Chaphekar
        New Member
        • Aug 2007
        • 5

        #4
        Originally posted by pbmods
        Heya, Aniruddha. Welcome to TSDN!

        What programming language will you be using to build the driver?
        I'm OK with C/C++, so that's what I thought I will use.

        Comment

        • Aniruddha Chaphekar
          New Member
          • Aug 2007
          • 5

          #5
          Originally posted by bartonc
          Shortcut:
          • Taka apart a (second) USB mouse
          • Remove the ball so no movement is registered from this mouse
          • Plug in the mouse - the PC will see it and use it in tandem with the first mouse
          • Put it on the floor
          • Use the first mouse to position the cursor over the "pause/record" button
          • Click the mouse on the floor with your foot
          Thanks a million for replying, I really do appreciate this. But I was thinking, would it be possible to do away with the mouse cursor entirely? Because the application(stu dio 9) highlights the 'stop recording' button when a recording is on, and highlights the 'start recording' button when recording is stopped. So what's needed is only an 'enter' command from the keyboard to switch between recording and stopping.
          And, you know, I thought it'd be a good challenge to do, my first ever!
          Any suggestions?
          Thanks again

          Comment

          • bartonc
            Recognized Expert Expert
            • Sep 2006
            • 6478

            #6
            Originally posted by Aniruddha Chaphekar
            Thanks a million for replying, I really do appreciate this. But I was thinking, would it be possible to do away with the mouse cursor entirely? Because the application(stu dio 9) highlights the 'stop recording' button when a recording is on, and highlights the 'start recording' button when recording is stopped. So what's needed is only an 'enter' command from the keyboard to switch between recording and stopping.
            And, you know, I thought it'd be a good challenge to do, my first ever!
            Any suggestions?
            Thanks again
            Writing the driver would be a good challenge if you are an experienced programmer.
            If you need help digging into the Microsoft documentation on-line, I can get you pointed in the right direction.

            Then, once you have made a start, the experts in the C/C++ Forum are a great resource for getting over the major hurdles.

            Comment

            • pbmods
              Recognized Expert Expert
              • Apr 2007
              • 5821

              #7
              I just thought I'd say that I think this is a really neat idea, and I'd really like to see how it turns out!

              Comment

              • Aniruddha Chaphekar
                New Member
                • Aug 2007
                • 5

                #8
                Yes, please. How do I get started with this.

                Comment

                • pbmods
                  Recognized Expert Expert
                  • Apr 2007
                  • 5821

                  #9
                  Heya, Aniruddha.

                  Here's an FAQ that should help get you started. Some of the answers are a little intimidating. But there is some good advice lower down on the page, especially concerning how to adapt [copies of] existing drivers to better meet your needs.

                  OSR Open Systems Resources, Inc. The Windows device driver and file systems experts. Seminars - Development - Consulting - Training

                  Comment

                  • Aniruddha Chaphekar
                    New Member
                    • Aug 2007
                    • 5

                    #10
                    OK. There's a slight change of plan.Instead of a USB port, we could use a com port. I was reading this book on the 8086 microprocessor by Kenneth Ayala. It's all about assembly language stuff. And there is this program for 'checking a loop'. Simply put, the com port is used. You connect some pins together - here's the list -
                    pin 4(DTR) to pin 6(DSR)
                    pin 7 to pin 8
                    pin 3(TxD) to pin 2(Rxd).
                    The program will send out a character into pin 3 and read it back through pin 2, confirming that they're joined(or otherwise). So i could use the connection between pins 3 and 2 as a switch.
                    Do you think it will work and how does one get that assembly code into dev c++ ?

                    Comment

                    Working...