/**************************************************************************** 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. ****************************************************************************/ /* os shim includes */ #include "os_types.h" #include "os_task.h" #include "os_utils.h" /* common includes */ #include "iot_io.h" #include "iot_bitops.h" #include "iot_pkt.h" #include "iot_ipc.h" #include "iot_dbglog_api.h" #include "iot_config.h" /* driver includes */ #include "iot_clock.h" #include "iot_uart.h" #include "iot_led.h" /* cli includes */ #include "iot_cli.h" #include "iot_uart_h.h" /* debug includes*/ #include "dbg_io.h" #include "iot_gpio_api.h" #include "hw_reg_api.h" #include "gpio_mtx_reg.h" #include "pin_rf.h" #include "iot_share_task.h" #define BIT_INT_CLR 0 #define BIT_INT_ENA 1 #define BIT_INT_ST 2 #define BIT_INT_RAW 3 #define BIT_INT_TYP 4 #define BIT_WUP_ENA 7 #define BIT_IN_DATA 8 #define BIT_IN_ENA 9 #define BIT_OUT_ENA 10 #define BIT_OUT_DATA 11 #define BIT_OD_MODE 13 #define TEST_GPIO_INPUT 0 #define TEST_GPIO_OUTPUT 1 #define TEST_GPIO_INT 2 char test_case = TEST_GPIO_INT; extern int platform_init(); os_task_h test_init_handle; static void gpio_func_set(uint8_t gpio_no, uint8_t func) { uint32_t tmp; uint32_t addr; if(gpio_no < 52){ addr = CFG_GPIO00_PIN_CFG_ADDR + (gpio_no << 2); } else { return ; } tmp = PIN_RF_READ_REG(addr); /* Set function */ tmp &= GPIO00_FUNC_SEL_MASK; tmp |= (func<