nand2/07_Operating_System/01_GPIO_Test
2023-08-04 16:44:31 +02:00
..
GPIO.jack added v2.0 2023-01-11 23:04:57 +01:00
gpio.png added v2.0 2023-01-11 23:04:57 +01:00
Makefile changed python tools to python3.11 2023-08-04 16:44:31 +02:00
Readme.md added v2.0 2023-01-11 23:04:57 +01:00
Readme.md.backup added v2.0 2023-01-11 23:04:57 +01:00
Sys.jack added v2.0 2023-01-11 23:04:57 +01:00

GPIO.jack

This library provides access to BUT and LED.

GPIO-Test

In the Testfolder 01_GPIO_Test you find a minimal version of Sys.jack containing the init function Sys.init(), which is called after starting JACK-OS. Sys.init() is the JACK-OS version of leds.asm, which reads the BUT and writes the values to LED in an endless loop:

class Sys {

    function void init() {
        do GPIO.init(4096);
        while (true){
            do GPIO.writeLed(GPIO.readBut());
        }        
        return;
    }
}

Project

  • Implement GPIO.jack

  • Test in simulation:

    $ cd 01_GPIO_Test
    $ make
    $ cd ../00_HACK
    $ apio clean
    $ apio sim
    

    The test bench will simulate the pushing of BUT1/2. Check if the LED change accordingly.

  • run in real hardware with HACK build at 06_IO_Devices/05_GO (together with the bootloader). Build and upload GPIO_Test to iCE40HX1K-EVB with:

    $ cd 01_GPIO_Test
    $ make
    $ make upload
    
  • push buttons BUT on iCE40HX1K-EVB and check the LED.