Пример #1
0
void Init_LEDS(void)
{
	PMC_PeriEn(19);
	
	rPIOD_PDR = 0x7000001;
	rPIOD_BSR = 0x7000001;
	
	rPWM_MR		= (0x0 << 28) + (0xA << 24) + (0x82 << 16) + (0x0 << 12) + (0x1 << 8) + (0x1 << 0);
	rPWM_ENA	= 0xF; // Enable all PWM channels
	rPWM_IDR	= 0xF; // Disable PWM as interrupt source
	
	rPWM_CMR(0)		= 0xC;
	rPWM_CDTY(0)	= 0x200;
	rPWM_CPRD(0)	= 0x400;
	rPWM_CUPD(0)	= 0x0;

	rPWM_CMR(1)		= 0xC;
	rPWM_CDTY(1)	= 0x300;
	rPWM_CPRD(1)	= 0x400;
	rPWM_CUPD(1)	= 0x0;
	
	rPWM_CMR(2)		= 0xC;
	rPWM_CDTY(2)	= 0x200;
	rPWM_CPRD(2)	= 0x400;
	rPWM_CUPD(2)	= 0x0;
	
	rPWM_CMR(3)		= 0xC;
	rPWM_CDTY(3)	= 0x300;
	rPWM_CPRD(3)	= 0x400;
	rPWM_CUPD(3)	= 0x0;	
}
Пример #2
0
void
Config_FPGA_PS_SPI(void)
{
	PMC_PeriEn(AT91C_ID_SPI1);
	rSPI_CR(1) = (1 << 7);
	rSPI_CR(1) = (1 << 7);
	rSPI_MR(1) = (0x6 << 24) + (0xF << 16) + (1 << 7) + (0 << 5) + (1 << 4) + (0 << 2) + (0 << 1) + (1 << 0);
	rSPI_IDR(1) = 0xFFFFFFFF;
	PMC_PeriDis(AT91C_ID_SPI1);
	rSPI_CSR0(1) = (0x1 << 24) + (0x1 << 16) + (0x4 << 8) + (0x0 << 4) + (0 << 3) + (1 << 1) + (0 << 0);
}
Пример #3
0
// //------------------------------------------------------------------------------
// ///
// ///
// ///
// //------------------------------------------------------------------------------
void Init_TIMER(void)
{
	volatile U32 dummy;
	PMC_PeriEn(18); // Configure the PMC to enable the Timer Counter clock for TC.
	rTC0_CCR(0) = (0x1 << 1); // (TC) Counter Clock Disable Command
	rTC0_CCR(1) = (0x1 << 1); // (TC) Counter Clock Disable Command
	rTC0_CCR(2) = (0x1 << 1); // (TC) Counter Clock Disable Command
	rTC0_IDR(0) = 0xFFFFFFFF; // Disable interrupts.
	rTC0_IDR(1) = 0xFFFFFFFF; // Disable interrupts.
	rTC0_IDR(2) = 0xFFFFFFFF; // Disable interrupts.
	dummy = rTC0_SR(0); // Clear status register.
	dummy = rTC0_SR(1); // Clear status register.
	dummy = rTC0_SR(2); // Clear status register.
}