plat_clock.h
来自「MANTIS是由科罗拉多大学开发的传感器网络嵌入式操作系统。 这是mantis」· C头文件 代码 · 共 70 行
H
70 行
// This file is part of MANTIS OS, Operating System// See http://mantis.cs.colorado.edu///// Copyright (C) 2003,2004,2005 University of Colorado, Boulder//// This program is free software; you can redistribute it and/or// modify it under the terms of the mos license (see file LICENSE)/** @file msp430/include/plat_clock.h * @brief clock speed macros, as well as precalculated data for * uart baud rate timing * @author John Ledbetter */#ifndef __PLAT_CLOCK_H__#define __PLAT_CLOCK_H__#if defined(CLOCK_SPEED_2_0)#define CLOCK_SPEED (uint32_t)2000000#define UBR0_INIT 0x22#define UBR1_INIT 0x00#define UMCTL_INIT 0xDD#elif defined(CLOCK_SPEED_3_68)#define CLOCK_SPEED (uint32_t)3686400#define UBR0_INIT 0x40#define UBR1_INIT 0x00#define UMCTL_INIT 0x00#elif defined(CLOCK_SPEED_4_0)#define CLOCK_SPEED (uint32_t)4000000#define UBR0_INIT 0x45#define UBR1_INIT 0x00#define UMCTL_INIT 0xAA#elif defined(CLOCK_SPEED_4_37)#define CLOCK_SPEED (uint32_t)4377600#define UBR0_INIT 0x4C#define UBR1_INIT 0x00#define UMCTL_INIT 0x00#else#error Clock Speed Not Defined#endif#define CLOCK_SPEED_0 CLOCK_SPEED //no prescaling#define CLOCK_SPEED_8 (CLOCK_SPEED / (uint32_t)8)#define CLOCK_SPEED_32 (CLOCK_SPEED / (uint32_t)32)#define CLOCK_SPEED_64 (CLOCK_SPEED / (uint32_t)64)#define CLOCK_SPEED_128 (CLOCK_SPEED / (uint32_t)128)#define CLOCK_SPEED_256 (CLOCK_SPEED / (uint32_t)256)#define CLOCK_SPEED_1024 (CLOCK_SPEED / (uint32_t)1024)#define EXT_CLOCK 32768#define EXT_CLOCK_0 EXT_CLOCK //no prescaling#define EXT_CLOCK_8 (EXT_CLOCK / 8)#define EXT_CLOCK_32 (EXT_CLOCK / 32)#define EXT_CLOCK_64 (EXT_CLOCK / 64)#define EXT_CLOCK_128 (EXT_CLOCK / 128)#define EXT_CLOCK_256 (EXT_CLOCK / 256)#define EXT_CLOCK_1024 (EXT_CLOCK / 1024)#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?