Coder Social home page Coder Social logo

ps2forlitex's Introduction

PS2forLitex

PS/2 (keyboard, maybe mouse but untested) controller for the LiteX SoC generator.

Files in there:

PS2Host.py: the actual controller, reimplemented in Migen from the PS/2 specifications and a verilog host controller from opencores

PS2Wrapper.py: the CSR/interrupt to bridge the controller with LiteX

0001.litex-ps2.patch: Linux driver for the controller (derived from the Altera PS/2 driver)

PS2_json2dts_fragment.txt: a bit of code to add to the json2dts python script to add the proper DTS entry (it pretends the interrupt is optional, but the driver won't work without the interrupt)

The pins should be added to the 'platform' in litex-boards, e.g. for the digilent PS/2 PMod:

        ("ps2kbd", 0,
            Subsignal("ps2_data", Pins(f"{pmod}:0 ")),
            Subsignal("ps2_clk",  Pins(f"{pmod}:2")),
            Misc("DRIVE=16"),
            IOStandard("LVCMOS33"),
        ),

Then the controller can be added in the 'target', e.g.:

        # Keyboard ---------------------------------------------------------------------------------
        if ps2kbd:
            self.submodules.ps2kbd = PS2HostWrapper(platform = platform, pads = platform.request("ps2kbd"), sys_clk_freq = sys_clk_freq)
            self.irq.add("ps2kbd", use_loc_if_exists=True)

ps2forlitex's People

Contributors

rdolbeau avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.