1-Wire的使用

代码:

ds18b20.c

/*《AVR专题精选》随书例程3.通信接口使用技巧项目:1-Wire 单总线的使用文件:ds1820.c说明:DS18B20驱动文件。为了简单,没有读取芯片地址,也没有计算校验作者:邵子扬时间:2012年12月13日*/
#include "owi.h"
#include "DS1820.h"/*! \brief  Read the temperature from a DS1820 temperature sensor.**  This function will start a conversion and read back the temperature*  from a DS1820 temperature sensor.**  \param  bus A bitmask of the bus where the DS1820 is located.*  *  \param  id  The 64 bit identifier of the DS1820.**  \return The 16 bit signed temperature read from the DS1820.*//*
signed int DS1820_ReadTemperature(unsigned char bus, unsigned char * id)
{signed int temperature;// Reset, presence.if (!OWI_DetectPresence(bus)){return DS1820_ERROR; // Error}// Match the id found earlier.OWI_MatchRom(id, bus);// Send start conversion command.OWI_SendByte(DS1820_START_CONVERSION, bus);// Wait until conversion is finished.// Bus line is held low until conversion is finished.while (!OWI_ReadBit(bus)){}// Reset, presence.if(!OWI_DetectPresence(bus)){return DS1820_ERROR; // Error}// Match id again.OWI_MatchRom(id, bus);// Send READ SCRATCHPAD command.OWI_SendByte(DS1820_READ_SCRATCHPAD, bus);// Read only two first bytes (temperature low, temperature high)// and place them in the 16 bit temperature variable.temperature = OWI_ReceiveByte(bus);temperature |= (OWI_ReceiveByte(bus) << 8);return temperature;
}
*/// 读取温度的简单函数,忽略了ROM识别,适合总线上只有1个 DS1820
// 的应用情况。
signed int DS1820_SimpleReadTemperature(unsigned char pin)
{signed int temperature;OWI_DetectPresence(pin);OWI_SkipRom(pin);OWI_SendByte(DS1820_START_CONVERSION, pin);OWI_DetectPresence(pin);OWI_SkipRom(pin);OWI_SendByte(DS1820_READ_SCRATCHPAD, pin);temperature = OWI_ReceiveByte(pin);temperature |= (OWI_ReceiveByte(pin) << 8);return temperature/16;
}

ds2413.c

/*《AVR专题精选》随书例程3.通信接口使用技巧项目:1-Wire 单总线的使用文件:ds2413.c说明:DS2413驱动文件。为了简单,没有读取芯片地址,也没有计算校验作者:邵子扬时间:2012年12月13日*/
#include "owi.h"
#include "DS2413.h"// 读取DS2413状态
// pin: IO引脚序号
//      端口需要在cfg.h中预先指定
unsigned char DS2413_SimpleRead(unsigned char pin)
{unsigned char PIO;// 检测设备OWI_DetectPresence(pin);// 忽略ROM地址OWI_SkipRom(pin);// 发送读取命令OWI_SendByte(DS2413_PIO_Access_Read, pin);OWI_ReceiveByte(pin);OWI_ReceiveByte(pin);// 读取数据PIO = OWI_ReceiveByte(pin);OWI_DetectPresence(pin);return PIO;
}// 写入数据到 DS2413
// dat: 需要些入的数据
// pin: IO端口序号
unsigned char DS2413_SimpleWrite(unsigned char dat, unsigned char pin)
{unsigned char PIO;// 检测芯片if(!OWI_DetectPresence(pin))return DS2413_ERROR;// 忽略地址OWI_SkipRom(pin);// 发送写入命令OWI_SendByte(DS2413_PIO_Access_Write, pin);// 发送数据OWI_SendByte(dat, pin);// 发送数据补码OWI_SendByte(~dat, pin);OWI_ReceiveByte(pin);// 读取数据PIO = OWI_ReceiveByte(pin);if(!OWI_DetectPresence(pin))return DS2413_ERROR;return PIO;
}

