Private
Public Access
2
0

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:
Thomas Ingleby
2014-05-01 16:55:23 +01:00
parent d4427ec35e
commit e96df16f75
6 changed files with 224 additions and 24 deletions

View File

@@ -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
*