From 91edfee0527b68a115eef84df528f731536b3962 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Wed, 23 Aug 2023 13:55:46 +0200 Subject: [PATCH] update to prog --- UML/can.pdf | Bin 0 -> 2342 bytes UML/can.uxf | 222 +++++++++++----------------------------------------- 2 files changed, 45 insertions(+), 177 deletions(-) create mode 100644 UML/can.pdf diff --git a/UML/can.pdf b/UML/can.pdf new file mode 100644 index 0000000000000000000000000000000000000000..14c421afbcf36c54da4fe22a814626c7cc2ff1ed GIT binary patch literal 2342 zcmb7GYgiL!7A{&qvp}n^VC!vIAb=3&k_!n-Q{*agl^~#UaUcUkLZ&7IMB}5Nf>1;e z5Nu^Zp#-}?fx1%HB0>qEQbC|mR1g-sWr;{x#d1^F8KlLsKD+Jwne&}Z>O+~F;qnt_Z0hX_bJ)+uXrDWmmilf=Q zlCFeL48Phn=2fW4HB2=0Gc(bmH_XPgTQp8>(XevqD@3NThxPutsUKq)YB@{vds|$a zQ{GGMa!udzW%8fX!i}ulj-CI`RnA@}c>3|3b(faq8?~UO!@YZL97-RiA4n>#{m0)d z_r4sNl_`(k6khNg5eL~GZ5cAt$r!!du%~mAG|?u`bam?Tnv?!pjZ^69yK}snqb_c& zJhUcEc<;vdCife*yQ;4xmL+Mr^P6w;HJ(KQCptaN6gfj<_f2BX4&?gN{k>a`BHHH} z1>Ju-w!CVqqsmlimnK{$`Je;YGp@NDWB*<^@*LZwsU5cS^n_k-&c1ok$e`cvOHq%9@~0;M{>*YtX!QZ)~jk* zXGheUXL^|8{fdJ=rRNJ9k#)Q8sXlvWWvS;8>@<|yhi`DXy5j3to93v#^rG@-n#j8A z)0YE~286fvV|s^Os;6~F@}Onr;L9ab9yflp9qzuBS>_kqX7pS+6%oJP@cG(~1Ua#x zn$fhXg15A7+n32n?KBp$-pl79zglKZ-{PPN_2k&=X~sjUcN!e06$Lrknh9E)Z7j;I zD=QE2z)Fh>^+?^p55c^$+E1n5Vlxw{LSg+waj0WT@pw_=g%75cwQWZG{+)Sp@Snuk zb~WteWs=oUqqJ;%IL4{GSR3r8YU&g$m6Z!J>BA!@#-OGL`$N^Zj`oFBwU!Uw+P*SD zE9=y=7m^uYalCre;I`a0C4{K6x_Ha(P;F~jaF2M?-mqB1$@uhhm;2P=Fxd3|y~$WU z6rG=gc4|M_Ka2{jT`HZ6*N3;Y?dkY_Jf@>!w}N}8{A`9M3W6}^80%gdnp z@tUMVSu;BK>dm*R64$x`ij3DE_*EXZ%iAi%WE}@Z`ZMUc+1d0}9=8 z%}C^9D+izIMism8nwH+?@&Otq5zbE_(xOHdZ((%#@B0V?ebFck^umN9)Df5Og2*VB z2?0zV6axBTGCWQifyu}*=ZZ@R>IDNVGQ|&cMF0+E@cE#NoNyBmkg~UF1F|vLq%UWB@fy{YW5Eas_Z-#VOzvTNjnFZ!T}26!U+mH z<$*y*REEvDw_xIUj1Wbjpo@eYz9LB!7$}l#mdHduulf9+>r&uG9k2!t>pF2aPFY&OKUf)H~EGPeZ1 zaN++ - + 15 - - UMLSpecialState - - 450 - 150 - 30 - 30 - - type=initial - - - - UMLState - - 390 - 240 - 150 - 60 - - STCA_WAIT - - - - Relation - - 450 - 165 - 120 - 105 - - lt=-> -evCAinit - - 10.0;10.0;10.0;50.0 - - - Relation - - 450 - 285 - 165 - 105 - - lt=-> -evCAnewMsg - 10.0;10.0;10.0;50.0 - - - UMLState - - 315 - 360 - 285 - 105 - - STCA_READ -- --. -/entry: processCan - - - - Relation - - 480 - 255 - 225 - 360 - - lt=-> -m1=[queue empty] - - 10.0;210.0;130.0;210.0;130.0;10.0;40.0;10.0 - - - UMLSpecialState - - 435 - 540 - 60 - 60 - - type=decision - - - - Relation - - 450 - 450 - 135 - 120 - - lt=-> -evCAdone - 10.0;10.0;10.0;60.0 - - - Relation - - 210 - 375 - 255 - 240 - - lt=-> -m1=[else] - - 150.0;130.0;10.0;130.0;10.0;10.0;70.0;10.0 - UMLNote - 90 - 630 - 615 - 270 + 645 + 255 + 675 + 525 - _*How to use*_ + _*How to use CAN interface*_ + +*In Factory_Init: * +CAN_init(); *In Factory_build: * -ECAN_SetRXBnInterruptHandler(CANINTERFACE_newMsg); -CANINTERFACE_onProcessCan(&processCan); +ECAN_SetRXBnInterruptHandler(CAN_newMsg); +CAN_onReceiveCan(&receiveCan); +CAN_setSender(idSender); -*Somewhere:* -void processCan(uint32_t canId, uint32_t canData) { +*In Factory_start:* +CAN_startBehaviour(); + +*Somewhere for process input can message:* +void receiveCan(uint8_t idSender, uint8_t idMsg, uint32_t canData) { ..... -} +} + +*For send can message: * +CAN_sendCanMsg(uint8_t idRecipient, uint8_t idMsg, uint32_t data); Relation - 900 - 225 + 360 + 330 90 - 105 + 135 lt=-> evInit - 10.0;10.0;10.0;50.0 + 10.0;10.0;10.0;70.0 UMLSpecialState - 900 - 210 + 360 + 315 30 30 @@ -158,71 +58,39 @@ evInit UMLState - 840 - 300 - 150 - 60 - - STCS_WAIT - - - - UMLState - - 810 - 420 - 210 + 240 + 435 + 270 90 - STCS_SEND --- --. -/entry sendCan + STCA_PROCESS Relation - 900 - 345 - 135 - 105 + 450 + 465 + 180 + 180 lt=-> -evCSsend - - 10.0;10.0;10.0;50.0 +m1=evCAsend +m1=\n/sendCan() + 10.0;40.0;10.0;100.0;100.0;100.0;100.0;10.0;40.0;10.0 Relation - 900 - 315 - 270 - 270 + 135 + 465 + 300 + 180 lt=-> -evCSdone +m1= evCAnewMsg +m1= \n/receiveCan() - 10.0;130.0;10.0;160.0;100.0;160.0;100.0;10.0;60.0;10.0 - - - UMLNote - - 765 - 630 - 705 - 270 - - _*How to use*_ - -*Like a static class:* -sendCanMsg(uint32_t id, uint32_t data); - -*Or like an Object: * -CANSENDER_seSender(CANSENDER* me, uint8_t s); -CANSENDER_setRecipient(CANSENDER* me, uint8_t r); -CANSENDER_sendCanMsg(CANSENDER* me, uint8_t id, uint32_t data); - + 100.0;40.0;100.0;100.0;10.0;100.0;10.0;10.0;70.0;10.0