lcd.c

/*《AVR专题精选》随书例程3.通信接口使用技巧项目:1-Wire 单总线的使用文件:lcd.c说明:16x1字符型液晶驱动文件作者:邵子扬时间:2012年12月13日*/
#include <avr/io.h>
#include "macromcu.h"#include "cfg.h"#include <util/delay.h>#define LCDDDR        MACRO_CONCAT2(DDR, LCD_PORT)
#define LCDDATA_IN    MACRO_CONCAT2(PIN, LCD_PORT)
#define LCDDATA_OUT   MACRO_CONCAT2(PORT,LCD_PORT)// 向液晶控制器发送命令
void lcd_write(unsigned char RS, unsigned char dat)
{// 等待液晶内部操作完成// 使用延时法,没有读取标志位_delay_us(50);PINOUT(LCD_RS, RS);LCDDATA_OUT = dat;PINSET(LCD_E);PINCLR(LCD_E);
}// 液晶初始化
void lcd_init()
{LCDDDR = 0xFF;PINDIR(LCD_E,  PIN_OUTPUT);PINDIR(LCD_RW, PIN_OUTPUT);PINDIR(LCD_RS, PIN_OUTPUT);PINCLR(LCD_E);PINCLR(LCD_RW);_delay_ms(5);lcd_write(0, 0x30);lcd_write(0, 0x01);_delay_ms(2);lcd_write(0, 0x06);lcd_write(0, 0x0C);
}// 在指定位置显示字符
void lcd_chr(unsigned char x, unsigned char dat)
{lcd_write(0, 0x80 + x); // 设置地址lcd_write(1, dat);      // 写入字符数据
}// HEX数据转换为字符
unsigned char HexToChr(unsigned char dat)
{if(dat > 15)return '0';if(dat >9)return dat - 10 + 'A';return dat + '0'; 
}// 显示HEX数据
void lcd_hex(unsigned char x, unsigned char dat)
{lcd_chr(x, HexToChr(dat/16));lcd_chr(x+1, HexToChr(dat%16));
}// 显示字符串
void lcd_str(unsigned char x, char *s)
{while(*s){lcd_chr(x, *s);x++;s++;}
}

main.c

/*《AVR专题精选》随书例程3.通信接口使用技巧项目:1-Wire 单总线的使用文件:main.c说明:主程序文件。演示了温度传感器DS18B20和双通道开关DS2413的基本用法作者:邵子扬时间:2012年12月13日*/
#include <avr/io.h>#include "cfg.h"
#include "macromcu.h"
#include "lcd.h"#include "owi.h"
#include "ds1820.h"
#include "ds2413.h"#include <util/delay.h>unsigned char cnt=0;
volatile unsigned char stat;
volatile signed int temperature;
char s[10];// 初始化
void init()
{lcd_init();   // 液晶显示器初始化
}int main()
{init();// 向DS2413写入数据0xFFDS2413_SimpleWrite(0xFF, OWI_PIN1);while(1){_delay_ms(1000);  // 延时1秒cnt++;            // 计数器累加lcd_hex(0, cnt);  // 显示// 通过DS18B20读取温度temperature = DS1820_SimpleReadTemperature(OWI_PIN2);// 将结果转换为字符串// 判断符号位if(temperature < 0){s[0] = '-';temperature = -temperature;}elses[0] = '+';s[1] = temperature/100 + '0';temperature = temperature % 100;s[2] = temperature/10 + '0';s[3] = temperature%10 + '0';s[4] = 0;// 显示温度lcd_str(5, s);// 读取DS2413状态stat = DS2413_SimpleRead(OWI_PIN1);if(stat & 0x04)stat = 0xFF;elsestat = 0xFE;// 根据按键状态更新LEDstat = DS213_SimpleWrite(stat, OWI_PIN1);    // 更新显示lcd_hex(14, stat);}return 0;
}

