//*****************************************************************************
//
// sysctl.c - Driver for the system controller.
//
// Copyright (c) 2005-2007 Luminary Micro, Inc. All rights reserved.
//
// Software License Agreement
//
// Luminary Micro, Inc. (LMI) is supplying this software for use solely and
// exclusively on LMI's microcontroller products.
//
// The software is owned by LMI and/or its suppliers, and is protected under
// applicable copyright laws. All rights are reserved. You may not combine
// this software with "viral" open-source software in order to form a larger
// program. Any use in violation of the foregoing restrictions may subject
// the user to criminal sanctions under applicable laws, as well as to civil
// liability for the breach of the terms and conditions of this license.
//
// THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
// OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
// LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
// CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
//
// This is part of revision 1928 of the Stellaris Peripheral Driver Library.
//
//*****************************************************************************
//*****************************************************************************
//
//! \addtogroup sysctl_api
//! @{
//
//*****************************************************************************
#include "../hw_ints.h"
#include "../hw_memmap.h"
#include "../hw_nvic.h"
#include "../hw_sysctl.h"
#include "../hw_types.h"
#include "cpu.h"
#include "debug.h"
#include "interrupt.h"
#include "sysctl.h"
//*****************************************************************************
//
// This macro extracts the array index out of the peripheral number.
//
//*****************************************************************************
#define SYSCTL_PERIPH_INDEX(a) (((a) >> 28) & 0xf)
//*****************************************************************************
//
// This macro constructs the peripheral bit mask from the peripheral number.
//
//*****************************************************************************
#define SYSCTL_PERIPH_MASK(a) (((a) & 0xffff) << (((a) & 0x001f0000) >> 16))
//*****************************************************************************
//
// An array that maps the "peripheral set" number (which is stored in the upper
// nibble of the SYSCTL_PERIPH_* defines) to the SYSCTL DC? register that
// contains the peripheral present bit for that peripheral.
//
//*****************************************************************************
static const unsigned long g_pulDCRegs[] =
{
SYSCTL_DC1,
SYSCTL_DC2,
SYSCTL_DC4,
SYSCTL_DC1
};
//*****************************************************************************
//
// An array that maps the "peripheral set" number (which is stored in the upper
// nibble of the SYSCTL_PERIPH_* defines) to the SYSCTL_SRCR? register that
// controls the software reset for that peripheral.
//
//*****************************************************************************
static const unsigned long g_pulSRCRRegs[] =
{
SYSCTL_SRCR0,
SYSCTL_SRCR1,
SYSCTL_SRCR2
};
//*****************************************************************************
//
// An array that maps the "peripheral set" number (which is stored in the upper
// nibble of the SYSCTL_PERIPH_* defines) to the SYSCTL_RCGC? register that
// controls the run-mode enable for that peripheral.
//
//*****************************************************************************
static const unsigned long g_pulRCGCRegs[] =
{
SYSCTL_RCGC0,
SYSCTL_RCGC1,
SYSCTL_RCGC2
};
//*****************************************************************************
//
// An array that maps the "peripheral set" number (which is stored in the upper
// nibble of the SYSCTL_PERIPH_* defines) to the SYSCTL_SCGC? register that
// controls the sleep-mode enable for that peripheral.
//
//*****************************************************************************
static const unsigned long g_pulSCGCRegs[] =
{
SYSCTL_SCGC0,
SYSCTL_SCGC1,
SYSCTL_SCGC2
};
//*****************************************************************************
//
// An array that maps the "peripheral set" number (which is stored in the upper
// nibble of the SYSCTL_PERIPH_* defines) to the SYSCTL_DCGC? register that
// controls the deep-sleep-mode enable for that peripheral.
//
//*****************************************************************************
static const unsigned long g_pulDCGCRegs[] =
{
SYSCTL_DCGC0,
SYSCTL_DCGC1,
SYSCTL_DCGC2
};
//*****************************************************************************
//
// An array that maps the crystal number in RCC to a frequency.
//
//*****************************************************************************
static const unsigned long g_pulXtals[] =
{
1000000,
1843200,
2000000,
2457600,
3579545,
3686400,
4000000,
4096000,
4915200,
5000000,
5120000,
6000000,
6144000,
7372800,
8000000,
8192000
};
//*****************************************************************************
//
//! Gets the size of the SRAM.
//!
//! This function determines the size of the SRAM on the Stellaris device.
//!
//! \return The total number of bytes of SRAM.
//
//*****************************************************************************
unsigned long
SysCtlSRAMSizeGet(void)
{
//
// Compute the size of the SRAM.
//
return(((HWREG(SYSCTL_DC0) & SYSCTL_DC0_SRAMSZ_M) >> 8) + 0x100);
}
//*****************************************************************************
//
//! Gets the size of the flash.
//!
//! This function determines the size of the flash on the Stellaris device.
//!
//! \return The total number of bytes of flash.
//
//*****************************************************************************
unsigned long
SysCtlFlashSizeGet(void)
{
//
// Compute the size of the flash.
//
return(((HWREG(SYSCTL_DC0) & SYSCTL_DC0_FLASHSZ_M) << 11) + 0x800);
}
//*****************************************************************************
//
//! Determines if a pin is present.
//!
//! \param ulPin is the pin in question.
//!
//! Determines if a particular pin is present in the device. The PWM, analog
//! comparators, ADC, and timers have a varying number of pins across members
//! of the Stellaris family; this will determine which are present on this
//! device.
//!
//! The \e ulPin argument must be only one of the following values:
//! \b SYSCTL_PIN_PWM0, \b SYSCTL_PIN_PWM1, \b SYSCTL_PIN_PWM2,
//! \b SYSCTL_PIN_PWM3, \b SYSCTL_PIN_PWM4, \b SYSCTL_PIN_PWM5,
//! \b SYSCTL_PIN_C0MINUS, \b SYSCTL_PIN_C0PLUS, \b SYSCTL_PIN_C0O,
//! \b SYSCTL_PIN_C1MINUS, \b SYSCTL_PIN_C1PLUS, \b SYSCTL_PIN_C1O,
//! \b SYSCTL_PIN_C2MINUS, \b SYSCTL_PIN_C2PLUS, \b SYSCTL_PIN_C2O,
//! \b SYSCTL_PIN_ADC0, \b SYSCTL_PIN_ADC1, \b SYSCTL_PIN_ADC2,
//! \b SYSCTL_PIN_ADC3, \b SYSCTL_PIN_ADC4, \b SYSCTL_PIN_ADC5,
//! \b SYSCTL_PIN_ADC6, \b SYSCTL_PIN_ADC7, \b SYSCTL_PIN_CCP0,
//! \b SYSCTL_PIN_CCP1, \b SYSCTL_PIN_CCP2, \b SYSCTL_PIN_CCP3,
//! \b SYSCTL_PIN_CCP4, \b SYSCTL_PIN_CCP5, \b SYSCTL_PIN_CCP6,
//! \b SYSCTL_PIN_CCP7, \b SYSCTL_PIN_32KHZ, or \b SYSCTL_PIN_MC_FAULT0.
//!
//! \return Returns \b true if the specified pin is present and \b false if it
//! is not.
//
//*****************************************************************************
tBoolean
SysCtlPinPresent(unsigned long ulPin)
{
//
// Check the arguments.
//
ASSERT((ulPin == SYSCTL_PIN_PW
没有合适的资源?快使用搜索试试~ 我知道了~
IR.rar_LM3S1635_Luminary
共177个文件
h:145个
c:19个
s:2个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 66 浏览量
2022-09-24
00:00:32
上传
评论
收藏 3.9MB RAR 举报
温馨提示
Luminary coxter_M3 内核的遥控源代码
资源推荐
资源详情
资源评论
收起资源包目录
IR.rar_LM3S1635_Luminary (177个子文件)
sysctl.c 79KB
can.c 64KB
gpio.c 47KB
ethernet.c 44KB
pwm.c 41KB
timer.c 36KB
adc.c 34KB
uart.c 31KB
hibernate.c 30KB
i2c.c 27KB
flash.c 26KB
ssi.c 20KB
qei.c 20KB
interrupt.c 18KB
watchdog.c 16KB
mpu.c 15KB
comp.c 15KB
IR.C 10KB
systick.c 8KB
pin_map.h 385KB
lm3s8962.h 266KB
lm3s2965.h 262KB
lm3s8971.h 256KB
lm3s6965.h 252KB
lm3s2939.h 249KB
lm3s8938.h 247KB
lm3s6952.h 246KB
lm3s6753.h 246KB
lm3s2533.h 244KB
lm3s2739.h 243KB
lm3s8933.h 242KB
lm3s8733.h 241KB
lm3s6537.h 239KB
lm3s2651.h 239KB
lm3s8738.h 238KB
lm3s1968.h 237KB
lm3s8538.h 235KB
lm3s2950.h 230KB
lm3s2948.h 229KB
lm3s2432.h 228KB
lm3s2412.h 228KB
lm3s1635.h 225KB
lm3s6432.h 225KB
lm3s1637.h 225KB
lm3s1162.h 224KB
lm3s6950.h 224KB
lm3s2918.h 224KB
lm3s2608.h 224KB
lm3s2620.h 223KB
lm3s6918.h 223KB
lm3s6618.h 223KB
lm3s1439.h 222KB
lm3s2637.h 222KB
lm3s6938.h 222KB
lm3s6610.h 220KB
lm3s6637.h 220KB
lm3s1165.h 219KB
lm3s1751.h 215KB
lm3s1937.h 214KB
lm3s8970.h 214KB
lm3s1133.h 214KB
lm3s2139.h 213KB
lm3s1512.h 212KB
lm3s6633.h 211KB
lm3s1435.h 209KB
lm3s1960.h 209KB
lm3s8930.h 207KB
lm3s1138.h 206KB
lm3s8730.h 206KB
lm3s8630.h 206KB
lm3s8530.h 205KB
lm3s1150.h 204KB
lm3s1538.h 202KB
lm3s1608.h 202KB
lm3s1918.h 202KB
lm3s2110.h 201KB
lm3s1620.h 200KB
lm3s1850.h 199KB
lm3s2911.h 199KB
lm3s2601.h 199KB
lm3s6611.h 198KB
lm3s6911.h 198KB
lm3s6422.h 196KB
lm3s1958.h 195KB
lm3s1332.h 191KB
lm3s6110.h 190KB
lm3s615.h 187KB
lm3s815.h 187KB
lm3s811.h 181KB
lm3s613.h 179KB
lm3s818.h 179KB
lm3s316.h 179KB
lm3s618.h 179KB
lm3s1601.h 177KB
lm3s1911.h 177KB
lm3s611.h 176KB
lm3s612.h 176KB
lm3s812.h 176KB
lm3s610.h 175KB
lm3s2730.h 173KB
共 177 条
- 1
- 2
资源评论
JonSco
- 粉丝: 77
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功