Loading...
Searching...
No Matches
Line settings objects

## Functions

struct gpiod_line_settings * | gpiod_line_settings_new (void)
| Create a new line settings object.
void | gpiod_line_settings_free (struct gpiod_line_settings *settings)
| Free the line settings object and release all associated resources.
void | gpiod_line_settings_reset (struct gpiod_line_settings *settings)
| Reset the line settings object to its default values.
struct gpiod_line_settings * | gpiod_line_settings_copy (struct gpiod_line_settings *settings)
| Copy the line settings object.
int | gpiod_line_settings_set_direction (struct gpiod_line_settings *settings, enum gpiod_line_direction direction)
| Set direction.
enum gpiod_line_direction | gpiod_line_settings_get_direction (struct gpiod_line_settings *settings)
| Get direction.
int | gpiod_line_settings_set_edge_detection (struct gpiod_line_settings *settings, enum gpiod_line_edge edge)
| Set edge detection.
enum gpiod_line_edge | gpiod_line_settings_get_edge_detection (struct gpiod_line_settings *settings)
| Get edge detection.
int | gpiod_line_settings_set_bias (struct gpiod_line_settings *settings, enum gpiod_line_bias bias)
| Set bias.
enum gpiod_line_bias | gpiod_line_settings_get_bias (struct gpiod_line_settings *settings)
| Get bias.
int | gpiod_line_settings_set_drive (struct gpiod_line_settings *settings, enum gpiod_line_drive drive)
| Set drive.
enum gpiod_line_drive | gpiod_line_settings_get_drive (struct gpiod_line_settings *settings)
| Get drive.
void | gpiod_line_settings_set_active_low (struct gpiod_line_settings *settings, bool active_low)
| Set active-low setting.
bool | gpiod_line_settings_get_active_low (struct gpiod_line_settings *settings)
| Get active-low setting.
void | gpiod_line_settings_set_debounce_period_us (struct gpiod_line_settings *settings, unsigned long period)
| Set debounce period.
unsigned long | gpiod_line_settings_get_debounce_period_us (struct gpiod_line_settings *settings)
| Get debounce period.
int | gpiod_line_settings_set_event_clock (struct gpiod_line_settings *settings, enum gpiod_line_clock event_clock)
| Set event clock.
enum gpiod_line_clock | gpiod_line_settings_get_event_clock (struct gpiod_line_settings *settings)
| Get event clock setting.
int | gpiod_line_settings_set_output_value (struct gpiod_line_settings *settings, enum gpiod_line_value value)
| Set the output value.
enum gpiod_line_value | gpiod_line_settings_get_output_value (struct gpiod_line_settings *settings)
| Get the output value.

## Detailed Description

Functions for manipulating line settings objects.

Line settings object contains a set of line properties that can be used when requesting lines or reconfiguring an existing request.

Mutators in general can only fail if the new property value is invalid. The return values can be safely ignored - the object remains valid even after a mutator fails and simply uses the sane default appropriate for given property.

## Function Documentation

## gpiod_line_settings_copy()

struct gpiod_line_settings * gpiod_line_settings_copy | ( | struct gpiod_line_settings * | settings | ) |

Copy the line settings object.

Parameters

  settings | Line settings object to copy.

Returns
  New line settings object that must be freed using gpiod_line_settings_free or NULL on failure.

## gpiod_line_settings_free()

void gpiod_line_settings_free | ( | struct gpiod_line_settings * | settings | ) |

Free the line settings object and release all associated resources.

Parameters

  settings | Line settings object.

## gpiod_line_settings_get_active_low()

bool gpiod_line_settings_get_active_low | ( | struct gpiod_line_settings * | settings | ) |

Get active-low setting.

Parameters

  settings | Line settings object.

Returns
  True if active-low is enabled, false otherwise.

## gpiod_line_settings_get_bias()

enum gpiod_line_bias gpiod_line_settings_get_bias | ( | struct gpiod_line_settings * | settings | ) |

Get bias.

Parameters

  settings | Line settings object.

Returns
  Current bias setting.

## gpiod_line_settings_get_debounce_period_us()

unsigned long gpiod_line_settings_get_debounce_period_us | ( | struct gpiod_line_settings * | settings | ) |

Get debounce period.

Parameters

  settings | Line settings object.

