Private
Public Access
2
0

Merge branch 'pinmap-i2cspi' of github.com:tingleby/maa into tingleby-pinmap-i2cspi

This commit is contained in:
Brendan Le Foll
2014-05-02 16:43:10 +01:00
7 changed files with 102 additions and 11 deletions

View File

@@ -49,11 +49,22 @@ typedef struct {
int hz; /**< frequency of communication */
int fh; /**< the file handle to the /dev/i2c-* device */
int addr; /**< the address of the i2c slave */
maa_gpio_context gpio;
/*@}*/
} maa_i2c_context;
maa_i2c_context* maa_i2c_init();
/** Initialise i2c context, using board defintions
*
* @param bus i2c bus to use
* @return maa_i2c_context i2c context ready for other calls.
*/
maa_i2c_context* maa_i2c_init(int bus);
/** Initialise i2c context, passing in spi bus to use.
*
* @param bus The i2c bus to use i.e. /dev/i2c-2 would be "2"
* @return maa_i2c_context i2c context ready for other calls.
*/
maa_i2c_context* maa_i2c_init_raw(unsigned int bus);
/** Sets the frequency of the i2c context
*

View File

@@ -107,6 +107,10 @@ typedef struct {
unsigned int gpio_count; /**< GPIO Count */
unsigned int aio_count; /**< Analog In Count */
unsigned int pwm_count; /**< PWM Count */
unsigned int i2c_bus_count; /**< Usable i2c Count */
unsigned int i2c_bus[8]; /**< Array of i2c */
unsigned int spi_bus_count; /**< Usable spi Count */
double spi_bus[8]; /**< Array of spi */
maa_pininfo_t* pins; /**< Pointer to pin array */
/*@}*/
} maa_board_t;
@@ -134,7 +138,11 @@ unsigned int maa_check_gpio(int pin);
*/
unsigned int maa_check_aio(int pin);
//unsigned int maa_check_pwm(int pin);
/** Check i2c interface, sets up multiplexer on device.
*
* @return unsigned int if using /dev/i2c-2 returned would be 2
*/
unsigned int maa_check_i2c();
/** Get the version string of maa autogenerated from git tag
*