hw_gpio32 ports.S 1.55 KB
#include "os_type.h"


#if 0//def TIMER0_ENABLE

//#include "tx_port.h"
//#include "xtensa_rtos.h"
//#include "xtensa_timer.h"

//#include <xtensa/corebits.h>
//#include <xtensa/config/system.h>

#if 1

#include <xtensa/config/core.h>

#else

#ifdef __XTENSA__
#include <xtensa/hal.h>
#include <xtensa/xtensa-versions.h>
#else
#include "../hal.h"
#include "../xtensa-versions.h"
#endif

/*  CONFIGURATION SPECIFIC DEFINITIONS:  */
#ifdef __XTENSA__
#include <xtensa/config/core-isa.h>
#include <xtensa/config/core-matmap.h>
#include <xtensa/config/tie.h>
#else
#include "core-isa.h"
#include "core-matmap.h"
#include "tie.h"
#endif

#endif

//#include <cstub-Xm_Optek_HiFi3_Dev_05.h>
//#include <cstub-Xm_Optek_HiFi3_Dev_05-c.h>


#if defined (_ASMLANGUAGE) || defined (__ASSEMBLER__)
#ifdef __XTENSA__
#include <xtensa/config/tie-asm.h>
#else
#include "tie-asm.h"
#endif
#endif /*_ASMLANGUAGE or __ASSEMBLER__*/


	.text
	.align	4
/*	.literal_position*/
/*	.section  ._xtensa_timer1_init, "ax"*/
/*	.section  .internal_ram_1_text, "ax"*/

	.global	  hw_gpio32_port_init
	.type	  hw_gpio32_port_init, @function

/*	.extern _xt_tick_divisor*/

hw_gpio32_port_init:

	//ENTRY(16)
	entry sp, 16

	movi  a0,     0x50
	RUR.EXPSTATE  a0    /*Read the value of 32-bit exported state EXPSTATE into AR*/
	READ_IMPWIRE  a1    /*Read the value of 32-bit input port IMPWIRE into AR*/

	WUR.EXPSTATE  a1   /*Write the contents of 32-bit AR register to the exported state EXPSTATE*/

//	WRMASK_EXPSTATE
//	WRMASK_EXPSTATE a1, 0x01

	CLRB_EXPSTATE 0x01
	SETB_EXPSTATE 0x01


	//RET(16)
	retw

#endif //