pinmap: GPIO pin map added.
* maa_gpio_init can take the IO number read physically off the board. * maa_check_gpio will also set up mutiplexers if needed * Intel Galileo Rev D board data added Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
This commit is contained in:
23
api/maa.h
23
api/maa.h
@@ -45,23 +45,23 @@ typedef enum {
|
||||
MAA_ERROR_INVALID_RESOURCE = 7,
|
||||
MAA_ERROR_INVALID_QUEUE_TYPE = 8,
|
||||
MAA_ERROR_NO_DATA_AVAILABLE = 9,
|
||||
MAA_ERROR_INVALID_PLATFORM = 10,
|
||||
MAA_ERROR_PLATFORM_NOT_INITIALISED = 11,
|
||||
|
||||
MAA_ERROR_UNSPECIFIED = 99
|
||||
} maa_result_t;
|
||||
|
||||
typedef unsigned int maa_boolean_t;
|
||||
|
||||
typedef union {
|
||||
struct {
|
||||
typedef struct {
|
||||
maa_boolean_t valid:1;
|
||||
maa_boolean_t gpio:1;
|
||||
maa_boolean_t pwm:1;
|
||||
maa_boolean_t fast_gpio:1;
|
||||
maa_boolean_t spi:1;
|
||||
maa_boolean_t i2c:1;
|
||||
};
|
||||
int raw;
|
||||
} maa_pincapabilities_t;
|
||||
}
|
||||
maa_pincapabilities_t;
|
||||
|
||||
typedef struct {
|
||||
unsigned int pin;
|
||||
@@ -75,11 +75,18 @@ typedef struct {
|
||||
maa_pincapabilities_t capabilites;
|
||||
maa_mux_t mux[4];
|
||||
unsigned int mux_total;
|
||||
} maa_pininfo;
|
||||
} maa_pininfo_t;
|
||||
|
||||
typedef struct {
|
||||
unsigned int gpio_count;
|
||||
unsigned int aio_count;
|
||||
unsigned int pwm_count;
|
||||
maa_pininfo_t* pins;
|
||||
} maa_board_t;
|
||||
|
||||
unsigned int maa_check_gpio(int pin);
|
||||
unsigned int maa_check_aio(int pin);
|
||||
unsigned int maa_check_pwm(int pin);
|
||||
//unsigned int maa_check_aio(int pin);
|
||||
//unsigned int maa_check_pwm(int pin);
|
||||
|
||||
/** Get the version string of maa autogenerated from git tag
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user