Changes for page API контроллеров AZ®
Last modified by Max on 2025/03/02 15:18
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1238,34 +1238,35 @@ 1238 1238 Example program: 1239 1239 1240 1240 {{code language="assembler"}} 1241 -; trap 52 - чтение блока IP адресов в блок памяти IPADDDBLOCK (8. ячеек) 1242 -; результат в R3 =0 error, иначе адрес куда считано (IPADDDBLOCK) 1243 -GetIPaddrs: push R1 1244 - push R2 1245 - call AZreset; сбросим 1246 - tst R1 1247 - bne 0ERR$ 1248 - MOV #AZ$CSR,R1 1249 - mov #40,(R1) 1250 -0$: TSTB (R1); прочитать адреса в свою память 1251 - BPL 0$; ждем 1252 - mov #41,(R1) 1253 -1$: TSTB (R1); подготовить буфер 1254 - BPL 1$; ждем 1255 - TST (R1)+; инкрементируем 1256 - mov #IPADDDBLOCK,R3 1257 - mov #12.,R2 1258 -2$: mov (R1),(R3)+; читаем блок слов в память 1259 - sob R2,2$ 1260 - mov #IPADDDBLOCK,R3; успешно 1261 - br 0END$ 1262 -0ERR$: CLR R3 1263 -0END$: pop R2 1264 - pop R1 1265 - return 1241 +; trap 52 - reading a block of IP addresses into the IPADDDBLOCK memory block (8 cells) 1242 +; result in R3 = 0 if error, otherwise the address where it was read (IPADDDBLOCK) 1243 +GetIPaddrs: push R1 1244 + push R2 1245 + call AZreset; reset 1246 + tst R1 1247 + bne 0ERR$ 1248 + MOV #AZ$CSR,R1 1249 + mov #40,(R1) 1250 +0$: TSTB (R1); read addresses into its memory 1251 + BPL 0$; wait 1252 + mov #41,(R1) 1253 +1$: TSTB (R1); prepare buffer 1254 + BPL 1$; wait 1255 + TST (R1)+; increment 1256 + mov #IPADDDBLOCK,R3 1257 + mov #12.,R2 1258 +2$: mov (R1),(R3)+; read block of words into memory 1259 + sob R2,2$ 1260 + mov #IPADDDBLOCK,R3; success 1261 + br 0END$ 1262 +0ERR$: CLR R3 1263 +0END$: pop R2 1264 + pop R1 1265 + return 1266 + 1266 1266 {{/code}} 1267 1267 1268 - Примерданных1269 +Example return data: 1269 1269 1270 1270 {{info}} 1271 1271 Data examples - words returned in octal format ... ... @@ -1277,64 +1277,65 @@ 1277 1277 124300 055000 - DNS2 address of backup DNS 192.168.0.80 1278 1278 {{/info}} 1279 1279 1280 -== **043:чтениеMAC-адресавipбуфер**==1281 +== 043: Read MAC address into ip buffer == 1281 1281 1282 -Код команды 043, данная команда читает текущий фактический MAC адрес в буфер IP адресов 1283 -те сначала 043, а затем 041 команды 1283 +Command code 043, this command reads the current actual MAC address into the IP address buffer i.e. first 043 and then 041 commands 1284 1284 1285 - Примерпрограммы:1285 +Example program: 1286 1286 1287 1287 {{code language="assembler"}} 1288 -; trap 72 - чтение MAC адреса в блок памяти IPADDDBLOCK (12. ячеек) 1289 -; результат в R3 =0 error, иначе адрес куда считано (IPADDDBLOCK) 1290 -GetMACaddrs: push R1 1291 - push R2 1292 - call AZreset ; сбросим 1293 - tst R1 1294 - bne 0ERR$ 1295 - MOV #AZ$CSR,R1 1296 - mov #43,(R1) 1297 -0$: TSTB (R1) ; прочитать адреса в свою память 1298 - BPL 0$ ; ждем 1299 - mov #41,(R1) 1300 -1$: TSTB (R1) ; подготовить буфер 1301 - BPL 1$ ; ждем 1302 - TST (R1)+ ; инкрементируем 1303 - mov #IPADDDBLOCK,R3 1304 - mov #12.,R2 1305 -2$: mov (R1),(R3)+ ; читаем блок слов в память 1306 - sob R2,2$ 1307 - mov #IPADDDBLOCK,R3; успешно 1308 - br 0END$ 1309 -0ERR$: CLR R3 1310 -0END$: pop R2 1311 - pop R1 1312 - retur 1288 +; trap 72 - reading the MAC address into the IPADDDBLOCK memory block (12 cells) 1289 +; result in R3 = 0 if error, otherwise the address where it was read (IPADDDBLOCK) 1290 +GetMACaddrs: push R1 1291 + push R2 1292 + call AZreset ; reset 1293 + tst R1 1294 + bne 0ERR$ 1295 + MOV #AZ$CSR,R1 1296 + mov #43,(R1) 1297 +0$: TSTB (R1) ; read addresses into its memory 1298 + BPL 0$ ; wait 1299 + mov #41,(R1) 1300 +1$: TSTB (R1) ; prepare buffer 1301 + BPL 1$ ; wait 1302 + TST (R1)+ ; increment 1303 + mov #IPADDDBLOCK,R3 1304 + mov #12.,R2 1305 +2$: mov (R1),(R3)+ ; read block of words into memory 1306 + sob R2,2$ 1307 + mov #IPADDDBLOCK,R3; success 1308 + br 0END$ 1309 +0ERR$: CLR R3 1310 +0END$: pop R2 1311 + pop R1 1312 + retur 1313 + 1313 1313 {{/code}} 1314 1314 1315 1315 1316 1316 1317 -= **КомандыдляработысMicroSDкартойнафайловомуровне**=1318 += Commands for working with a MicroSD card at the file level = 1318 1318 1319 1319 1320 - ДанныекомандыпредназначеныдляработысMicroSDкартойнауровнефайловойсистемыипозволяетчитать/писатьфайлыбезмонтированияфайловкакобразовдисков.1321 +These commands are designed to work with a MicroSD card at the file system level and allow you to read/write files without mounting files as disk images. 1321 1321 1322 -Эти команды используют буфер 256. слов который задействован в интерфейсе работы с энергонезависимой памятью (см выше команды 022 023) 1323 -\\Ограничения - длина полного пути к файлу 256 байт 1323 +These commands use a 256-word buffer that is used in the interface for working with non-volatile memory (see commands 022 023 above) 1324 1324 1325 - ==**050:Установитьимяфайлакоторыйбудемчитать**==1325 +Limitations - the length of the full path to the file is 256 bytes 1326 1326 1327 - Кодкоманды050,даннаякомандаустанавливаетимяфайлакоторыйбудемчитать,приэтом производится открытие файла на чтение, а также получение его свойств.1327 +== 050: Set the name of the file we will read == 1328 1328 1329 - ==**051:Получитьразмерфайланачтение(илиегостатус)наМПИ**==1329 +Command code 050, this command sets the name of the file that we will read, while opening the file for reading, and also obtaining its properties. 1330 1330 1331 - Кодкоманды051,даннаякомандапередаетнаМПИразмерфайлаилиошибкуего чтения. Размер файла 31бит, старший бит является признаком ошибки. Соответственно максимальный размер файлов с которыми можно работать через этот интерфейс ограничен 2^31 байт (2GB).1331 +== 051: Get file size for reading (or its status) on BUS == 1332 1332 1333 -формирование ошибки выглядит так: 1334 -sizeanyfile=1<<31 + FFres; ~/~/ если установлен старший бит 32х битного слова - то в младшей части код ошибки 1335 -\\FFres = ошибка FatFS 1336 - 1333 +Command code 051, this command transmits the file size or reading error to the MPI. The file size is 31 bits, the most significant bit is an error indicator. Accordingly, the maximum file size that can be worked with via this interface is limited to 2 ^ 31 bytes (2GB). 1337 1337 1335 +The error generation looks like this: 1336 +sizeanyfile=1<<31 + FFres; ~/~/ if the most significant bit of a 32-bit word is set, then the error code is in the lower part 1337 + 1338 +FFres = FatFS error 1339 + 1338 1338 {{code language="c"}} 1339 1339 typedef enum { 1340 1340 FR_OK = 0, /* (0) Succeeded */ ... ... @@ -1362,23 +1362,22 @@ 1362 1362 1363 1363 [[http:~~/~~/elm-chan.org/fsw/ff/doc/open.html>>url:http://elm-chan.org/fsw/ff/doc/open.html]] 1364 1364 1365 -== **052:Читатьблокустановленногофайлавбуфер**==1367 +== 052: Read a block of a set file into a buffer == 1366 1366 1367 - Кодкоманды052,даннаякомандаосуществляетчтениефайлавбуферэнергонезависимойпамяти.1369 +Command code 052, this command reads a file into a non-volatile memory buffer. 1368 1368 1369 -В итоге схема чтения файла выглядит вот так 1370 -**023** - заливаем имя файла в буфер 1371 -**050** - устанавливаем файл на чтение 1372 -**051 **- читаем длину файла или ошибку открытия файла 1373 -если ошибка - повторяем сначала 023 050 051 1374 -если все ok - приступаем к чтению файла 1375 -**052** - читает блок файла в буфер 1376 -**022 **- забираем данные из буфера 1377 -пары 052 022 повторяем нужное количество раз дабы считать весь файл 1378 -как файл будет прочтен - последняя 052 команда закроет его автоматически. 1379 - 1371 +As a result, the file reading scheme looks like this 1372 +**023** - fill the file name into the buffer 1373 +**050 **- set the file for reading 1374 +**051** - read the file length or file open error 1375 +if there is an error - repeat 023 050 051 from the beginning 1376 +if everything is ok - start reading the file 1377 +**052** - read the file block into the buffer 1378 +**022** - take data from the buffer 1379 +repeat the **052 022** pairs the required number of times in order to read the entire file 1380 +once the file is read - the last 052 command will close it automatically. 1380 1380 1381 - Примерпрограммы1382 +Example program: 1382 1382 1383 1383 {{code language="assembler"}} 1384 1384 ... ... @@ -1499,7 +1499,7 @@ 1499 1499 как файл будет записан - последняя 055 команда закроет его автоматически 1500 1500 1501 1501 1502 - Примерпрограммы:1503 +Example program: 1503 1503 1504 1504 {{code language="assembler"}} 1505 1505 ; заливаем в буфер имя файла