资源简介
通过异步串口传送modbus协议。可延长rs485现场总线,不用布线,在短程内实现无线485非常方便。
代码片段和文件信息
#include “cc430x613x.h“
#include “flashData.h“
#define INFOMATION_SEGMENT_LENGTH 128
void write_SegA(unsigned char * rfParameterPtr)//rfParameterPtr &RF_SETTINGS
{
unsigned int i;
char * Flash_ptr; // Initialize Flash pointer
Flash_ptr = (char *) INFOMATION_A_ADDRESS;
// __disable_interrupt(); // 5xx Workaround: Disable global
_DINT();
FCTL4 = FWKEY&(~LOCKINFO);
if(FCTL3&LOCKA)
FCTL3 = FWKEY + LOCKA;
FCTL3 = FWKEY; // Clear Lock bit
FCTL1 = FWKEY+ERASE; // Set Erase bit
*Flash_ptr = 0; // Dummy write to erase Flash seg
while(FCTL3&BUSY);
FCTL1 = FWKEY+WRT; // Set WRT bit for write operation
for (i = 0; i < INFOMATION_SEGMENT_LENGTH; i++)
{
*Flash_ptr++ = *rfParameterPtr++; // Write value to flash
}
if(!(FCTL3&LOCKA))
FCTL3 = FWKEY + LOCKA;
FCTL4 = FWKEY + LOCKINFO;
FCTL1 = FWKEY; // Clear WRT bit
while(FCTL3&BUSY);
FCTL3 = FWKEY+LOCK; // Set LOCK bit
_EINT();
}
void write_SegB(unsigned char * parameterPtr)//rfParameterPtr &RF_SETTINGS
{
unsigned int i;
char * Flash_ptr; // Initialize Flash pointer
Flash_ptr = (char *) INFOMATION_B_ADDRESS;
//__disable_interrupt(); // 5xx Workaround: Disable global
_DINT();
// interrupt while erasing. Re-Enable
FCTL4 = FWKEY&(~LOCKINFO);
if(FCTL3&LOCKA)
FCTL3 = FWKEY + LOCKA;
FCTL3 = FWKEY; // Clear Lock bit
FCTL1 = FWKEY+ERASE; // Set Erase bit
*Flash_ptr = 0; // Dummy write to erase Flash seg
while(FCTL3&BUSY);
FCTL1 = FWKEY+WRT; // Set WRT bit for write operation
for (i = 0; i < INFOMATION_SEGMENT_LENGTH; i++)
{
*Flash_ptr++ = *parameterPtr++; // Write value to flash
}
if(!(FCTL3&LOCKA))
FCTL3 = FWKEY + LOCKA;
FCTL4 = FWKEY + LOCKINFO;
FCTL1 = FWKEY; // Clear WRT bit
FCTL3 = FWKEY+LOCK; // Set LOCK bit
while(FCTL3&BUSY);
_EINT();
}
void write_SegC(unsigned char * parameterPtr)//rfParameterPtr &RF_SETTINGS
{
unsigned int i;
char * Flash_ptr; // Initialize Flash pointer
Flash_ptr = (char *) INFOMATION_C_ADDRESS;
//__disable_interrupt(); // 5xx Workaround: Disable global
_DINT();
// interrupt while erasing. Re-Enable
FCTL4 = FWKEY&(~LOCKINFO);
if(FCTL3&LOCKA)
FCTL3 = FWKEY + LOCKA;
FCTL3 = FWKEY; // Clear Lock bit
FCTL1 = FWKEY+ERASE; // Set Erase bit
*Flash_ptr = 0; // Dummy write to erase Flash seg
while(FCT
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 17879 2012-10-15 13:15 RF_Example_Code\Backup (2) of RF_Toggle_LED_Demo.ewd
文件 47497 2012-10-15 13:13 RF_Example_Code\Backup (2) of RF_Toggle_LED_Demo.ewp
文件 3551 2011-12-22 10:01 RF_Example_Code\Backup of RF_Toggle_LED_Demo.dep
文件 17879 2010-04-24 17:35 RF_Example_Code\Backup of RF_Toggle_LED_Demo.ewd
文件 47402 2010-04-24 17:35 RF_Example_Code\Backup of RF_Toggle_LED_Demo.ewp
文件 63445 2014-11-25 14:19 RF_Example_Code\Debug\Exe\RF_Toggle_LED_Demo.d43
文件 524 2011-12-22 09:56 RF_Example_Code\Debug\Obj\Backup of RF_Toggle_LED_Demo.pbd
文件 1259485 2014-09-16 15:46 RF_Example_Code\Debug\Obj\flashData.pbi
文件 9938 2014-09-16 15:46 RF_Example_Code\Debug\Obj\flashData.pbi.cout
文件 16052 2014-09-16 15:46 RF_Example_Code\Debug\Obj\flashData.r43
文件 1112093 2014-09-09 14:37 RF_Example_Code\Debug\Obj\hal_pmm.pbi
文件 9936 2014-09-09 14:37 RF_Example_Code\Debug\Obj\hal_pmm.pbi.cout
文件 15963 2012-08-29 11:31 RF_Example_Code\Debug\Obj\hal_pmm.r43
文件 9949 2014-09-26 17:01 RF_Example_Code\Debug\Obj\mrfi_radio_interface.pbi.cout
文件 1360395 2014-11-18 13:49 RF_Example_Code\Debug\Obj\RF1A.pbi
文件 9933 2014-11-18 13:49 RF_Example_Code\Debug\Obj\RF1A.pbi.cout
文件 43423 2014-11-18 13:56 RF_Example_Code\Debug\Obj\RF1A.r43
文件 85792 2014-11-19 13:59 RF_Example_Code\Debug\Obj\RfRegSettings.pbi
文件 9942 2014-11-19 13:59 RF_Example_Code\Debug\Obj\RfRegSettings.pbi.cout
文件 2586 2014-11-21 10:40 RF_Example_Code\Debug\Obj\RfRegSettings.r43
文件 3121285 2014-11-26 15:43 RF_Example_Code\Debug\Obj\RF_Toggle_LED_Demo.pbd
文件 3121285 2014-11-26 15:43 RF_Example_Code\Debug\Obj\RF_Toggle_LED_Demo.pbd.browse
文件 1391654 2014-11-25 13:57 RF_Example_Code\Debug\Obj\RF_Toggle_LED_Demo.pbi
文件 9947 2014-11-25 13:57 RF_Example_Code\Debug\Obj\RF_Toggle_LED_Demo.pbi.cout
文件 65846 2014-11-25 14:19 RF_Example_Code\Debug\Obj\RF_Toggle_LED_Demo.r43
文件 2737161 2014-11-25 10:56 RF_Example_Code\Debug\Obj\serialPort.pbi
文件 9939 2014-11-25 10:56 RF_Example_Code\Debug\Obj\serialPort.pbi.cout
文件 66093 2014-11-25 14:19 RF_Example_Code\Debug\Obj\serialPort.r43
文件 1631 2010-01-20 11:21 RF_Example_Code\inc\hal_pmm.h
文件 3121 2010-04-23 15:08 RF_Example_Code\inc\RF1A.h
............此处省略36个文件信息
- 上一篇:HttpHelper 苏飞万能框架 V1.9.0.1 源码
- 下一篇:LD50计算器
评论
共有 条评论