Private
Public Access
2
0

Merge branch 'hook'

Conflicts:
	include/intel_galileo_rev_d.h
	include/intel_galileo_rev_g.h
	include/mraa_adv_func.h
	include/mraa_internal.h
	src/gpio/gpio.c
	src/mraa.c
This commit is contained in:
Thomas Ingleby
2014-07-11 11:56:45 +01:00
9 changed files with 154 additions and 17 deletions

View File

@@ -24,7 +24,17 @@
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include "mraa_internal.h"
#define MRAA_INTEL_GALILEO_REV_D_PINCOUNT 25
mraa_board_t*
mraa_intel_galileo_rev_d();
mraa_intel_galileo_rev_d(mraa_adv_func* adv);
#ifdef __cplusplus
}
#endif

View File

@@ -24,7 +24,17 @@
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include "mraa_internal.h"
#define MRAA_INTEL_GALILEO_GEN_2_PINCOUNT 25
mraa_board_t*
mraa_intel_galileo_gen2();
mraa_intel_galileo_gen2(mraa_adv_func* adv);
#ifdef __cplusplus
}
#endif

49
include/mraa_adv_func.h Normal file
View File

@@ -0,0 +1,49 @@
/*
* Author: Thomas Ingleby <thomas.c.ingleby@intel.com>
* Copyright (c) 2014 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#pragma once
#include "common.h"
#include "mraa.h"
#include "types.h"
typedef struct {
mraa_result_t (*gpio_init_pre) (int pin);
mraa_result_t (*gpio_init_post) (mraa_gpio_context dev);
mraa_result_t (*gpio_mode_replace) (mraa_gpio_context dev, gpio_mode_t mode);
mraa_result_t (*gpio_mode_pre) (mraa_gpio_context dev, gpio_mode_t mode);
mraa_result_t (*gpio_mode_post) (mraa_gpio_context dev, gpio_mode_t mode);
mraa_result_t (*gpio_dir_replace) (mraa_gpio_context dev, gpio_dir_t dir);
mraa_result_t (*gpio_dir_pre) (mraa_gpio_context dev, gpio_dir_t dir);
mraa_result_t (*gpio_dir_post) (mraa_gpio_context dev, gpio_dir_t dir);
mraa_result_t (*gpio_write_pre) (mraa_gpio_context dev, int value);
mraa_result_t (*gpio_write_post) (mraa_gpio_context dev, int value);
mraa_result_t (*gpio_mmaped_write_replace) (mraa_gpio_context dev, int value);
mraa_result_t (*gpio_mmaped_write_pre) (mraa_gpio_context dev, int value);
mraa_result_t (*gpio_mmaped_write_post) (mraa_gpio_context dev, int value);
} mraa_adv_func;

View File

@@ -24,9 +24,15 @@
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include "common.h"
#include "mraa_internal_types.h"
extern mraa_adv_func advance_func;
/** Setup gpio
*
* Will check input is valid for gpio and will also setup required multiplexers.
@@ -84,3 +90,7 @@ mraa_result_t mraa_swap_complex_gpio(int pin, int out);
* @return mraa_result_t of operation
*/
mraa_result_t mraa_setup_uart(int index);
#ifdef __cplusplus
}
#endif

View File

@@ -30,6 +30,10 @@
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
@@ -91,3 +95,7 @@ extern int i2c_smbus_write_i2c_block_data(int fd, uint8_t command, uint8_t lengt
extern int i2c_smbus_block_process_call(int fd, uint8_t command, uint8_t length,
uint8_t *values);
#ifdef __cplusplus
}
#endif

View File

@@ -24,5 +24,13 @@
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
const char* gVERSION;
const char* gVERSION_SHORT;
#ifdef __cplusplus
}
#endif