owi.c

/*《AVR专题精选》随书例程3.通信接口使用技巧项目:1-Wire 单总线的使用文件:owi.c说明:1-Wire驱动文件。从AVR318例程移植而来,并做了一定优化作者:邵子扬时间:2012年12月13日*/
#include "owi.h"// Port configuration registers for 1-Wire buses.//!< 1-Wire PORT Data register.
#define OWIPORT     MACRO_CONCAT2(PORT, OWI_PORT)
//!< 1-Wire Input pin register.
#define OWIPIN      MACRO_CONCAT2(PIN,  OWI_PORT)
//!< 1-Wire Data direction register.
#define OWIDDR      MACRO_CONCAT2(DDR,  OWI_PORT)/*! \brief  Compute the CRC8 value of a data set.**  This function will compute the CRC8 or DOW-CRC of inData using seed*  as inital value for the CRC.**  \param  inData  One byte of data to compute CRC from.**  \param  seed    The starting value of the CRC.**  \return The CRC8 of inData with seed as initial value.**  \note   Setting seed to 0 computes the crc8 of the inData.**  \note   Constantly passing the return value of this function *          As the seed argument computes the CRC8 value of a*          longer string of data.*/
unsigned char OWI_CRC8(unsigned char inData, unsigned char seed)
{unsigned char bitsLeft;unsigned char temp;for (bitsLeft = 8; bitsLeft > 0; bitsLeft--){temp = ((seed ^ inData) & 0x01);if (temp == 0){seed >>= 1;}else{seed ^= 0x18;seed >>= 1;seed |= 0x80;}inData >>= 1;}return seed;    
}/*! \brief  Calculate and check the CRC of a 64 bit ROM identifier.*  *  This function computes the CRC8 value of the first 56 bits of a*  64 bit identifier. It then checks the calculated value against the*  CRC value stored in ROM.**  \param  romvalue    A pointer to an array holding a 64 bit identifier.**  \retval OWI_CRC_OK      The CRC's matched.*  \retval OWI_CRC_ERROR   There was a discrepancy between the calculated and the stored CRC.*/
unsigned char OWI_CheckRomCRC(unsigned char * romValue)
{unsigned char i;unsigned char crc8 = 0;for (i = 0; i < 7; i++){crc8 = OWI_CRC8(*romValue, crc8);romValue++;}if (crc8 == (*romValue)){return OWI_CRC_OK;}return OWI_CRC_ERROR;
}/*! \brief Initialization of the one wire bus(es). (Software only driver)*  *  This function initializes the 1-Wire bus(es) by releasing it and*  waiting until any presence sinals are finished.**  \param  pins    A bitmask of the buses to initialize.*/
void OWI_Init(unsigned char pins)
{OWI_RELEASE_BUS(pins);// The first rising edge can be interpreted by a slave as the end of a// Reset pulse. Delay for the required reset recovery time (H) to be // sure that the real reset is interpreted correctly._delay_us(OWI_DELAY_H_STD_MODE);
}/*! \brief  Write a '1' bit to the bus(es). (Software only driver)**  Generates the waveform for transmission of a '1' bit on the 1-Wire*  bus.**  \param  pins    A bitmask of the buses to write to.*/
void OWI_WriteBit1(unsigned char pins)
{unsigned char intState;// Disable interrupts.intState = __save_interrupt();cli();// Drive bus low and delay.OWI_PULL_BUS_LOW(pins);_delay_us(OWI_DELAY_A_STD_MODE);// Release bus and delay.OWI_RELEASE_BUS(pins);_delay_us(OWI_DELAY_B_STD_MODE);// Restore interrupts.__restore_interrupt(intState);
}/*! \brief  Write a '0' to the bus(es). (Software only driver)**  Generates the waveform for transmission of a '0' bit on the 1-Wire(R)*  bus.**  \param  pins    A bitmask of the buses to write to.*/
void OWI_WriteBit0(unsigned char pins)
{unsigned char intState;// Disable interrupts.intState = __save_interrupt();cli();// Drive bus low and delay.OWI_PULL_BUS_LOW(pins);_delay_us(OWI_DELAY_C_STD_MODE);// Release bus and delay.OWI_RELEASE_BUS(pins);_delay_us(OWI_DELAY_D_STD_MODE);// Restore interrupts.__restore_interrupt(intState);
}/*! \brief  Read a bit from the bus(es). (Software only driver)**  Generates the waveform for reception of a bit on the 1-Wire(R) bus(es).**  \param  pins    A bitmask of the bus(es) to read from.**  \return A bitmask of the buses where a '1' was read.*/
unsigned char OWI_ReadBit(unsigned char pins)
{unsigned char intState;unsigned char bitsRead;// Disable interrupts.intState = __save_interrupt();cli();// Drive bus low and delay.OWI_PULL_BUS_LOW(pins);_delay_us(OWI_DELAY_A_STD_MODE);// Release bus and delay.OWI_RELEASE_BUS(pins);_delay_us(OWI_DELAY_E_STD_MODE);// Sample bus and delay.bitsRead = OWIPIN & (1 << pins);_delay_us(OWI_DELAY_F_STD_MODE);// Restore interrupts.__restore_interrupt(intState);return bitsRead;
}/*! \brief  Send a Reset signal and listen for Presence signal. (software*  only driver)**  Generates the waveform for transmission of a Reset pulse on the *  1-Wire(R) bus and listens for presence signals.**  \param  pins    A bitmask of the buses to send the Reset signal on.**  \return A bitmask of the buses where a presence signal was detected.*/
unsigned char OWI_DetectPresence(unsigned char pins)
{unsigned char intState;unsigned char presenceDetected;// Disable interrupts.intState = __save_interrupt();cli();// Drive bus low and delay.OWI_PULL_BUS_LOW(pins);_delay_us(OWI_DELAY_H_STD_MODE);// Release bus and delay.OWI_RELEASE_BUS(pins);_delay_us(OWI_DELAY_I_STD_MODE);// Sample bus to detect presence signal and delay.presenceDetected = ((~OWIPIN) & (1 << pins));_delay_us(OWI_DELAY_J_STD_MODE);// Restore interrupts.__restore_interrupt(intState);return presenceDetected;
}/*! \brief  Sends one byte of data on the 1-Wire(R) bus(es).*  *  This function automates the task of sending a complete byte*  of data on the 1-Wire bus(es).**  \param  data    The data to send on the bus(es).*  *  \param  pins    A bitmask of the buses to send the data to.*/
void OWI_SendByte(unsigned char data, unsigned char pins)
{unsigned char temp;unsigned char i;// Do once for each bitfor (i = 0; i < 8; i++){// Determine if lsb is '0' or '1' and transmit corresponding// waveform on the bus.temp = data & 0x01;if (temp){OWI_WriteBit1(pins);}else{OWI_WriteBit0(pins);}// Right shift the data to get next bit.data >>= 1;}
}/*! \brief  Receives one byte of data from the 1-Wire(R) bus.**  This function automates the task of receiving a complete byte *  of data from the 1-Wire bus.**  \param  pin     A bitmask of the bus to read from.*  *  \return     The byte read from the bus.*/
unsigned char OWI_ReceiveByte(unsigned char pin)
{unsigned char data;unsigned char i;// Clear the temporary input variable.data = 0x00;// Do once for each bitfor (i = 0; i < 8; i++){// Shift temporary input variable right.data >>= 1;// Set the msb if a '1' value is read from the bus.// Leave as it is ('0') else.if (OWI_ReadBit(pin)){// Set msbdata |= 0x80;}}return data;
}/*! \brief  Sends the SKIP ROM command to the 1-Wire bus(es).**  \param  pins    A bitmask of the buses to send the SKIP ROM command to.*/
void OWI_SkipRom(unsigned char pins)
{// Send the SKIP ROM command on the bus.OWI_SendByte(OWI_ROM_SKIP, pins);
}/*! \brief  Sends the READ ROM command and reads back the ROM id.**  \param  romValue    A pointer where the id will be placed.**  \param  pin     A bitmask of the bus to read from.*/
void OWI_ReadRom(unsigned char * romValue, unsigned char pin)
{unsigned char bytesLeft = 8;// Send the READ ROM command on the bus.OWI_SendByte(OWI_ROM_READ, pin);// Do 8 times.while (bytesLeft > 0){// Place the received data in memory.*romValue++ = OWI_ReceiveByte(pin);bytesLeft--;}
}/*! \brief  Sends the MATCH ROM command and the ROM id to match against.**  \param  romValue    A pointer to the ID to match against.**  \param  pins    A bitmask of the buses to perform the MATCH ROM command on.*/
void OWI_MatchRom(unsigned char * romValue, unsigned char pins)
{unsigned char bytesLeft = 8;   // Send the MATCH ROM command.OWI_SendByte(OWI_ROM_MATCH, pins);// Do once for each byte.while (bytesLeft > 0){// Transmit 1 byte of the ID to match.OWI_SendByte(*romValue++, pins);bytesLeft--;}
}/*! \brief  Sends the SEARCH ROM command and returns 1 id found on the *          1-Wire(R) bus.**  \param  bitPattern      A pointer to an 8 byte char array where the *                          discovered identifier will be placed. When *                          searching for several slaves, a copy of the *                          last found identifier should be supplied in *                          the array, or the search will fail.**  \param  lastDeviation   The bit position where the algorithm made a *                          choice the last time it was run. This argument *                          should be 0 when a search is initiated. Supplying *                          the return argument of this function when calling *                          repeatedly will go through the complete slave *                          search.**  \param  pin             A bit-mask of the bus to perform a ROM search on.**  \return The last bit position where there was a discrepancy between slave addresses the last time this function was run. Returns OWI_ROM_SEARCH_FAILED if an error was detected (e.g. a device was connected to the bus during the search), or OWI_ROM_SEARCH_FINISHED when there are no more devices to be discovered.**  \note   See main.c for an example of how to utilize this function.*/
/*
unsigned char OWI_SearchRom(unsigned char * bitPattern, unsigned char lastDeviation, unsigned char pin)
{unsigned char currentBit = 1;unsigned char newDeviation = 0;unsigned char bitMask = 0x01;unsigned char bitA;unsigned char bitB;// Send SEARCH ROM command on the bus.OWI_SendByte(OWI_ROM_SEARCH, pin);// Walk through all 64 bits.while (currentBit <= 64){// Read bit from bus twice.bitA = OWI_ReadBit(pin);bitB = OWI_ReadBit(pin);if (bitA && bitB){// Both bits 1 (Error).newDeviation = OWI_ROM_SEARCH_FAILED;return;}else if (bitA ^ bitB){// Bits A and B are different. All devices have the same bit here.// Set the bit in bitPattern to this value.if (bitA){(*bitPattern) |= bitMask;}else{(*bitPattern) &= ~bitMask;}}else // Both bits 0{// If this is where a choice was made the last time,// a '1' bit is selected this time.if (currentBit == lastDeviation){(*bitPattern) |= bitMask;}// For the rest of the id, '0' bits are selected when// discrepancies occur.else if (currentBit > lastDeviation){(*bitPattern) &= ~bitMask;newDeviation = currentBit;}// If current bit in bit pattern = 0, then this is// out new deviation.else if ( !(*bitPattern & bitMask)) {newDeviation = currentBit;}// IF the bit is already 1, do nothing.else{}}// Send the selected bit to the bus.if ((*bitPattern) & bitMask){OWI_WriteBit1(pin);}else{OWI_WriteBit0(pin);}// Increment current bit.    currentBit++;// Adjust bitMask and bitPattern pointer.    bitMask <<= 1;if (!bitMask){bitMask = 0x01;bitPattern++;}}return newDeviation;
}
*/

