匿名
未登录
登录
丢石头百科
搜索
查看“AVR 硬件操作库函数”的源代码
来自丢石头百科
名字空间
页面
讨论
更多
更多
页面选项
查看
查看源代码
历史
←
AVR 硬件操作库函数
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
=== ===<table border="0" cellpadding="0" cellspacing="0" style="color: rgb(72, 61, 139); font-family: Arial, 新宋体, 微软雅黑; font-size: 12px;" width="780"><tbody><tr><th class="type_483D8B" scope="col" style="line-height: 20px; font-weight: normal; border-top-style: none;" valign="top"> /********************************************************************* 微 雪 电 子 WaveShare <a class="Blue_2_12px_" href="http://www.waveshare.net/" style="color: rgb(7, 66, 184);">http://www.waveShare.net 目 的: 建立AVR的硬件提取库,增加各类补丁,方便系统程序移植 目标系统: 基于AVR单片机 应用软件: ICCAVR 版 本: Version 1.0 圆版时间: 2005-06-25 开发人员: SEE 说 明: 若用于商业用途,请保留此段文字或注明代码来源 深 圳 市 微 雪 电 子 有 限 公 司 保 留 所 有 的 版 权 *********************************************************************/ /*01010101010101010101010101010101010101010101010101010101010101010101 ---------------------------------------------------------------------- 版本更新记录: ---------------------------------------------------------------------- 入口参数说明: ---------------------------------------------------------------------- 待定参数说明: ---------------------------------------------------------------------- 对外变量说明: ---------------------------------------------------------------------- 对外程序说明: ---------------------------------------------------------------------- 10101010101010101010101010101010101010101010101010101010101010101010*/ #ifndef Hardware_H #define Hardware_H #include <math.h> #include <string.h> #include <stdio.h> #include <macros.h> #include <eeprom.h> //#include <wdt.h></wdt.h></eeprom.h></macros.h></stdio.h></string.h></math.h> /* TWI configs */ //如使用ATMEGA162(没有TWI接口)之类的MCU,在加载Hardware.H前,务必加“#define NO_INCLUDE_I2C_H 1”语句 #if NO_INCLUDE_I2C_H ; #else #include "D:\ICC_H\I2C.H" //i2c即AVR的"twi" #endif /* hard configs */ #ifndef flash #define flash const #endif #ifndef code #define code const #endif #ifndef NOP #define NOP() asm("nop") #endif /* io configs */ #define sbi(io,bit) ( io |= (1<<bit example:="" sbi="">#define cbi(io,bit) ( io &= ~(1<<bit cbi="" example:="">#define gbi(pin ,bit) ( pin & (1<<bit example:="" gbi="" p=""></bit></bit></bit> /* interrupt configs */ #define DIS_INT asm("sei") #define EN_INT asm("cli") /* wdt configs */ #define WDT() asm("wdr") /* bit operation */ //#ifndef BIT //#define BIT(x) ( 1<<(x) ) //#endif /* USART configs for 4 Mhz crystal */ //#define BAUD9600 25 //#define BAUD19000 12 //#define UART_TRAN_ON() UCR |= 0x08 //#define UART_TRAN_OFF() UCR &= ~0x08 //#define UART_RCV_ON() UCR |= 0x10 //#define UART_RCV_OFF() UCR &= ~0x10 /*-------------------------------------------------------------------- 程序全称:50us 延时程序 程序功能:就是 50us延时 注意事项:基于7.3728M晶振,稍微有点误差 提示说明:调用delay50us(20),得到1ms延时 输 入: 返 回:无 --------------------------------------------------------------------*/ void delay50us(sint16 t) { uint8 j; for(;t>0;t--) for(j=0;j<70;j++) ; } /*-------------------------------------------------------------------- 程序全称:50ms 延时程序 程序功能:就是 50ms延时 注意事项:基于7.3728M晶振,稍微有点误差 提示说明:调用delay50ms(20),得到1s延时 输 入: 返 回:无 --------------------------------------------------------------------*/ void delay50ms(sint16 t) { uint16 i; for(;t>0;t--) for(i=0;i<52642;i++) ; } #endif</th></tr></tbody></table>
返回至
AVR 硬件操作库函数
。
导航
导航
首页
最近更改
随机页面
MediaWiki帮助
首页
首页
树莓派
主机
配件包
外壳
键鼠
电源
扩展板
显示屏
墨水屏
摄像模块
通信模块
继电器
电机驱动板
游戏机
产品分类
树莓派
Arduino
micro:bit
STM32
Espressif
WiFi模块
蓝牙模块
无线模块
LoRa模块
4G模块
GSM
GPRS
以太网
导航模块
北斗卫星
GPS
LCD
墨水屏
OLED
摄像头
USB模块
串口模块
RS232
RS485
CAN
传感器
温度模块
湿度模块
气压模块
继电器
电机模块
指纹模块
电平转换
音频模块
编程器
Wiki工具
Wiki工具
特殊页面
页面工具
页面工具
用户页面工具
更多
链入页面
相关更改
页面信息
页面日志