* @brief Miscellaneous GPIO request flags.
*/
enum {
- GPIOD_LINE_REQUEST_OPEN_DRAIN = GPIOD_BIT(0),
+ GPIOD_LINE_REQUEST_FLAG_OPEN_DRAIN = GPIOD_BIT(0),
/**< The line is an open-drain port. */
- GPIOD_LINE_REQUEST_OPEN_SOURCE = GPIOD_BIT(1),
+ GPIOD_LINE_REQUEST_FLAG_OPEN_SOURCE = GPIOD_BIT(1),
/**< The line is an open-source port. */
- GPIOD_LINE_REQUEST_ACTIVE_LOW = GPIOD_BIT(2),
+ GPIOD_LINE_REQUEST_FLAG_ACTIVE_LOW = GPIOD_BIT(2),
/**< The active state of the line is low (high is the default). */
};
int rv, fd;
if ((config->request_type != GPIOD_LINE_REQUEST_DIRECTION_OUTPUT) &&
- (config->flags & (GPIOD_LINE_REQUEST_OPEN_DRAIN |
- GPIOD_LINE_REQUEST_OPEN_SOURCE))) {
+ (config->flags & (GPIOD_LINE_REQUEST_FLAG_OPEN_DRAIN |
+ GPIOD_LINE_REQUEST_FLAG_OPEN_SOURCE))) {
errno = EINVAL;
return -1;
}
memset(&req, 0, sizeof(req));
- if (config->flags & GPIOD_LINE_REQUEST_OPEN_DRAIN)
+ if (config->flags & GPIOD_LINE_REQUEST_FLAG_OPEN_DRAIN)
req.flags |= GPIOHANDLE_REQUEST_OPEN_DRAIN;
- if (config->flags & GPIOD_LINE_REQUEST_OPEN_SOURCE)
+ if (config->flags & GPIOD_LINE_REQUEST_FLAG_OPEN_SOURCE)
req.flags |= GPIOHANDLE_REQUEST_OPEN_SOURCE;
- if (config->flags & GPIOD_LINE_REQUEST_ACTIVE_LOW)
+ if (config->flags & GPIOD_LINE_REQUEST_FLAG_ACTIVE_LOW)
req.flags |= GPIOHANDLE_REQUEST_ACTIVE_LOW;
if (config->request_type == GPIOD_LINE_REQUEST_DIRECTION_INPUT)
req.lineoffset = gpiod_line_offset(line);
req.handleflags |= GPIOHANDLE_REQUEST_INPUT;
- if (config->flags & GPIOD_LINE_REQUEST_OPEN_DRAIN)
+ if (config->flags & GPIOD_LINE_REQUEST_FLAG_OPEN_DRAIN)
req.handleflags |= GPIOHANDLE_REQUEST_OPEN_DRAIN;
- if (config->flags & GPIOD_LINE_REQUEST_OPEN_SOURCE)
+ if (config->flags & GPIOD_LINE_REQUEST_FLAG_OPEN_SOURCE)
req.handleflags |= GPIOHANDLE_REQUEST_OPEN_SOURCE;
- if (config->flags & GPIOD_LINE_REQUEST_ACTIVE_LOW)
+ if (config->flags & GPIOD_LINE_REQUEST_FLAG_ACTIVE_LOW)
req.handleflags |= GPIOHANDLE_REQUEST_ACTIVE_LOW;
if (config->request_type == GPIOD_LINE_REQUEST_EVENT_RISING_EDGE)
gpiod_line_bulk_add(&bulk, line);
}
- flags = active_low ? GPIOD_LINE_REQUEST_ACTIVE_LOW : 0;
+ flags = active_low ? GPIOD_LINE_REQUEST_FLAG_ACTIVE_LOW : 0;
status = gpiod_line_request_bulk_input_flags(&bulk, consumer, flags);
if (status < 0) {
gpiod_line_bulk_add(&bulk, line);
}
- flags = active_low ? GPIOD_LINE_REQUEST_ACTIVE_LOW : 0;
+ flags = active_low ? GPIOD_LINE_REQUEST_FLAG_ACTIVE_LOW : 0;
status = gpiod_line_request_bulk_output_flags(&bulk, consumer,
flags, values);
gpiod_line_bulk_add(&bulk, line);
}
- flags = active_low ? GPIOD_LINE_REQUEST_ACTIVE_LOW : 0;
+ flags = active_low ? GPIOD_LINE_REQUEST_FLAG_ACTIVE_LOW : 0;
rv = gpiod_line_request_bulk_both_edges_events_flags(&bulk,
consumer, flags);
TEST_ASSERT_NOT_NULL(line);
rv = gpiod_line_request_rising_edge_events_flags(line, TEST_CONSUMER,
- GPIOD_LINE_REQUEST_ACTIVE_LOW);
+ GPIOD_LINE_REQUEST_FLAG_ACTIVE_LOW);
TEST_ASSERT_RET_OK(rv);
test_set_event(0, 7, TEST_EVENT_RISING, 100);
TEST_ASSERT_NOT_NULL(line);
rv = gpiod_line_request_input_flags(line, TEST_CONSUMER,
- GPIOD_LINE_REQUEST_ACTIVE_LOW);
+ GPIOD_LINE_REQUEST_FLAG_ACTIVE_LOW);
TEST_ASSERT_RET_OK(rv);
test_tool_run("gpioinfo", (char *)NULL);
gpiod_line_release(line);
status = gpiod_line_request_input_flags(line, TEST_CONSUMER,
- GPIOD_LINE_REQUEST_ACTIVE_LOW);
+ GPIOD_LINE_REQUEST_FLAG_ACTIVE_LOW);
TEST_ASSERT_RET_OK(status);
TEST_ASSERT_EQ(gpiod_line_direction(line), GPIOD_LINE_DIRECTION_INPUT);
config.request_type = GPIOD_LINE_REQUEST_DIRECTION_OUTPUT;
config.consumer = TEST_CONSUMER;
- config.flags = GPIOD_LINE_REQUEST_OPEN_DRAIN;
+ config.flags = GPIOD_LINE_REQUEST_FLAG_OPEN_DRAIN;
status = gpiod_line_request(line, &config, 0);
TEST_ASSERT_RET_OK(status);
gpiod_line_release(line);
- config.flags = GPIOD_LINE_REQUEST_OPEN_SOURCE;
+ config.flags = GPIOD_LINE_REQUEST_FLAG_OPEN_SOURCE;
status = gpiod_line_request(line, &config, 0);
TEST_ASSERT_RET_OK(status);
TEST_ASSERT_NOT_NULL(line);
rv = gpiod_line_request_input_flags(line, TEST_CONSUMER,
- GPIOD_LINE_REQUEST_OPEN_DRAIN);
+ GPIOD_LINE_REQUEST_FLAG_OPEN_DRAIN);
TEST_ASSERT_EQ(rv, -1);
TEST_ASSERT_ERRNO_IS(EINVAL);
rv = gpiod_line_request_input_flags(line, TEST_CONSUMER,
- GPIOD_LINE_REQUEST_OPEN_SOURCE);
+ GPIOD_LINE_REQUEST_FLAG_OPEN_SOURCE);
TEST_ASSERT_EQ(rv, -1);
TEST_ASSERT_ERRNO_IS(EINVAL);
}