71 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			71 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
/****************************************************************************
 | 
						|
 | 
						|
Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED.
 | 
						|
 | 
						|
This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT
 | 
						|
be copied by any method or incorporated into another program without
 | 
						|
the express written consent of Aerospace C.Power. This Information or any portion
 | 
						|
thereof remains the property of Aerospace C.Power. The Information contained herein
 | 
						|
is believed to be accurate and Aerospace C.Power assumes no responsibility or
 | 
						|
liability for its use in any way and conveys no license or title under
 | 
						|
any patent or copyright and makes no representation or warranty that this
 | 
						|
Information is free from patent or copyright infringement.
 | 
						|
 | 
						|
****************************************************************************/
 | 
						|
 | 
						|
#ifndef IOT_OEM_STRUCT_V0_H
 | 
						|
#define IOT_OEM_STRUCT_V0_H
 | 
						|
 | 
						|
#ifdef __cplusplus
 | 
						|
extern "C" {
 | 
						|
#endif
 | 
						|
 | 
						|
/* pack for the structures in the whole file */
 | 
						|
#pragma pack(push)  // save the pack status
 | 
						|
#pragma pack(1)     // 1 byte align
 | 
						|
 | 
						|
/* ================= board information structures version 0 ================= */
 | 
						|
/* initial version, resource allocation for gpio and uart is defined,
 | 
						|
 * but only signal binding is used.
 | 
						|
 */
 | 
						|
 | 
						|
/* define the number of hardware resource, kunlun1 and kunlun2 */
 | 
						|
#define IOT_PIN_MAX_NUM_V0                 49
 | 
						|
#define IOT_UART_MAX_NUM_V0                4
 | 
						|
#define IOT_GPIO_MAX_NUM_V0                5
 | 
						|
 | 
						|
typedef struct _iot_pin_config_v0_t {
 | 
						|
    uint8_t gpio;   //gpio number
 | 
						|
    uint8_t io;     //usage of gpio, input or output
 | 
						|
    uint8_t func;   //pin function
 | 
						|
    uint8_t inid;   //input signal number
 | 
						|
    uint8_t outid;  //output signal number
 | 
						|
    uint8_t used;   //gpio is used or not
 | 
						|
} iot_pin_cfg_v0_t;
 | 
						|
 | 
						|
typedef struct _iot_uart_config_v0_t {
 | 
						|
    uint8_t port;   //uart number
 | 
						|
    uint8_t type;   //purpose of uart
 | 
						|
    uint8_t used;   //uart is used or not
 | 
						|
} iot_uart_cfg_v0_t;
 | 
						|
 | 
						|
typedef struct _iot_gpio_config_v0_t {
 | 
						|
    uint8_t gpio;   //gpio number
 | 
						|
    uint8_t type;   //purpose of gpio
 | 
						|
    uint8_t used;   //gpio is used or not
 | 
						|
} iot_gpio_cfg_v0_t;
 | 
						|
 | 
						|
typedef struct _iot_board_info_v0_t {
 | 
						|
    iot_pin_cfg_v0_t     pin[IOT_PIN_MAX_NUM_V0];
 | 
						|
    iot_uart_cfg_v0_t    port[IOT_UART_MAX_NUM_V0];
 | 
						|
    iot_gpio_cfg_v0_t    gpio[IOT_GPIO_MAX_NUM_V0];
 | 
						|
} iot_board_info_v0_t;
 | 
						|
 | 
						|
#pragma pack(pop)   // restore the pack status
 | 
						|
 | 
						|
#ifdef __cplusplus
 | 
						|
}
 | 
						|
#endif
 | 
						|
 | 
						|
#endif
 |