仿真

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/857948.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

实现文件分片合并功能并使用Github Actions自动编译Release

一、编译IOS镜像 1.1 编译 起因是公司电脑使用的Win11 23H2的预览版&#xff0c;这个预览版系统的生命周期只到2024-09-18&#xff0c;到期后就会强制每两小时重启。这是Windows强制升级系统的一种手段。 虽然公司里的台式电脑目前用不到&#xff0c;但是里面还保留许多旧项…

Why RAG is slower than LLM?

I used RAG with LLAMA3 for AI bot. I find RAG with chromadb is much slower than call LLM itself. Following the test result, with just one simple web page about 1000 words, it takes more than 2 seconds for retrieving: 我使用RAG&#xff08;可能是指某种特定的…

【大数据 复习】第8章 Hadoop架构再探讨

一、概念 1.Hadoop1.0的核心组件&#xff08;仅指MapReduce和HDFS&#xff0c;不包括Hadoop生态系统内的Pig、Hive、HBase等其他组件&#xff09;&#xff0c;主要存在以下不足&#xff1a; &#xff08;1&#xff09;抽象层次低&#xff0c;需人工编码 &#xff08;2&#xf…

md5在ida中的识别

ida中 识别md5 ,先右键转为hex 或者按h _DWORD *__fastcall MD5Init(_DWORD *result) {*result 0;result[1] 0;result[2] 1732584193;result[3] -271733879;result[4] -1732584194;result[5] 271733878;return result; }在ida中当然也可以使用搜索 search imdate-value …

xss.haozi.me靶场通关参考

url&#xff1a;https://xss.haozi.me/ 文章目录 0x000x010x020x030x040x050x060x070x080x090x0A0x0B0x0C00xD00xE00xF0x100x110x12 0x00 先看js代码&#xff0c;第一关给你热热手&#xff0c;没给你加过 payload&#xff1a; <script>alert(1)</script>0x01 这…

【大数据】—量化交易实战案例(基础策略)

声明&#xff1a;股市有风险&#xff0c;投资需谨慎&#xff01;本人没有系统学过金融知识&#xff0c;对股票有敬畏之心没有踏入其大门&#xff0c;所以只能写本文来模拟炒股。 量化交易&#xff0c;也被称为算法交易&#xff0c;是一种使用数学模型和计算机算法来分析市场数…

FlinkCDC pipeline模式 mysql-to-paimon.yaml

flinkcdc 需要引入&#xff1a; source端&#xff1a; flink-cdc-pipeline-connector-mysql-xxx.jar、mysql-connector-java-xxx.jar、 sink端&#xff1a; flink-cdc-pipeline-connector-paimon-xxx.jar flinkcdc官方提供connect包下载地址&#xff0c;pipeline模式提交作业和…

Python 函数注解,给函数贴上小标签

目录 什么是函数注解? 为什么使用函数注解? 如何编写函数注解? 实战演练 与类型提示(Type Hints)的关系 类型安全的运算器 什么是函数注解? 函数注解(Function Annotations)是Python 3中新增的一个特性,它允许为函数的参数和返回值指定类型。 这些注解不会改变…

