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

📄 old_lib_spi.h

📁 ARM9200开发板的ROM boot程序源码1.0
💻 H
字号:
//*---------------------------------------------------------------------------
//*      ATMEL Microcontroller Software Support  -  ROUSSET  -
//*---------------------------------------------------------------------------
//* The software is delivered "AS IS" without warranty or condition of any
//* kind, either express, implied or statutory. This includes without
//* limitation any warranty or condition with respect to merchantability or
//* fitness for any particular purpose, or against the infringements of
//* intellectual property rights of others.
//*-----------------------------------------------------------------------------
//* File Name           : lib_spi.h
//* Object              : Serial Peripheral Interface Library Header.
//*
//* 1.0 01/04/00 JCZ    : Creation
//*---------------------------------------------------------------------------

#ifndef lib_spi_h
#define lib_spi_h

#include    "periph/stdc/std_c.h"
#include    "periph/spi/spi.h"
#include    "periph/pio/lib_pio.h"


typedef struct _AT91S_SPIDesc
{
    AT91PS_SPI         		spi_base ;
    const AT91PS_PIO        pio_base ;
    u_char             		periph_id ;
    u_char                  pin_spck ;
    u_char                  pin_miso ;
    u_char                  pin_mosi ;
    u_char                 pin_npcs[4] ;
} AT91S_SPIDesc, *AT91PS_SPIDesc ;

/* SPI Opening mode definition */
#define SPI_MASTER          0x1
#define SPI_NPCS0_USED      0x2
#define SPI_NPCS0_OPENDRAIN 0x4
#define SPI_NPCS1_USED      0x8
#define SPI_NPCS1_OPENDRAIN 0x10
#define SPI_NPCS2_USED      0x20
#define SPI_NPCS2_OPENDRAIN 0x40
#define SPI_NPCS3_USED      0x80
#define SPI_NPCS3_OPENDRAIN 0x100
#define SPI_MISO_OPENDRAIN  0x200
#define SPI_MOSI_OPENDRAIN  0x400
#define SPI_SPCK_OPENDRAIN  0x800

extern  void at91_spi_open (const AT91PS_APMC, const AT91PS_SPIDesc , u_int mode ) ;
extern  void at91_spi_close ( const AT91PS_APMC, const AT91PS_SPIDesc  ) ;
extern  void at91_spi_set_mode ( const AT91PS_SPIDesc , u_int mode ) ;
extern  void at91_spi_read ( const AT91PS_SPIDesc , short * ) ;
extern  void at91_spi_write ( const AT91PS_SPIDesc , short * ) ;
extern  u_int at91_spi_get_status ( const AT91PS_SPIDesc ) ;
extern  void at91_spi_trig_cmd ( const AT91PS_SPIDesc ) ;

#endif /* lib_spi_h */


⌨️ 快捷键说明

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