123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- /**
- * Copyright 2016, yichip Semiconductor(shenzhen office)
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Yichip Semiconductor;
- * the contents of this file may not be disclosed to third parties, copied
- * or duplicated in any form, in whole or in part, without the prior
- * written permission of Yichip Semiconductor.
- */
-
- /**
- *@file gpio.h
- *@brief GPIO support for application.
- */
- #ifndef _GPIO_H_
- #define _GPIO_H_
- #include <stdio.h>
- #include <stdint.h>
- #include "yc11xx.h"
- #include "type.h"
- #define GPIO_NUM_MASK 0x1f
- #define GPIO_WAKEUP_LOW_REG mem_gpio_wakeup_low
- #define GPIO_WAKEUP_HIGH_REG mem_gpio_wakeup_high
- typedef enum
- {
- GPIO_Mode_IN_FLOATING = 0x01,
- GPIO_Mode_IPU = 0x02,
- GPIO_Mode_IPD = 0x03,
- GPIO_Mode_AIN = 0x04,
- }GPIO_InputTypeDef;
- /**
- * @brief gpio output enumeration
- */
- typedef enum
- {
- OUT_LOW = 0,
- OUT_HIGH = 1
- }GPIO_OutputTypeDef;
- typedef enum
- {
- LOW_AWAKEN = 0,
- HIGH_AWAKEN = 1
- }GPIO_AwakenTypeDef;
- void GPIO_SetOut(GPIO_NUM gpio,GPIO_OutputTypeDef GPIO_OUT);
- void GPIO_SetInput(GPIO_NUM gpio,GPIO_InputTypeDef GPIO_InputMode);
- void GPIO_ClearWakeup(GPIO_NUM gpio);
- void GPIO_SetGpioMultFunction(GPIO_NUM gpio, uint8_t Func);
- BOOL gpioGetBit(uint8_t Num, uint32_t regBase);
- BOOL GPIO_GetInputStatus(GPIO_NUM gpio);
- void GPIO_SetWakeup(GPIO_NUM gpio, GPIO_AwakenTypeDef AWAKEN);
- void GPIO_SetWakeupByCurrentState(GPIO_NUM gpio);
- #endif
|