String based IO initialization for MRAA
Signed-off-by: Mihai Stefanescu <mihai.stefanescu@rinftech.com> Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit is contained in:
committed by
Noel Eck
parent
4b2279704b
commit
ae391fe9fe
84
include/initio/initio_keys.h
Normal file
84
include/initio/initio_keys.h
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* Author: Mihai Stefanescu <mihai.stefanescu@rinftech.com>
|
||||
* Copyright (c) 2018 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
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*gpio modes */
|
||||
#define G_MODE_STRONG "mode_strong"
|
||||
#define G_MODE_PULLUP "mode_pullup"
|
||||
#define G_MODE_PULLDOWN "mode_pulldown"
|
||||
#define G_MODE_HIZ "mode_hiz"
|
||||
#define G_MODE_ACTIVE_LOW "mode_active_low"
|
||||
#define G_MODE_OPEN_DRAIN "mode_open_drain"
|
||||
#define G_MODE_OPEN_SOURCE "mode_open_source"
|
||||
|
||||
/*gpio direction modes */
|
||||
#define G_DIR_OUT "out"
|
||||
#define G_DIR_IN "in"
|
||||
#define G_DIR_OUT_HIGH "out_high"
|
||||
#define G_DIR_OUT_LOW "out_low"
|
||||
|
||||
/*gpio edge modes */
|
||||
#define G_EDGE_NONE "edge_none"
|
||||
#define G_EDGE_BOTH "edge_both"
|
||||
#define G_EDGE_RISING "edge_rising"
|
||||
#define G_EDGE_FALLING "edge_falling"
|
||||
|
||||
/*gpio input modes */
|
||||
#define G_INPUT_ACTIVE_HIGH "input_high"
|
||||
#define G_INPUT_ACTIVE_LOW "input_low"
|
||||
|
||||
/*gpio output driver modes */
|
||||
#define G_OUTPUT_OPEN_DRAIN "output_open_drain"
|
||||
#define G_OUTPUT_PUSH_PULL "output_push_pull"
|
||||
/*---------------------------------------------*/
|
||||
|
||||
/* i2c modes */
|
||||
#define I_MODE_STD "std"
|
||||
#define I_MODE_FAST "fast"
|
||||
#define I_MODE_HIGH "high"
|
||||
/*---------------------------------------------*/
|
||||
|
||||
/* spi modes */
|
||||
#define S_MODE_0 "mode0"
|
||||
#define S_MODE_1 "mode1"
|
||||
#define S_MODE_2 "mode2"
|
||||
#define S_MODE_3 "mode3"
|
||||
/*---------------------------------------------*/
|
||||
|
||||
/* uart parity types */
|
||||
#define U_PARITY_NONE "N"
|
||||
#define U_PARITY_EVEN "E"
|
||||
#define U_PARITY_ODD "O"
|
||||
#define U_PARITY_MARK "M"
|
||||
#define U_PARITY_SPACE "S"
|
||||
/*---------------------------------------------*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -86,12 +86,14 @@
|
||||
#define BUS_KEY "bus"
|
||||
|
||||
// IO keys
|
||||
#define GPIO_KEY "GPIO"
|
||||
#define SPI_KEY "SPI"
|
||||
#define UART_KEY "UART"
|
||||
#define I2C_KEY "I2C"
|
||||
#define PWM_KEY "PWM"
|
||||
#define AIO_KEY "AIO"
|
||||
#define AIO_KEY "a"
|
||||
#define GPIO_KEY "g"
|
||||
#define I2C_KEY "i"
|
||||
#define IIO_KEY "ii"
|
||||
#define PWM_KEY "p"
|
||||
#define SPI_KEY "s"
|
||||
#define UART_KEY "u"
|
||||
#define UART_OW_KEY "ow"
|
||||
|
||||
#define MRAA_JSONPLAT_ENV_VAR "MRAA_JSON_PLATFORM"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user