📄 main.c
字号:
//*----------------------------------------------------------------------------
//* 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 : main.c
//* Object : Main sodtware to switch between all clock sources
//* : in AT91M55800A Microcontroller
//*
//* 1.0 08/01/01 S.C : Creation
//*----------------------------------------------------------------------------
#include "parts/m55800/lib_m55800.h"
#include "clock_switching_driver.h"
#include "targets/eb55/eb55.h"
//*----------------------------------------------------------------------------
//* Function Name : main
//* Object : Example to use the Switching Clock Driver for the
//* : AT91M55800A Microcontroller
//* Input Parameters : The Targeted clock and for the PLL the multiplier ratio
//* Output Parameters :
//*----------------------------------------------------------------------------
void main (void)
{
//* -- Set up PIO
at91_pio_write (&PIOB_DESC, LED_MASK, LED_OFF ) ;
at91_pio_open ( &PIOB_DESC, LED_MASK, PIO_OUTPUT ) ;
while (1)
{
/* To start with a initial config */
mck_clock_speed (2,2) ;
//* First Switching
/* Start Event */
at91_pio_write (&PIOB_DESC, LED1, LED_ON ) ;
at91_pio_write (&PIOB_DESC, LED1, LED_OFF ) ;
mck_clock_speed (1,0) ;
at91_pio_write (&PIOB_DESC, LED1, LED_ON ) ;
at91_pio_write (&PIOB_DESC, LED1, LED_OFF ) ;
/* Stop Event */
//* Second Switching
mck_clock_speed (2,2) ;
at91_pio_write (&PIOB_DESC, LED1, LED_ON ) ;
at91_pio_write (&PIOB_DESC, LED1, LED_OFF ) ;
//* Third Switching
mck_clock_speed (0,0) ;
at91_pio_write (&PIOB_DESC, LED1, LED_ON ) ;
at91_pio_write (&PIOB_DESC, LED1, LED_OFF ) ;
//* Fourth Switching
mck_clock_speed (1,0) ;
at91_pio_write (&PIOB_DESC, LED1, LED_ON ) ;
at91_pio_write (&PIOB_DESC, LED1, LED_OFF ) ;
//* Fifth Switching
mck_clock_speed (0,0) ;
at91_pio_write (&PIOB_DESC, LED1, LED_ON ) ;
at91_pio_write (&PIOB_DESC, LED1, LED_OFF ) ;
//* Sixth Switching
mck_clock_speed (2,2) ;
at91_pio_write (&PIOB_DESC, LED1, LED_ON ) ;
at91_pio_write (&PIOB_DESC, LED1, LED_OFF ) ;
//* Eighth Switching
mck_clock_speed (0,0) ;
at91_pio_write (&PIOB_DESC, LED1, LED_ON ) ;
at91_pio_write (&PIOB_DESC, LED1, LED_OFF ) ;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -