Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:04

0001 /**
0002  * @file
0003  *
0004  * @ingroup raspberrypi_gpio
0005  *
0006  * @brief Raspberry Pi specific GPIO definitions.
0007  */
0008 
0009 /*
0010  *  Copyright (c) 2015 Andre Marques <andre.lousa.marques at gmail.com>
0011  *
0012  *  The license and distribution terms for this file may be
0013  *  found in the file LICENSE in this distribution or at
0014  *  http://www.rtems.org/license/LICENSE.
0015  */
0016 
0017 #ifndef LIBBSP_ARM_RASPBERRYPI_RPI_GPIO_H
0018 #define LIBBSP_ARM_RASPBERRYPI_RPI_GPIO_H
0019 
0020 #include <rtems.h>
0021 
0022 #ifdef __cplusplus
0023 extern "C" {
0024 #endif /* __cplusplus */
0025 
0026 /**
0027  * @brief  Raspberry Pi GPIO functions.
0028  */
0029 #define RPI_DIGITAL_IN  0
0030 #define RPI_DIGITAL_OUT 1
0031 #define RPI_ALT_FUNC_0  4
0032 #define RPI_ALT_FUNC_1  5
0033 #define RPI_ALT_FUNC_2  6
0034 #define RPI_ALT_FUNC_3  7
0035 #define RPI_ALT_FUNC_4  3
0036 #define RPI_ALT_FUNC_5  2
0037 #define RPI_ALT_FUNC_MASK 7
0038 
0039 /**
0040  * @brief Setups a JTAG interface.
0041  *
0042  * @retval RTEMS_SUCCESSFUL JTAG interface successfully configured.
0043  * @retval * At least one of the required pins is currently
0044  *            occupied, @see rtems_gpio_request_pin_group().
0045  */
0046 extern rtems_status_code rpi_gpio_select_jtag(void);
0047 
0048 /**
0049  * @brief Setups a SPI interface.
0050  *
0051  * @retval RTEMS_SUCCESSFUL SPI interface successfully configured.
0052  * @retval * At least one of the required pins is currently
0053  *            occupied, @see rtems_gpio_request_pin_group().
0054  */
0055 extern rtems_status_code rpi_gpio_select_spi(void);
0056 
0057 /**
0058  * @brief Setups a I2C interface.
0059  *
0060  * @retval RTEMS_SUCCESSFUL I2C interface successfully configured.
0061  * @retval * At least one of the required pins is currently
0062  *            occupied, @see rtems_gpio_request_pin_group().
0063  */
0064 extern rtems_status_code rpi_gpio_select_i2c(void);
0065 
0066 #ifdef __cplusplus
0067 }
0068 #endif /* __cplusplus */
0069 
0070 #endif /* LIBBSP_ARM_RASPBERRYPI_RPI_GPIO_H */