Buttons

API for interfacing with physical buttons

Functions

struct metal_button *metal_button_get(char *label)

Get a reference to a button.

Return

A handle for the button

Parameters
  • label: The DeviceTree label for the button

__inline__ struct metal_interrupt *metal_button_interrupt_controller(struct metal_button *button)

Get the interrupt controller for a button.

Return

A pointer to the interrupt controller responsible for handling button interrupts.

Parameters
  • button: The handle for the button

__inline__ int metal_button_get_interrupt_id(struct metal_button *button)

Get the interrupt id for a button.

Return

The interrupt id corresponding to a button.

Parameters
  • button: The handle for the button

struct metal_button
#include <button.h>

A button device handle.

A struct metal_button is an implementation-defined object which represents a button on a development board.