test_pdc2.c
来自「ARM9200开发板的ROM boot程序源码1.0」· C语言 代码 · 共 59 行
C
59 行
//*----------------------------------------------------------------------------
//* 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 : test_usart2.c
//* Object : PDC Peripheral data Controller Test Library.
//*
//* 1.0 13/02/01 JPP : Creation
//*----------------------------------------------------------------------------
//* --------------------------- include file ----------------------------------
#include "periph/pdc2/lib_pdc2.h"
//*----------------------------------------------------------------------------
//* Function Name : at91_test_pdc
//* Object : Test PDC access register SSC.
//* Input Parameters : <pdc2_pt> = PDC2 Descriptor pointer
//* Output Parameters : None
//* Functions called : None
//*----------------------------------------------------------------------------
int at91_test_pdc ( StructPDC2 * pdc2_pt )
//* Begin
{
u_int read_value;
u_int write_value;
//* init PDC2
at91_pdc2_open(pdc2_pt);
//* Test access to the controller register
write_value=0;
pdc2_pt->PDC2_PTCR = write_value;
write_value= pdc2_pt->PDC2_PTCR;
//* Reset all Counter register
pdc2_pt->PDC2_RCR = 0 ;
pdc2_pt->PDC2_RNCR = 0 ;
pdc2_pt->PDC2_TCR = 0 ;
pdc2_pt->PDC2_TNCR = 0 ;
//* Reset all Pointer register
pdc2_pt->PDC2_RPR = 0 ;
pdc2_pt->PDC2_RNPR = 0 ;
pdc2_pt->PDC2_TPR = 0 ;
pdc2_pt->PDC2_TNPR = 0 ;
//* Enables the RX and TX PDC transfer requests
pdc2_pt->PDC2_PTCR = ( PDC_TXTEN | PDC_RXTEN) ;
//* End
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?