/* * Copyright (C) 2018 ETH Zurich and University of Bologna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __HAL_GPIO_GPIO_V3_H__ #define __HAL_GPIO_GPIO_V3_H__ #include "archi/gpio/gpio_v3.h" #define ARCHI_GPIO_PADDIR_IN 0 #define ARCHI_GPIO_PADDIR_OUT 1 #define ARCHI_GPIO_INTTYPE_RISE 1 #define ARCHI_GPIO_INTTYPE_FALL 0 #define ARCHI_GPIO_INTTYPE_RISE_AND_FALL 2 #define ARCHI_GPIO_INTTYPE_NO(gpio) ((gpio) >> 4) #define ARCHI_GPIO_INTTYPE_GPIO(inttype) ((inttype)*16) #define ARCHI_GPIO_INTTYPE_SIZE 2 #define ARCHI_GPIO_INTTYPE_BIT(pad) (((pad) & 0xF) << 1) #define ARCHI_GPIO_INTTYPE_GET(gpio,value) (((value) >> ARCHI_GPIO_INTTYPE_BIT(gpio)) & ((1<