• Navigation überspringen
  • Zur Navigation
  • Zum Seitenende
Organisationsmenü öffnen Organisationsmenü schließen
Friedrich-Alexander-Universität Lehrstuhl für Informatik 4 (Systemsoftware)
  • FAUZur zentralen FAU Website
  1. Friedrich-Alexander-Universität
  2. Technische Fakultät
  3. Department Informatik
Suche öffnen
  • English
  • Campo
  • StudOn
  • FAUdir
  • Stellenangebote
  • Lageplan
  • Hilfe im Notfall
  1. Friedrich-Alexander-Universität
  2. Technische Fakultät
  3. Department Informatik
Friedrich-Alexander-Universität Lehrstuhl für Informatik 4 (Systemsoftware)
Menu Menu schließen
  • Lehrstuhl
    • Team
    • Aktuelles
    • Kontakt und Anfahrt
    • Leitbild
    • 50-jähriges Jubiläum
    Portal Lehrstuhl
  • Forschung
    • Forschungsbereiche
      • Betriebssysteme
      • Confidential Computing
      • Eingebettete Systemsoftware
      • Verteilte Systeme
    • Projekte
      • AIMBOS
      • BALu
      • BFT2Chain
      • DOSS
      • Mirador
      • NEON
      • PAVE
      • ResPECT
      • Watwa
    • Projektkampagnen
      • maRE
    • Seminar
      • Systemsoftware
    Portal Forschung
  • Publikationen
  • Lehre
    • Sommersemester 2025
      • Applied Software Architecture
      • Ausgewählte Kapitel der Systemsoftware
      • Betriebssystemtechnik
      • Projekt angewandte Systemsoftwaretechnik
      • System-Level Programming
      • Systemnahe Programmierung in C
      • Systemprogrammierung 1
      • Verteilte Systeme
    • Wintersemester 2024/25
      • Betriebssysteme
      • Middleware – Cloud Computing
      • Systemprogrammierung 2
      • Verlässliche Echtzeitsysteme
      • Virtuelle Maschinen
      • Web-basierte Systeme
    Portal Lehre
  • Examensarbeiten
  1. Startseite
  2. Extern

Extern

Bereichsnavigation: Lehre
  • Systemnahe Programmierung in C (für Wiederholer)
    • SPiCboard
      • Bauanleitung
        • Programmieren im CIP
          • libspicboard-Doku
            • SPiC-IDE
              • SPiCsim
                • FAQ
                  • Projekte
                  • Prüfung
                    • Evaluation
                      • Linux libc-Doku
                        • Intern

                        SPiCboard

                        Files | Typedefs | Enumerations | Functions
                        Button

                        Enables event-driven and polling access to the buttons of the SPiCboard. More...

                        Files

                        file  button.h
                         

                        Typedefs

                        typedef void(* BUTTONCALLBACK) (BUTTON, BUTTONEVENT)
                         Type for button event callback functions. More...
                         

                        Enumerations

                        enum  BUTTON { BUTTON0 , BUTTON1 }
                         Identifiers for all available buttons. More...
                         
                        enum  BUTTONSTATE { UNKNOWN , PRESSED , RELEASED }
                         States for buttons. More...
                         
                        enum  BUTTONEVENT { ONPRESS , ONRELEASE }
                         Events for buttons. More...
                         

                        Functions

                        int8_t sb_button_registerCallback (BUTTON btn, BUTTONEVENT eve, BUTTONCALLBACK callback)
                         Register a callback function for a button event. More...
                         
                        int8_t sb_button_unregisterCallback (BUTTON btn, BUTTONEVENT eve, BUTTONCALLBACK callback)
                         Unregister a callback function for a button event. More...
                         
                        BUTTONSTATE sb_button_getState (BUTTON btn)
                         Query the current state of a button. More...
                         

                        Detailed Description

                        Enables event-driven and polling access to the buttons of the SPiCboard.

                        The SPiCboard is equipped with two buttons. Button 0 is debounced in hardware, whereas Button 1 needs to be debounced in software by the button module. Debouncing is transparent to the application, that can use both buttons through the provided interface without the need to care about debouncing.

                        The debouncing code makes use of a timer. When no callbacks are registered for Button 1, the debouncing code is disabled and all alarms registered at the timer should be canceled.

                        The button module uses dynamic memory management to maintain the callback queues.

                        Typedef Documentation

                        typedef void(* BUTTONCALLBACK) (BUTTON, BUTTONEVENT)

                        Type for button event callback functions.

                        A button callback function is called on the interrupt level whenever an event at a button occurs that the function was registered for. The callback function is passed the button id and the type of event that occurred. This way, the same callback function can be registered for different buttons and events.

                        Enumeration Type Documentation

                        enum BUTTON

                        Identifiers for all available buttons.

                        Enumerator
                        BUTTON0 

                        Button 0

                        BUTTON1 

                        Button 1

                        enum BUTTONEVENT

                        Events for buttons.

                        Down (on press) and up (on release) events for buttons.

                        Enumerator
                        ONPRESS 

                        Button is pressed

                        ONRELEASE 

                        Button is released

                        enum BUTTONSTATE

                        States for buttons.

                        Pressed and released states for buttons.

                        Enumerator
                        UNKNOWN 

                        Buttonstate is unknown (invalid button?)

                        PRESSED 

                        Button is pressed

                        RELEASED 

                        Button is released

                        Function Documentation

                        BUTTONSTATE sb_button_getState ( BUTTON  btn)

                        Query the current state of a button.

                        Parameters
                        btnid of the button
                        Returns
                        the buttons current state (pressed or released - or unknown if invalid button) as a BUTTONSTATE
                        int8_t sb_button_registerCallback ( BUTTON  btn,
                        BUTTONEVENT  eve,
                        BUTTONCALLBACK  callback 
                        )

                        Register a callback function for a button event.

                        Interrupts must be enabled to receive the callbacks.

                        Parameters
                        btnthe id of the button
                        evethe type of event that the callback function should be invoked for.
                        callbackpointer to the callback function. This function is called from the interrupt handler.
                        Return values
                        0success,
                        !0error
                        See also
                        sb_button_unregisterCallback
                        int8_t sb_button_unregisterCallback ( BUTTON  btn,
                        BUTTONEVENT  eve,
                        BUTTONCALLBACK  callback 
                        )

                        Unregister a callback function for a button event.

                        Parameters
                        btnthe id of the button
                        evethe type of event that the callback function should be invoked for.
                        callbackpointer to the callback function
                        Returns
                        0 on success, negative value on error
                        Return values
                        0success
                        -1the callback function was not registered with the given button/event combination
                        See also
                        sb_button_registerCallback
                        Friedrich-Alexander-Universität
                        Erlangen-Nürnberg

                        Schlossplatz 4
                        91054 Erlangen
                        • Impressum
                        • Datenschutz
                        • Barrierefreiheit
                        • Facebook
                        • RSS Feed
                        • Xing
                        Nach oben