/************************************************
*
* $Copyright 2001 Joseph J. Lemieux ALL RIGHTS RESERVED. $
*
* $Filename: C:\OSEKBook\src\CH01\src\init.c $
*
* Description: System Initialization Module
* This module provides the interfaces
* that may be used by the system to
* initialize either 16 or 32 bit
* memory mapped registers, and to
* initialize the system based upon the
* type of change.
*
************************************************/
#ifndef INITC
#define INITC
/************************************************
*
* Include files
*
************************************************/
#include "typedefs.h"
#include "init.h"
/************************************************
*
* Local macros
*
************************************************/
/************************************************
*
* Local Function Prototypes
*
************************************************/
/************************************************
*
* Local Variables
*
************************************************/
/************************************************
*
* Local Constants
*
************************************************/
/************************************************
*
* Functions
*
************************************************/
/************************************************
*
* Function: InitReg16
*
* Inputs: list - pointer to the null terminated list of
* register:value pairs.
*
* Outputs: All registers in list are set to value.
*
* Returns: None.
*
* Description: This routine navigates a list of 16 bit
* registers and set them to a default value.
* Terminates when it hits a NULL pointer.
*
************************************************/
void InitReg16(InitReg16ListType const *list)
{
while(list->reg != NULL)
{
*list->reg = list->value;
list++;
}
}
/************************************************
*
* Function: InitReg32
*
* Inputs: list - pointer to the null terminated list of
* register:value pairs.
*
* Outputs: All registers in list are set to value.
*
* Returns: None.
*
* Description: This routine navigates a list of 32 bit
* registers and set them to a default value.
* Terminates when it hits a NULL pointer.
*
************************************************/
void InitReg32(InitReg32ListType const *list)
{
while(list->reg != NULL)
{
*list->reg = list->value;
list++;
}
}
/************************************************
*
* Function: InitSystem
*
* Inputs: type - type of initialization occurring.
*
* Outputs: none
*
* Returns: none
*
* Description: Calls all functions in the list to initialize
* the application. Terminates when it hits a NULL
* pointer.
*
************************************************/
void InitSystem(InitType type)
{
/*****
*
* List to be navigated is always InitFunctionList, which
* is defined in init.cfg.
*
*****/
InitFunctionListType const *list = InitFunctionList;
while(list->initfunction != NULL)
{
list->initfunction(type);
list++;
}
}
#endif /*INITC */
OSEK/VDK汽车电子嵌入式软件编程技术部分源码
需积分: 10 64 浏览量
2018-11-28
15:58:04
上传
评论 2
收藏 19KB RAR 举报
木燚垚
- 粉丝: 2
- 资源: 3
最新资源
- yolov5,SSD 可能使用到的一些代码
- 介绍离散性制造行业的MES系统流程
- 基于IDEA-CCNL/Randeng-Pegasus-238M-Summary-Chines微调的中文文本摘要任务源码+数据集
- 微信小程序源码 车源宝 二手车交易平台 源码下载
- 微信小程序源码 实现 城市切换 demo 根据城市首字母排序城市 选择城市 源码下载
- 2024新版计算机编译原理期末速成全套视频教程(视频+配套资料)
- VMware7.0虚拟机硬盘无法编辑,无法连接到Profile-Driven Storage Service
- arm64内核的mongo镜像
- 基于stm32f103c单片机+MPU6050+0.96英寸OLED显示屏双柄遥控器硬件(原理图+PCB)工程文件.zip
- 整理的关于少儿编程的学习路径,以及如何在小升初,初升高和大学充分的利用起来编程经验的优势
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