Developer World
Spresense SDK Library v3.2.0-ebc0364
cxd56_gpioif.h
Go to the documentation of this file.
1/****************************************************************************
2 * boards/arm/cxd56xx/spresense/include/cxd56_gpioif.h
3 *
4 * Licensed to the Apache Software Foundation (ASF) under one or more
5 * contributor license agreements. See the NOTICE file distributed with
6 * this work for additional information regarding copyright ownership. The
7 * ASF licenses this file to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance with the
9 * License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 * License for the specific language governing permissions and limitations
17 * under the License.
18 *
19 ****************************************************************************/
24#ifndef __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_GPIOIF_H
25#define __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_GPIOIF_H
26
27/****************************************************************************
28 * Included Files
29 ****************************************************************************/
30
31#include <nuttx/config.h>
32
33#include <stdint.h>
34#include <stdbool.h>
35
36#include <nuttx/irq.h>
37
38#undef EXTERN
39#if defined(__cplusplus)
40#define EXTERN extern "C"
41extern "C"
42{
43#else
44#define EXTERN extern
45#endif
46
52/****************************************************************************
53 * Pre-processor Definitions
54 ****************************************************************************/
55
62#define PIN_FLOAT (0) /* Floating */
63#define PIN_PULLUP (1) /* Internal Weak Pull Up */
64#define PIN_PULLDOWN (2) /* Internal Weak Pull Down */
65#define PIN_BUSKEEPER (3) /* Internal Bus-Keeper */
66
67/* @} */
68
75#define INT_HIGH_LEVEL (2) /* High Level */
76#define INT_LOW_LEVEL (3) /* Low Level */
77#define INT_RISING_EDGE (4) /* Rising Edge */
78#define INT_FALLING_EDGE (5) /* Falling Edge */
79#define INT_BOTH_EDGE (7) /* Both Edge */
80
81/* @} */
82
83#ifndef __ASSEMBLY__
84
85/****************************************************************************
86 * Public Function Prototypes
87 ****************************************************************************/
88
105int board_gpio_config(uint32_t pin, int mode, bool input, bool drive,
106 int pull);
107
124int board_gpio_status(uint32_t pin, bool *input, bool *output, bool *drive,
125 int *pull);
126
134void board_gpio_write(uint32_t pin, int value);
135
144int board_gpio_read(uint32_t pin);
145
162int board_gpio_intconfig(uint32_t pin, int mode, bool filter, xcpt_t isr);
163
180int board_gpio_intstatus(uint32_t pin, int *mode,
181 bool *filter, bool *enabled);
182
192int board_gpio_int(uint32_t pin, bool enable);
193
194/* @} gpioif */
195
196#undef EXTERN
197#if defined(__cplusplus)
198}
199#endif
200
201#endif /* __ASSEMBLY__ */
202#endif /* __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_GPIOIF_H */
void board_gpio_write(uint32_t pin, int value)
int board_gpio_intconfig(uint32_t pin, int mode, bool filter, xcpt_t isr)
int board_gpio_status(uint32_t pin, bool *input, bool *output, bool *drive, int *pull)
int board_gpio_config(uint32_t pin, int mode, bool input, bool drive, int pull)
int board_gpio_read(uint32_t pin)
int board_gpio_intstatus(uint32_t pin, int *mode, bool *filter, bool *enabled)
int board_gpio_int(uint32_t pin, bool enable)