Paimon Trino Presto的关系 分布式查询引擎

Paimon支持的引擎兼容性矩阵&#xff1a; Trino 是 Presto 同项目的不同版本&#xff0c;是原Faceboo Presto创始人团队核心开发和维护人员分离出来后开发和维护的分支&#xff0c;Trino基于Presto&#xff0c;目前 Trino 和 Presto 都仍在继续开发和维护。 参考&#xff1a;

win10 安装openssl并使用openssl创建自签名证书

win10创建自签名证书 下载安装配置openssl 下载地址&#xff1a; https://slproweb.com/download/Win64OpenSSL-3_3_1.exe https://slproweb.com/products/Win32OpenSSL.html 完成后安装&#xff0c;一路next&#xff0c;到达选位置的之后选择安装的位置&#xff0c;我这里选…

已成功见刊检索的国际学术会议论文海报展示(2)

【先投稿先送审】第四届计算机、物联网与控制工程国际学术会议&#xff08;CITCE 2024) 大会官网&#xff1a;www.citce.org 时间地点&#xff1a;2024年11月1-3日&#xff0c;中国-武汉 收录检索&#xff1a;EI Compendex&#xff0c;Scopus 主办单位&#xff1a;四川师范…

计算机组成原理 —— 存储系统(主存储器基本组成)

