| 数据搜索系统,热门电子元器件搜索 |
|
WI.232FHSS-25-R 数据表(PDF) 58 Page - Radiometrix Ltd |
|
|
|||||||||||||||||||||||||||||
WI.232FHSS-25-R 数据表(HTML) 58 Page - Radiometrix Ltd |
|
58 / 67 page ![]() WI.232FHSS-25-R/ WI.232FHSS-250-R DATASHEET 57 Revision 1.1.0 default configuration when power is applied to the module. During normal operation, the volatile registers are used to control the module. Placing the module in the command mode allows these registers to be programmed. Byte values in excess of 127 (0x80 or greater) must be changed into a two-byte escape sequence of the format: 0xFE, [value - 128]. For example, the value 0x83 becomes 0xFE, 0x03. The following function will prefix a 0xFF header and size specifier to a command sequence and create escape sequences as needed. It is assumed that *src is populated with either the register number to read (one byte, pass 1 into src_len) or the register number and value to write (two bytes, pass 2 into src_len). It is also assumed that the *dest buffer has enough space for the two header characters plus, the encoded command, and the null terminator. int EscapeString(char *src, char src_len, char *dest) { // The following function copies and encodes the first // src_len characters from *src into *dest. This // encoding is necessary for Wi.232 command formats. // The resulting string is null terminated. The size // of this string is the function return value. // --------------------------------------------------- char src_idx, dest_idx; // Save space for the command header and size bytes // ------------------------------------------------ dest_idx = 2; // Loop through source string and copy/encode // ------------------------------------------ for (src_idx = 0; src_idx < src_len; src_idx++) { if (src[src_idx] > 127) { dest[dest_idx++] = 0xFE; }/*if*/ dest[dest_idx++] = (src[src_idx] & 0x7F); }/*for*/ // Add null terminator // ------------------- dest[dest_idx] = 0; // Add command header // ------------------ dest[0] = 0xFF; dest[1] = dest_idx – 2; // Return escape string size // ------------------------- return dest_idx; } Figure 16: Command Conversion Code 5.4. Writing to Registers Writing to a volatile register is nearly instantaneous. Writing to a non-volatile register, however, typically takes 16 ms. Because the packet size can vary based on the need for encoding, there are two possible packet structures. The following tables show the byte sequences for writing a register in each case. |
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |