GPIO request configuration
- group request_config
Functions for manipulating request configuration objects.
Request config objects are used to pass a set of options to the kernel at the time of the line request. The mutators don’t return error values. If the values are invalid, in general they are silently adjusted to acceptable ranges.
Functions
-
struct gpiod_request_config *gpiod_request_config_new(void)
Create a new request config object.
- Returns:
New request config object or NULL on error. The returned object must be freed by the caller using gpiod_request_config_free.
-
void gpiod_request_config_free(struct gpiod_request_config *config)
Free the request config object and release all associated resources.
- Parameters:
config – Line config object.
-
void gpiod_request_config_set_consumer(struct gpiod_request_config *config, const char *consumer)
Set the consumer name for the request.
Note
If the consumer string is too long, it will be truncated to the max accepted length.
- Parameters:
config – Request config object.
consumer – Consumer name.
-
const char *gpiod_request_config_get_consumer(struct gpiod_request_config *config)
Get the consumer name configured in the request config.
- Parameters:
config – Request config object.
- Returns:
Consumer name stored in the request config.
-
void gpiod_request_config_set_event_buffer_size(struct gpiod_request_config *config, size_t event_buffer_size)
Set the size of the kernel event buffer for the request.
Note
The kernel may adjust the value if it’s too high. If set to 0, the default value will be used.
Note
The kernel buffer is distinct from and independent of the user space buffer (gpiod_edge_event_buffer_new).
- Parameters:
config – Request config object.
event_buffer_size – New event buffer size.
-
size_t gpiod_request_config_get_event_buffer_size(struct gpiod_request_config *config)
Get the edge event buffer size for the request config.
- Parameters:
config – Request config object.
- Returns:
Edge event buffer size setting from the request config.
-
struct gpiod_request_config *gpiod_request_config_new(void)