Returns
  Current debounce period in microseconds.

## gpiod_line_settings_get_direction()

enum gpiod_line_direction gpiod_line_settings_get_direction | ( | struct gpiod_line_settings * | settings | ) |

Get direction.

Parameters

  settings | Line settings object.

Returns
  Current direction.

## gpiod_line_settings_get_drive()

enum gpiod_line_drive gpiod_line_settings_get_drive | ( | struct gpiod_line_settings * | settings | ) |

Get drive.

Parameters

  settings | Line settings object.

Returns
  Current drive setting.

## gpiod_line_settings_get_edge_detection()

enum gpiod_line_edge gpiod_line_settings_get_edge_detection | ( | struct gpiod_line_settings * | settings | ) |

Get edge detection.

Parameters

  settings | Line settings object.

Returns
  Current edge detection setting.

## gpiod_line_settings_get_event_clock()

enum gpiod_line_clock gpiod_line_settings_get_event_clock | ( | struct gpiod_line_settings * | settings | ) |

Get event clock setting.

Parameters

  settings | Line settings object.

Returns
  Current event clock setting.

## gpiod_line_settings_get_output_value()

enum gpiod_line_value gpiod_line_settings_get_output_value | ( | struct gpiod_line_settings * | settings | ) |

Get the output value.

Parameters

  settings | Line settings object.

Returns
  Current output value.

## gpiod_line_settings_new()

struct gpiod_line_settings * gpiod_line_settings_new | ( | void |  | ) |

Create a new line settings object.

Returns
  New line settings object or NULL on error. The returned object must be freed by the caller using gpiod_line_settings_free.

## gpiod_line_settings_reset()

void gpiod_line_settings_reset | ( | struct gpiod_line_settings * | settings | ) |

Reset the line settings object to its default values.

Parameters

  settings | Line settings object.

## gpiod_line_settings_set_active_low()

void gpiod_line_settings_set_active_low | ( | struct gpiod_line_settings * | settings,
|  | bool | active_low )

Set active-low setting.

Parameters

  settings | Line settings object.
  active_low | New active-low setting.

## gpiod_line_settings_set_bias()

int gpiod_line_settings_set_bias | ( | struct gpiod_line_settings * | settings,
|  | enum gpiod_line_bias | bias )

Set bias.

Parameters

  settings | Line settings object.
  bias | New bias.

Returns
  0 on success, -1 on failure.

## gpiod_line_settings_set_debounce_period_us()

void gpiod_line_settings_set_debounce_period_us | ( | struct gpiod_line_settings * | settings,
|  | unsigned long | period )

Set debounce period.

Parameters

  settings | Line settings object.
  period | New debounce period in microseconds.

## gpiod_line_settings_set_direction()

int gpiod_line_settings_set_direction | ( | struct gpiod_line_settings * | settings,
|  | enum gpiod_line_direction | direction )

Set direction.

Parameters

  settings | Line settings object.
  direction | New direction.

Returns
  0 on success, -1 on error.

## gpiod_line_settings_set_drive()

int gpiod_line_settings_set_drive | ( | struct gpiod_line_settings * | settings,
|  | enum gpiod_line_drive | drive )

Set drive.

Parameters

  settings | Line settings object.
  drive | New drive setting.

Returns
  0 on success, -1 on failure.

## gpiod_line_settings_set_edge_detection()

int gpiod_line_settings_set_edge_detection | ( | struct gpiod_line_settings * | settings,
|  | enum gpiod_line_edge | edge )

Set edge detection.

Parameters

  settings | Line settings object.
  edge | New edge detection setting.

Returns
  0 on success, -1 on failure.

## gpiod_line_settings_set_event_clock()

int gpiod_line_settings_set_event_clock | ( | struct gpiod_line_settings * | settings,
|  | enum gpiod_line_clock | event_clock )

Set event clock.

Parameters

  settings | Line settings object.
  event_clock | New event clock.

Returns
  0 on success, -1 on failure.

## gpiod_line_settings_set_output_value()

int gpiod_line_settings_set_output_value | ( | struct gpiod_line_settings * | settings,
|  | enum gpiod_line_value | value )

Set the output value.

Parameters

  settings | Line settings object.
  value | New output value.

Returns
  0 on success, -1 on failure.