Tsev > Xov xwm > Ntsiab lus

Processor Engine Executes hais kom ua,

Apr 26, 2019

5.12 CMD_DLSTART - pib sau cov npe tshiab

Thaum cov tshuab pa roj carbon monoxide ua executes qhov kev hais kom ua no, nws tos kom txog thaum lub caij tam sim no

daim ntawv teev yog luam tawm, ces teev REG_CMD_DL xoom

image

Piv txwv

cmd_dlstart ();

...

cmd_dlswap ();


5.13 CMD_SWAP - pauv daim ntawv teev npe tam sim no

Thaum cov tshuab pa roj carbon monoxide ua executes qhov kev hais kom ua no, nws xav tau cov lus sib puav

tam sim tom qab daim ntawv teev cov khoom tso tawm tam sim no. Internally, lub tshuab pa roj carbon monoxide

siv cov lus txib no los ntawm kev sau ntawv mus rau REG_DLSWAP. Thov saib ntawm REG_DLSWAP

Txhais.

Qhov kev hais ua haujlwm cav-engine no yuav tsis tsim kom muaj cov lus sau kom pom

daim ntawv teev npe RAM_DL.

C daim ntawv prototype

void cmd_swap ();

image

Piv txwv

Tsis muaj


5.14 CMD_COLDSTART - teeb lub tshuab ua haujlwm ntawm lub cav ua haujlwm rau qhov tseem ceeb

Cov lus txib no teev cov tshuab hluav taws xob ua haujlwm kom rov pib dua lub xeev.

C daim ntawv prototype

tsis muaj dabtsis cmd_coldstart ();

image

image


5.15 CMD_INTERRUPT - Tiv thaiv cuam tshuam INT_CMDFLAG

Thaum cov tshuab pa roj carbon monoxide ua executes qhov kev hais kom ua, nws ua kev cuam tshuam

INT_CMDFLAG.

C daim ntawv prototype

tsis muaj dabtsis cmd_interrupt (uint32_t ms);

Cov lus qhia

ms

Ncua kev ua ntej cuam tshuam ua rau, hauv milliseconds. Qhov kev cuam tshuam yog guaranteed

tsis txhob tua hluav taws ua ntej kev ncua no. Yog tias ms xoom, qhov hluav taws xob cuam tshuam tam sim ntawd.

image

Piv txwv

Yuav ua rau kev cuam tshuam kev cuam tshuam tom qab ib tug JPEG tau tiav qhov chaw:

cmd_loadimage ();

...

cmd_interrupt (0); // yav dhau los load duab tiav, txhais trigger

Tshawb nrhiav kev cuam tshuam hauv 0.5 vib nas this:

cmd_interrupt (500);


5.16 CMD_APPEND - append nco mus tso saib sau

Txhab ib ntu ntawm cim xeeb rau daim ntawv teev npe tam sim no nco chaw nyob qhov twg cov offset

yog teev nyob rau hauv REG_CMD_DL.

C daim ntawv prototype

tsis muaj dabtsis cmd_append (uint32_t ptr,

uint32_t num);

Cov lus qhia

ptr

Pib ntawm qhov chaw commands hauv lub ntsiab cim xeeb

num

Cov naj npawb ntawm bytes luam. Qhov no yuav tsum yog ntau yam ntawm 4.

image

Kev piav qhia

Tom qab appending tas lawm, lub tshuab pa hluav taws xob yuav nce lub REG_CMD_DL los ntawm

txoj hauj lwm kom paub tseeb tias daim ntawv teev lus pom zoo.

Piv txwv

...

cmd_dlstart ();

cmd_append (0, 40); // copy 10 commands ntawm lub ntsiab cim xeeb chaw nyob 0

cmd (LUS); // tag nrho cov ntawv sau

cmd_swap ();


5.17 CMD_REGREAD - nyeem ib tus nqi register

C daim ntawv prototype

tsis muaj dabtsis cmd_regread (uint32_t ptr,

uint32_t tshwm sim);

Cov lus qhia

ptr

Chaw nyob ntawm kev sau npe los nyeem

tshwm sim

Tus nqi register rau kev nyeem ntawm qhov chaw nyob ptr. image

Piv txwv

Mus ntes tus caij nyoog thaum lub sijhawm ua tiav nws cov lus:

uint16_t x = rd16 (REG_CMD_WRITE);

cmd_regread (REG_CLOCK, 0);

...

printf ("% 08x \ n", rd32 (RAM_CMD + x + 8));


5.18 CMD_MEMWRITE - sau bytes rau hauv kev nco

Sau cov nram qab no bytes rau hauv FT800 nco. Cov lus txib no siv tau los teeb tsa

sau npe qhov tseem ceeb, los hloov tshiab txheem ntawm lub sijhawm tshwj xeeb.

C daim ntawv prototype

tsis muaj dabtsis cmd_memwrite (uint32_t ptr,

uint32_t num);

Cov lus qhia

Ptr

Lub chaw cim xeeb nyob rau hauv ntawv

num

Number of bytes yuav tsum sau.

Kev piav qhia

Cov ntaub ntawv byte yuav tsum tam sim ntawd ua raws li cov lus txib tsis. Yog hais tias muaj pes tsawg tus bytes

tsis yog ntau yam ntawm 4, ces 1, 2 lossis 3 bytes yuav tsum tau ntxiv los xyuas kom tseeb tias 4-byte

cov kawm ua ke ntawm cov lus txib tom ntej no, cov padding bytes tuaj yeem muaj nqis. Lub

tiav ntawm qhov kev ua no tuaj yeem kuaj tau thaum tus nqi ntawm REG_CMD_READ sib npaug

mus rau REG_CMD_WRITE.

Ceebtoom: Yog tias siv qhov kev hais kom ua no, nws yuav ua rau lub cim xeeb ntawm FT800 nco yog siv

tsis raug.

image

Piv txwv

Hloov lub nrig qaum ci ci mus rau 64 (ib nrab siv) rau kev tshuaj ntsuam tshwj xeeb:

...

cmd_swap (); // tag nrho cov ntawv sau

cmd_dlstart (); // tos txog tom qab qhov sib pauv

cmd_memwrite (REG_PWM_DUTY, 4); // sau ntawv mus rau PWM_DUTY npe

cmd (100);