计算机组成原理 —— 存储系统&#xff08;主存储器基本组成&#xff09; 0和1的硬件表示整合结构寻址按字寻址和按字节寻址按字寻址按字节寻址区别总结 字寻址到字节寻址转化 我们今天来看一下主存储器的基本组成&#xff1a; 0和1的硬件表示 我们知道一个主存储器是由存储体…

C++ | Leetcode C++题解之第174题地下城游戏

题目&#xff1a; 题解&#xff1a; class Solution { public:int calculateMinimumHP(vector<vector<int>>& dungeon) {int n dungeon.size(), m dungeon[0].size();vector<vector<int>> dp(n 1, vector<int>(m 1, INT_MAX));dp[n][m …

【大数据 复习】第7章 MapReduce(重中之重)

一、概念 1.MapReduce 设计就是“计算向数据靠拢”&#xff0c;而不是“数据向计算靠拢”&#xff0c;因为移动&#xff0c;数据需要大量的网络传输开销。 2.Hadoop MapReduce是分布式并行编程模型MapReduce的开源实现。 3.特点 &#xff08;1&#xff09;非共享式&#xff0c;…

MySQL学习笔记-进阶篇-视图和存储过程

四、视图和存储过程 视图 存储过程 基本语法 创建 CREATE PROCEDURE ([参数列表]) BEGIN --SQL END; 调用 CALL 存储过程名&#xff08;[参数列表]&#xff09; 查看 --查看指定数据库的存储过程及状态信息 SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SHCEMA…

indexedDB---掌握浏览器内建数据库的基本用法

1.认识indexedDB IndexedDB 是一个浏览器内建的数据库&#xff0c;它可以存放对象格式的数据&#xff0c;类似本地存储localstore&#xff0c;但是相比localStore 10MB的存储量&#xff0c;indexedDB可存储的数据量远超过这个数值&#xff0c;具体是多少呢&#xff1f; 默认情…

【软件设计】详细设计说明书(word原件,项目直接套用)

软件详细设计说明书 1.系统总体设计 2.性能设计 3.系统功能模块详细设计 4.数据库设计 5.接口设计 6.系统出错处理设计 7.系统处理规定 软件全套资料&#xff1a;本文末个人名片直接获取或者进主页。

C语言笔试题:实现把一个无符号整型数字的二进制序列反序后输出

目录 题目 实例 方法一&#xff1a;直接交换 方法二&#xff1a;间接交换 拓展 题目 编写一个函数&#xff0c;将一个无符号整数的所有位逆序&#xff08;在32位机器下&#xff09; 实例 例如有一个无符号整数 unsigned int num 32; unsigned int 在32位系统中占4个字…

洛谷 P10584 [蓝桥杯 2024 国 A] 数学题(整除分块+杜教筛)

题目 思路来源 登录 - Luogu Spilopelia 题解 参考了两篇洛谷题解&#xff0c;第一篇能得出这个式子&#xff0c;第二篇有比较严格的复杂度分析 结合去年蓝桥杯洛谷P9238&#xff0c;基本就能得出这题的正确做法 代码 #include<bits/stdc.h> #include<iostream&g…