Merge branch 'pinmap-i2cspi' of github.com:tingleby/maa into tingleby-pinmap-i2cspi
This commit is contained in:
15
api/i2c.h
15
api/i2c.h
@@ -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
|
||||
*
|
||||
|
||||
10
api/maa.h
10
api/maa.h
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user