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

📄 spi1.h

📁 at91rm9200 的rom程序
💻 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           : serial_periph_1.h
//* Object              : Serial Peripheral Driver Library Header.
//*
//* 1.0 04/01/00 JCZ    : Creation
//*---------------------------------------------------------------------------

#ifndef serial_periph_1_h
#define serial_periph_1_h

#include    "periph/stdc/std_c.h"
#include    "periph/spi/lib_spi.h"

/* Driver State */
#define     SERIAL_PERIPH_1_IDLE            0x0
#define     SERIAL_PERIPH_1_TX_CMD_ONLY     0x1
#define     SERIAL_PERIPH_1_RX_CMD_ONLY     0x2
#define     SERIAL_PERIPH_1_TX_CMD          0x3
#define     SERIAL_PERIPH_1_RX_CMD          0x4
#define     SERIAL_PERIPH_1_TX_DATA         0x5
#define     SERIAL_PERIPH_1_RX_DATA         0x6


/* Serial Peripheral Driver Data Descriptor */
typedef struct _AT91S_SpiDataDesc
{
    u_char      *tx_cmd_pt ;
    u_int       tx_cmd_size ;
    u_char      *rx_cmd_pt ;
    u_int       rx_cmd_size ;
    u_char      *tx_data_pt ;
    u_int       tx_data_size ;
    u_char      *rx_data_pt ;
    u_int       rx_data_size ;
    volatile u_char      state ;
    u_int       mode ;

} AT91S_SpiDataDesc, *AT91PS_SpiDataDesc;


/* Serial Peripheral Driver Descriptor */
typedef struct _AT91S_DataflashDesc
{
    AT91PS_SPIDesc          spi_desc ;
    AT91PS_SpiDataDesc   	SpiData ;
    u_int                   mode_spi ;
    u_int                   mode_spi_periph ;
    u_int                   mode_pin_spi ;
    TypeAICHandler          *asm_handler ;
    u_char                  spi_periph_id ;
} AT91S_DataflashDesc, *AT91PS_DataflashDesc;


/* Fixed Peripheral SPI Driver function prototypes */
extern  void spi1_open       ( AT91PS_DataflashDesc ) ;
extern  void spi1_close      ( AT91PS_DataflashDesc ) ;
extern  void spi1_setMode    ( AT91PS_DataflashDesc ) ;
extern  void spi1_read       ( AT91PS_DataflashDesc ) ;
extern  void spi1_write      ( AT91PS_DataflashDesc ) ;
extern  u_int spi1_getStatus ( AT91PS_DataflashDesc ) ;
extern  void spi1_trigCmd    ( AT91PS_DataflashDesc ) ;

#endif /* serial_periph_1_h */

⌨️ 快捷键说明

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