X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=include%2Fmraa_internal.h;h=428876da55b1ddd433cf7f9be7b09764bf9aaec5;hb=HEAD;hp=0e4c78d1927f399d1ff7135c1ffdbd31eb14b056;hpb=8e305a1032c68cd83057a8b26a42f48bea98ce55;p=contrib%2Fmraa.git diff --git a/include/mraa_internal.h b/include/mraa_internal.h index 0e4c78d..428876d 100644 --- a/include/mraa_internal.h +++ b/include/mraa_internal.h @@ -29,13 +29,14 @@ extern "C" { #endif #include +#include #include "common.h" #include "mraa_internal_types.h" #include "mraa_adv_func.h" -extern mraa_adv_func_t* advance_func; extern mraa_board_t* plat; +extern mraa_iio_info_t* plat_iio; /** * Takes in pin information and sets up the multiplexors. @@ -60,29 +61,74 @@ mraa_platform_t mraa_x86_platform(); mraa_platform_t mraa_arm_platform(); /** -* helper function to check if file exists -* -* @param filename to check -* @return mraa_boolean_t boolean result. -*/ -mraa_boolean_t mraa_file_exist(char *filename); + * runtime detect running usb platform extender + * + * @return mraa_platform_t of the detected platform extender + */ +mraa_platform_t mraa_usb_platform_extender(mraa_board_t* board); + +/** + * runtime detect iio subsystem + * + * @return mraa_result_t indicating success of iio detection + */ +mraa_result_t mraa_iio_detect(); + +/** + * helper function to check if file exists + * + * @param filename to check + * @return mraa_boolean_t boolean result. + */ +mraa_boolean_t mraa_file_exist(const char* filename); + +/** + * helper function to unglob filenames + * + * @param filename to unglob + * @return char * with the existing filename matching the pattern of input. NULL if there is no + *match. Caller must free result + */ +char* mraa_file_unglob(const char* filename); /** -* helper function to unglob filenames -* -* @param filename to unglob -* @return char * with the existing filename matching the pattern of input. NULL if there is no match. Caller must free result -*/ -char * mraa_file_unglob(char *filename); + * helper function to check if file contains a given text + * + * @param filename to check + * @param content to check in file + * @return mraa_boolean_t boolean result. + */ +mraa_boolean_t mraa_file_contains(const char* filename, const char* content); + +/** + * helper function to check if file contains a given text + * + * @param filename to check + * @param content to check in file + * @param content2 to check in same line of file + * @return mraa_boolean_t boolean result. + */ +mraa_boolean_t mraa_file_contains_both(const char* filename, const char* content, const char* content2); /** -* helper function to find out if file that is targeted by a softlink (partially) matches the given name -* -* @param filename of the softlink -* @param (partial) filename that is matched with the filename of the link-targeted file -* @return mraa_boolean_t true when targetname (partially) matches -*/ -mraa_boolean_t mraa_link_targets(char *filename,char *targetname); + * helper function to find out if file that is targeted by a softlink + * (partially) matches the given name + * + * @param filename of the softlink + * @param (partial) filename that is matched with the filename of the link-targeted file + * @return mraa_boolean_t true when targetname (partially) matches + */ +mraa_boolean_t mraa_link_targets(const char* filename, const char* targetname); + +/** + * helper function to find the first i2c bus containing devname starting from + * i2c-n where n is startfrom + * + * @param device name to match + * @param i2c-dev number to start search from + * @return the matching i2c-dev bus id or -1 + */ +int mraa_find_i2c_bus(const char* devname, int startfrom); #ifdef __cplusplus }