![]() |
|
|||
File indexing completed on 2025-05-11 08:23:04
0001 /** 0002 * @file 0003 * 0004 * @ingroup raspberrypi_spi 0005 * 0006 * @brief Raspberry Pi specific SPI definitions. 0007 */ 0008 0009 /* 0010 * Copyright (c) 2014-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_SPI_H 0018 #define LIBBSP_ARM_RASPBERRYPI_SPI_H 0019 0020 #include <rtems/libi2c.h> 0021 0022 #ifdef __cplusplus 0023 extern "C" { 0024 #endif /* __cplusplus */ 0025 0026 /** 0027 * @name SPI constants. 0028 * 0029 * @{ 0030 */ 0031 0032 /** 0033 * @brief GPU processor core clock rate in Hz. 0034 * 0035 * Unless configured otherwise on a "config.txt" file present on the SD card 0036 * the GPU defaults to 250 MHz. Currently only 250 MHz is supported. 0037 */ 0038 0039 /* TODO: It would be nice if this value could be probed at startup, probably 0040 * using the Mailbox interface since the usual way of setting this on 0041 * the hardware is through a "config.txt" text file on the SD card. 0042 * Having this setup on the configure.ac script would require changing 0043 * the same setting on two different places. */ 0044 #define GPU_CORE_CLOCK_RATE 250000000 0045 0046 /** @} */ 0047 0048 /** 0049 * @name SPI directives. 0050 * 0051 * @{ 0052 */ 0053 0054 /** 0055 * @brief Setups the Raspberry Pi SPI bus (located on the GPIO header) 0056 * on the "/dev/spi" device file, and registers the bus on the 0057 * libi2c API. 0058 * 0059 * @param[in] bidirectional_mode If TRUE sets the SPI bus to use 2-wire SPI, 0060 * where the MOSI data line doubles as the 0061 * slave out (SO) and slave in (SI) data lines. 0062 * If FALSE the bus defaults to the usual 0063 * 3-wire SPI, with 2 separate data lines 0064 * (MOSI and MISO). 0065 * 0066 * @retval Returns libi2c bus number. 0067 * @retval <0 Could not register the bus. See @see rtems_libi2c_register_bus(). 0068 */ 0069 extern int rpi_spi_init(bool bidirectional_mode); 0070 0071 /** @} */ 0072 0073 #ifdef __cplusplus 0074 } 0075 #endif /* __cplusplus */ 0076 0077 #endif /* LIBBSP_ARM_RASPBERRYPI_SPI_H */
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |