hardware.c

来自「给出了一个ucos_ii在mc9s12dg128b上的移植事例」· C语言 代码 · 共 45 行

C
45
字号
/********************************************************************
                               //
//     Author: CaiXinBo      \\\\\\\                            //
//                          ( o   o )                           //
//----------------------oOO----(_)----OOo-----------------------//
                                                              
    FileName:       Hardware.c	
    Created Date:   23/5/2006   9:43
    Modify Date:    
    Purpose:	
*********************************************************************/
#include "includes.h"
#include "main.h"
#include "mc9s12dg128.h" 

/******************uart_init()****************/
void uart_init(void) {
SCI1CR2=0x0c;
SCI1BDH=0x00;
SCI1BDL=0x9C;
}

/**********uart_putchar()****************/
void uart_putchar(unsigned char ch)
{
while(!(SCI1SR1&0x80))
{}         
SCI1DRL=ch;
}

/*HardwareInit(void)*/
void HardwareInit(void)
{
	uart_init();
	  CLKSEL=0x00;            
  PLLCTL=0xe1;           
  SYNR=2;REFDV=1;         
  PLLCTL=0x60; 
 asm NOP;asm NOP;asm NOP;
 
 while(0==(CRGFLG&0x08));
 CLKSEL=0x80;             //pll start

}

⌨️ 快捷键说明

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