libeasymcp2221 2.0.3
mcp2221_gpio.h
Go to the documentation of this file.
1
6#ifndef MCP2221_GPIO_H
7#define MCP2221_GPIO_H
8
9#include <stdint.h>
10
11#include "mcp2221.h"
12
14
24#define MCP2221_GPIO_KEEP (-1)
25
33typedef struct {
34 int gp0;
35 int gp1;
36 int gp2;
37 int gp3;
39
61
77
96MCP2221_API mcp2221_error_code_t mcp2221_gpio_read_mask(mcp2221_t *dev, int out_state[4], uint8_t *out_valid_mask);
97
99#endif // MCP2221_GPIO_H
Core MCP2221 device and I2C master API.
struct mcp2221_device mcp2221_t
Opaque MCP2221 device handle.
Definition: mcp2221.h:28
mcp2221_error_code_t
Error codes used by libeasymcp2221.
#define MCP2221_API
Export or import a public libeasymcp2221 API symbol.
#define MCP2221_END_DECLS
End a block started by MCP2221_BEGIN_DECLS.
#define MCP2221_BEGIN_DECLS
Begin a block of declarations using C linkage.
mcp2221_error_code_t mcp2221_gpio_read_mask(mcp2221_t *dev, int out_state[4], uint8_t *out_valid_mask)
Read GPIO state and report which GP pins are configured as GPIO.
mcp2221_error_code_t mcp2221_gpio_write(mcp2221_t *dev, const mcp2221_gpio_write_t *wr)
Update GPIO output values.
mcp2221_error_code_t mcp2221_gpio_read(mcp2221_t *dev, int out_state[4])
Read the current state of GP0 through GP3.
Per-pin GPIO output update request.
Definition: mcp2221_gpio.h:33