⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hal_spi.h

📁 这是nrf24lu1的无线鼠标源代码,应用平台是keil c
💻 H
字号:
/** @file
 * Interface functions for the SPI bus
 *
 * @author Ole Saether
 * @defgroup nordic_spi SPI HAL
 * @{
 * @ingroup nordic_hal
 * Interface functions for the SPI bus
 */
#ifndef HAL_SPI_H__
#define HAL_SPI_H__

#include <stdint.h>

/** Available SPI clock divide factors
 * The input argument of hal_spi_master_init must be defined in this @c enum
 */
typedef enum
{
    SPI_CLK_DIV2,       ///< CPU clock/2
    SPI_CLK_DIV4,       ///< CPU clock/4
    SPI_CLK_DIV8,       ///< CPU clock/8
    SPI_CLK_DIV16,      ///< CPU clock/16
    SPI_CLK_DIV32,      ///< CPU clock/32
    SPI_CLK_DIV64,      ///< CPU clock/64
    SPI_CLK_DIV128      ///< CPU clock/128
} hal_spi_clkdivider_t;

/** Function to initialize and enable the SPI master.
 */
void hal_spi_master_init(hal_spi_clkdivider_t ck);

/** Function to read/write a byte on the SPI master
 * This function writes the byte to the SPI master, then enters an infinite
 * loop waiting for the operation to finish. When the operation is finished
 * the SPI master interrupt bit is cleared and the received byte is returned.
 * @param b byte to write
 * @return The read byte
 */
uint8_t hal_spi_master_read_write(uint8_t b);

#endif // HAL_SPI_H__
/** @} */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -