1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762 |
- #include "stm32f4xx_dsi.h"
- #if defined(STM32F469_479xx)
- #define DSI_TIMEOUT_VALUE ((uint32_t)1000)
- #define DSI_ERROR_ACK_MASK (DSI_ISR0_AE0 | DSI_ISR0_AE1 | DSI_ISR0_AE2 | DSI_ISR0_AE3 | \
- DSI_ISR0_AE4 | DSI_ISR0_AE5 | DSI_ISR0_AE6 | DSI_ISR0_AE7 | \
- DSI_ISR0_AE8 | DSI_ISR0_AE9 | DSI_ISR0_AE10 | DSI_ISR0_AE11 | \
- DSI_ISR0_AE12 | DSI_ISR0_AE13 | DSI_ISR0_AE14 | DSI_ISR0_AE15)
- #define DSI_ERROR_PHY_MASK (DSI_ISR0_PE0 | DSI_ISR0_PE1 | DSI_ISR0_PE2 | DSI_ISR0_PE3 | DSI_ISR0_PE4)
- #define DSI_ERROR_TX_MASK DSI_ISR1_TOHSTX
- #define DSI_ERROR_RX_MASK DSI_ISR1_TOLPRX
- #define DSI_ERROR_ECC_MASK (DSI_ISR1_ECCSE | DSI_ISR1_ECCME)
- #define DSI_ERROR_CRC_MASK DSI_ISR1_CRCE
- #define DSI_ERROR_PSE_MASK DSI_ISR1_PSE
- #define DSI_ERROR_EOT_MASK DSI_ISR1_EOTPE
- #define DSI_ERROR_OVF_MASK DSI_ISR1_LPWRE
- #define DSI_ERROR_GEN_MASK (DSI_ISR1_GCWRE | DSI_ISR1_GPWRE | DSI_ISR1_GPTXE | DSI_ISR1_GPRDE | DSI_ISR1_GPRXE)
- #define DSI_MAX_RETURN_PKT_SIZE ((uint32_t)0x00000037)
- static void DSI_ConfigPacketHeader(DSI_TypeDef *DSIx, uint32_t ChannelID, uint32_t DataType, uint32_t Data0, uint32_t Data1);
- void DSI_DeInit(DSI_TypeDef *DSIx)
- {
-
- DSIx->WCR &= ~DSI_WCR_DSIEN;
-
-
- DSIx->CR &= ~DSI_CR_EN;
-
-
- DSIx->PCTLR &= ~(DSI_PCTLR_CKE | DSI_PCTLR_DEN);
-
-
- DSIx->WRPCR &= ~DSI_WRPCR_PLLEN;
-
-
- DSIx->WRPCR &= ~DSI_WRPCR_REGEN;
-
-
- assert_param(IS_DSI_ALL_PERIPH(DSIx));
- if(DSIx == DSI)
- {
-
- RCC_APB2PeriphResetCmd(RCC_APB2Periph_DSI, ENABLE);
-
- RCC_APB2PeriphResetCmd(RCC_APB2Periph_DSI, DISABLE);
- }
- }
-
- void DSI_Init(DSI_TypeDef *DSIx,DSI_InitTypeDef* DSI_InitStruct, DSI_PLLInitTypeDef *PLLInit)
- {
- uint32_t unitIntervalx4 = 0;
- uint32_t tempIDF = 0;
-
-
- assert_param(IS_DSI_PLL_NDIV(PLLInit->PLLNDIV));
- assert_param(IS_DSI_PLL_IDF(PLLInit->PLLIDF));
- assert_param(IS_DSI_PLL_ODF(PLLInit->PLLODF));
- assert_param(IS_DSI_AUTO_CLKLANE_CONTROL(DSI_InitStruct->AutomaticClockLaneControl));
- assert_param(IS_DSI_NUMBER_OF_LANES(DSI_InitStruct->NumberOfLanes));
-
-
-
-
- DSIx->WRPCR |= DSI_WRPCR_REGEN;
-
-
- while(DSI_GetFlagStatus(DSIx, DSI_FLAG_RRS) == RESET )
- {}
-
-
- DSIx->WRPCR &= ~(DSI_WRPCR_PLL_NDIV | DSI_WRPCR_PLL_IDF | DSI_WRPCR_PLL_ODF);
- DSIx->WRPCR |= (((PLLInit->PLLNDIV)<<2) | ((PLLInit->PLLIDF)<<11) | ((PLLInit->PLLODF)<<16));
-
-
- DSIx->WRPCR |= DSI_WRPCR_PLLEN;
-
-
- while(DSI_GetFlagStatus(DSIx, DSI_FLAG_PLLLS) == RESET)
- {}
-
-
-
-
- DSIx->PCTLR |= (DSI_PCTLR_CKE | DSI_PCTLR_DEN);
-
-
- DSIx->CLCR &= ~(DSI_CLCR_DPCC | DSI_CLCR_ACR);
- DSIx->CLCR |= (DSI_CLCR_DPCC | DSI_InitStruct->AutomaticClockLaneControl);
-
-
- DSIx->PCONFR &= ~DSI_PCONFR_NL;
- DSIx->PCONFR |= DSI_InitStruct->NumberOfLanes;
-
-
-
- DSIx->CCR &= ~DSI_CCR_TXECKDIV;
- DSIx->CCR = DSI_InitStruct->TXEscapeCkdiv;
-
-
-
-
- tempIDF = (PLLInit->PLLIDF > 0) ? PLLInit->PLLIDF : 1;
- unitIntervalx4 = (4000000 * tempIDF * (1 << PLLInit->PLLODF)) / ((HSE_VALUE/1000) * PLLInit->PLLNDIV);
-
-
- DSIx->WPCR[0] &= ~DSI_WPCR0_UIX4;
- DSIx->WPCR[0] |= unitIntervalx4;
-
-
-
- DSIx->IER[0] = 0;
- DSIx->IER[1] = 0;
- }
- void DSI_StructInit(DSI_InitTypeDef* DSI_InitStruct, DSI_HOST_TimeoutTypeDef* DSI_HOST_TimeoutInitStruct)
- {
-
-
- DSI_InitStruct->AutomaticClockLaneControl = DSI_AUTO_CLK_LANE_CTRL_DISABLE;
-
- DSI_InitStruct->NumberOfLanes = DSI_ONE_DATA_LANE;
-
- DSI_InitStruct->TXEscapeCkdiv = 0;
-
-
-
- DSI_HOST_TimeoutInitStruct->TimeoutCkdiv = 0;
-
- DSI_HOST_TimeoutInitStruct->HighSpeedTransmissionTimeout = 0;
-
- DSI_HOST_TimeoutInitStruct->LowPowerReceptionTimeout = 0;
-
- DSI_HOST_TimeoutInitStruct->HighSpeedReadTimeout = 0;
-
- DSI_HOST_TimeoutInitStruct->LowPowerReadTimeout = 0;
-
- DSI_HOST_TimeoutInitStruct->HighSpeedWriteTimeout = 0;
-
- DSI_HOST_TimeoutInitStruct->HighSpeedWritePrespMode = 0;
-
- DSI_HOST_TimeoutInitStruct->LowPowerWriteTimeout = 0;
-
- DSI_HOST_TimeoutInitStruct->BTATimeout = 0;
- }
- void DSI_SetGenericVCID(DSI_TypeDef *DSIx, uint32_t VirtualChannelID)
- {
-
- DSIx->GVCIDR &= ~DSI_GVCIDR_VCID;
- DSIx->GVCIDR |= VirtualChannelID;
- }
- void DSI_ConfigVideoMode(DSI_TypeDef *DSIx, DSI_VidCfgTypeDef *VidCfg)
- {
-
- assert_param(IS_DSI_COLOR_CODING(VidCfg->ColorCoding));
- assert_param(IS_DSI_VIDEO_MODE_TYPE(VidCfg->Mode));
- assert_param(IS_DSI_LP_COMMAND(VidCfg->LPCommandEnable));
- assert_param(IS_DSI_LP_HFP(VidCfg->LPHorizontalFrontPorchEnable));
- assert_param(IS_DSI_LP_HBP(VidCfg->LPHorizontalBackPorchEnable));
- assert_param(IS_DSI_LP_VACTIVE(VidCfg->LPVerticalActiveEnable));
- assert_param(IS_DSI_LP_VFP(VidCfg->LPVerticalFrontPorchEnable));
- assert_param(IS_DSI_LP_VBP(VidCfg->LPVerticalBackPorchEnable));
- assert_param(IS_DSI_LP_VSYNC(VidCfg->LPVerticalSyncActiveEnable));
- assert_param(IS_DSI_FBTAA(VidCfg->FrameBTAAcknowledgeEnable));
- assert_param(IS_DSI_DE_POLARITY(VidCfg->DEPolarity));
- assert_param(IS_DSI_VSYNC_POLARITY(VidCfg->VSPolarity));
- assert_param(IS_DSI_HSYNC_POLARITY(VidCfg->HSPolarity));
-
- if(VidCfg->ColorCoding == DSI_RGB666)
- {
- assert_param(IS_DSI_LOOSELY_PACKED(VidCfg->LooselyPacked));
- }
-
-
- DSIx->MCR &= ~DSI_MCR_CMDM;
- DSIx->WCFGR &= ~DSI_WCFGR_DSIM;
-
-
- DSIx->VMCR &= ~DSI_VMCR_VMT;
- DSIx->VMCR |= VidCfg->Mode;
-
-
- DSIx->VPCR &= ~DSI_VPCR_VPSIZE;
- DSIx->VPCR |= VidCfg->PacketSize;
-
-
- DSIx->VCCR &= ~DSI_VCCR_NUMC;
- DSIx->VCCR |= VidCfg->NumberOfChunks;
-
-
- DSIx->VNPCR &= ~DSI_VNPCR_NPSIZE;
- DSIx->VNPCR |= VidCfg->NullPacketSize;
-
-
- DSIx->LVCIDR &= ~DSI_LVCIDR_VCID;
- DSIx->LVCIDR |= VidCfg->VirtualChannelID;
-
-
- DSIx->LPCR &= ~(DSI_LPCR_DEP | DSI_LPCR_VSP | DSI_LPCR_HSP);
- DSIx->LPCR |= (VidCfg->DEPolarity | VidCfg->VSPolarity | VidCfg->HSPolarity);
-
-
- DSIx->LCOLCR &= ~DSI_LCOLCR_COLC;
- DSIx->LCOLCR |= VidCfg->ColorCoding;
-
-
- DSIx->WCFGR &= ~DSI_WCFGR_COLMUX;
- DSIx->WCFGR |= ((VidCfg->ColorCoding)<<1);
-
-
- if(VidCfg->ColorCoding == DSI_RGB666)
- {
- DSIx->LCOLCR &= ~DSI_LCOLCR_LPE;
- DSIx->LCOLCR |= VidCfg->LooselyPacked;
- }
-
-
- DSIx->VHSACR &= ~DSI_VHSACR_HSA;
- DSIx->VHSACR |= VidCfg->HorizontalSyncActive;
-
-
- DSIx->VHBPCR &= ~DSI_VHBPCR_HBP;
- DSIx->VHBPCR |= VidCfg->HorizontalBackPorch;
-
-
- DSIx->VLCR &= ~DSI_VLCR_HLINE;
- DSIx->VLCR |= VidCfg->HorizontalLine;
-
-
- DSIx->VVSACR &= ~DSI_VVSACR_VSA;
- DSIx->VVSACR |= VidCfg->VerticalSyncActive;
-
-
- DSIx->VVBPCR &= ~DSI_VVBPCR_VBP;
- DSIx->VVBPCR |= VidCfg->VerticalBackPorch;
-
-
- DSIx->VVFPCR &= ~DSI_VVFPCR_VFP;
- DSIx->VVFPCR |= VidCfg->VerticalFrontPorch;
-
-
- DSIx->VVACR &= ~DSI_VVACR_VA;
- DSIx->VVACR |= VidCfg->VerticalActive;
-
-
- DSIx->VMCR &= ~DSI_VMCR_LPCE;
- DSIx->VMCR |= VidCfg->LPCommandEnable;
-
-
- DSIx->LPMCR &= ~DSI_LPMCR_LPSIZE;
- DSIx->LPMCR |= ((VidCfg->LPLargestPacketSize)<<16);
-
-
- DSIx->LPMCR &= ~DSI_LPMCR_VLPSIZE;
- DSIx->LPMCR |= VidCfg->LPVACTLargestPacketSize;
-
-
- DSIx->VMCR &= ~DSI_VMCR_LPHFPE;
- DSIx->VMCR |= VidCfg->LPHorizontalFrontPorchEnable;
-
-
- DSIx->VMCR &= ~DSI_VMCR_LPHBPE;
- DSIx->VMCR |= VidCfg->LPHorizontalBackPorchEnable;
-
-
- DSIx->VMCR &= ~DSI_VMCR_LPVAE;
- DSIx->VMCR |= VidCfg->LPVerticalActiveEnable;
-
-
- DSIx->VMCR &= ~DSI_VMCR_LPVFPE;
- DSIx->VMCR |= VidCfg->LPVerticalFrontPorchEnable;
-
-
- DSIx->VMCR &= ~DSI_VMCR_LPVBPE;
- DSIx->VMCR |= VidCfg->LPVerticalBackPorchEnable;
-
-
- DSIx->VMCR &= ~DSI_VMCR_LPVSAE;
- DSIx->VMCR |= VidCfg->LPVerticalSyncActiveEnable;
-
-
- DSIx->VMCR &= ~DSI_VMCR_FBTAAE;
- DSIx->VMCR |= VidCfg->FrameBTAAcknowledgeEnable;
- }
- void DSI_ConfigAdaptedCommandMode(DSI_TypeDef *DSIx, DSI_CmdCfgTypeDef *CmdCfg)
- {
-
- assert_param(IS_DSI_COLOR_CODING(CmdCfg->ColorCoding));
- assert_param(IS_DSI_TE_SOURCE(CmdCfg->TearingEffectSource));
- assert_param(IS_DSI_TE_POLARITY(CmdCfg->TearingEffectPolarity));
- assert_param(IS_DSI_AUTOMATIC_REFRESH(CmdCfg->AutomaticRefresh));
- assert_param(IS_DSI_VS_POLARITY(CmdCfg->VSyncPol));
- assert_param(IS_DSI_TE_ACK_REQUEST(CmdCfg->TEAcknowledgeRequest));
- assert_param(IS_DSI_DE_POLARITY(CmdCfg->DEPolarity));
- assert_param(IS_DSI_VSYNC_POLARITY(CmdCfg->VSPolarity));
- assert_param(IS_DSI_HSYNC_POLARITY(CmdCfg->HSPolarity));
-
-
- DSIx->MCR |= DSI_MCR_CMDM;
- DSIx->WCFGR &= ~DSI_WCFGR_DSIM;
- DSIx->WCFGR |= DSI_WCFGR_DSIM;
-
-
- DSIx->LVCIDR &= ~DSI_LVCIDR_VCID;
- DSIx->LVCIDR |= CmdCfg->VirtualChannelID;
-
-
- DSIx->LPCR &= ~(DSI_LPCR_DEP | DSI_LPCR_VSP | DSI_LPCR_HSP);
- DSIx->LPCR |= (CmdCfg->DEPolarity | CmdCfg->VSPolarity | CmdCfg->HSPolarity);
-
-
- DSIx->LCOLCR &= ~DSI_LCOLCR_COLC;
- DSIx->LCOLCR |= CmdCfg->ColorCoding;
-
-
- DSIx->WCFGR &= ~DSI_WCFGR_COLMUX;
- DSIx->WCFGR |= ((CmdCfg->ColorCoding)<<1);
-
- DSIx->LCCR &= ~DSI_LCCR_CMDSIZE;
- DSIx->LCCR |= CmdCfg->CommandSize;
-
-
- DSIx->WCFGR &= ~(DSI_WCFGR_TESRC | DSI_WCFGR_TEPOL | DSI_WCFGR_AR | DSI_WCFGR_VSPOL);
- DSIx->WCFGR |= (CmdCfg->TearingEffectSource | CmdCfg->TearingEffectPolarity | CmdCfg->AutomaticRefresh | CmdCfg->VSyncPol);
-
-
- DSIx->CMCR &= ~DSI_CMCR_TEARE;
- DSIx->CMCR |= CmdCfg->TEAcknowledgeRequest;
-
-
- DSI_ITConfig(DSIx, DSI_IT_TE, ENABLE);
-
- DSI_ITConfig(DSIx, DSI_IT_ER, ENABLE);
- }
- void DSI_ConfigCommand(DSI_TypeDef *DSIx, DSI_LPCmdTypeDef *LPCmd)
- {
- assert_param(IS_DSI_LP_GSW0P(LPCmd->LPGenShortWriteNoP));
- assert_param(IS_DSI_LP_GSW1P(LPCmd->LPGenShortWriteOneP));
- assert_param(IS_DSI_LP_GSW2P(LPCmd->LPGenShortWriteTwoP));
- assert_param(IS_DSI_LP_GSR0P(LPCmd->LPGenShortReadNoP));
- assert_param(IS_DSI_LP_GSR1P(LPCmd->LPGenShortReadOneP));
- assert_param(IS_DSI_LP_GSR2P(LPCmd->LPGenShortReadTwoP));
- assert_param(IS_DSI_LP_GLW(LPCmd->LPGenLongWrite));
- assert_param(IS_DSI_LP_DSW0P(LPCmd->LPDcsShortWriteNoP));
- assert_param(IS_DSI_LP_DSW1P(LPCmd->LPDcsShortWriteOneP));
- assert_param(IS_DSI_LP_DSR0P(LPCmd->LPDcsShortReadNoP));
- assert_param(IS_DSI_LP_DLW(LPCmd->LPDcsLongWrite));
- assert_param(IS_DSI_LP_MRDP(LPCmd->LPMaxReadPacket));
- assert_param(IS_DSI_ACK_REQUEST(LPCmd->AcknowledgeRequest));
-
-
- DSIx->CMCR &= ~(DSI_CMCR_GSW0TX |\
- DSI_CMCR_GSW1TX |\
- DSI_CMCR_GSW2TX |\
- DSI_CMCR_GSR0TX |\
- DSI_CMCR_GSR1TX |\
- DSI_CMCR_GSR2TX |\
- DSI_CMCR_GLWTX |\
- DSI_CMCR_DSW0TX |\
- DSI_CMCR_DSW1TX |\
- DSI_CMCR_DSR0TX |\
- DSI_CMCR_DLWTX |\
- DSI_CMCR_MRDPS);
- DSIx->CMCR |= (LPCmd->LPGenShortWriteNoP |\
- LPCmd->LPGenShortWriteOneP |\
- LPCmd->LPGenShortWriteTwoP |\
- LPCmd->LPGenShortReadNoP |\
- LPCmd->LPGenShortReadOneP |\
- LPCmd->LPGenShortReadTwoP |\
- LPCmd->LPGenLongWrite |\
- LPCmd->LPDcsShortWriteNoP |\
- LPCmd->LPDcsShortWriteOneP |\
- LPCmd->LPDcsShortReadNoP |\
- LPCmd->LPDcsLongWrite |\
- LPCmd->LPMaxReadPacket);
-
-
- DSIx->CMCR &= ~DSI_CMCR_ARE;
- DSIx->CMCR |= LPCmd->AcknowledgeRequest;
- }
- void DSI_ConfigFlowControl(DSI_TypeDef *DSIx, uint32_t FlowControl)
- {
-
- assert_param(IS_DSI_FLOW_CONTROL(FlowControl));
-
-
- DSIx->PCR &= ~DSI_FLOW_CONTROL_ALL;
- DSIx->PCR |= FlowControl;
- }
- void DSI_ConfigPhyTimer(DSI_TypeDef *DSIx, DSI_PHY_TimerTypeDef *PhyTimers)
- {
- uint32_t maxTime = 0;
-
- maxTime = (PhyTimers->ClockLaneLP2HSTime > PhyTimers->ClockLaneHS2LPTime)? PhyTimers->ClockLaneLP2HSTime: PhyTimers->ClockLaneHS2LPTime;
-
-
- DSIx->CLTCR &= ~(DSI_CLTCR_LP2HS_TIME | DSI_CLTCR_HS2LP_TIME);
- DSIx->CLTCR |= (maxTime | ((maxTime)<<16));
-
-
- DSIx->DLTCR &= ~(DSI_DLTCR_MRD_TIME | DSI_DLTCR_LP2HS_TIME | DSI_DLTCR_HS2LP_TIME);
- DSIx->DLTCR |= (PhyTimers->DataLaneMaxReadTime | ((PhyTimers->DataLaneLP2HSTime)<<16) | ((PhyTimers->DataLaneHS2LPTime)<<24));
-
-
- DSIx->PCONFR &= ~DSI_PCONFR_SW_TIME;
- DSIx->PCONFR |= ((PhyTimers->StopWaitTime)<<8);
- }
- void DSI_ConfigHostTimeouts(DSI_TypeDef *DSIx, DSI_HOST_TimeoutTypeDef *HostTimeouts)
- {
-
- DSIx->CCR &= ~DSI_CCR_TOCKDIV;
- DSIx->CCR = ((HostTimeouts->TimeoutCkdiv)<<8);
-
-
- DSIx->TCCR[0] &= ~DSI_TCCR0_HSTX_TOCNT;
- DSIx->TCCR[0] |= ((HostTimeouts->HighSpeedTransmissionTimeout)<<16);
-
-
- DSIx->TCCR[0] &= ~DSI_TCCR0_LPRX_TOCNT;
- DSIx->TCCR[0] |= HostTimeouts->LowPowerReceptionTimeout;
-
-
- DSIx->TCCR[1] &= ~DSI_TCCR1_HSRD_TOCNT;
- DSIx->TCCR[1] |= HostTimeouts->HighSpeedReadTimeout;
-
-
- DSIx->TCCR[2] &= ~DSI_TCCR2_LPRD_TOCNT;
- DSIx->TCCR[2] |= HostTimeouts->LowPowerReadTimeout;
-
-
- DSIx->TCCR[3] &= ~DSI_TCCR3_HSWR_TOCNT;
- DSIx->TCCR[3] |= HostTimeouts->HighSpeedWriteTimeout;
-
-
- DSIx->TCCR[3] &= ~DSI_TCCR3_PM;
- DSIx->TCCR[3] |= HostTimeouts->HighSpeedWritePrespMode;
-
-
- DSIx->TCCR[4] &= ~DSI_TCCR4_LPWR_TOCNT;
- DSIx->TCCR[4] |= HostTimeouts->LowPowerWriteTimeout;
-
-
- DSIx->TCCR[5] &= ~DSI_TCCR5_BTA_TOCNT;
- DSIx->TCCR[5] |= HostTimeouts->BTATimeout;
- }
- void DSI_Start(DSI_TypeDef *DSIx)
- {
-
- DSIx->CR |= DSI_CR_EN;
-
- DSIx->WCR |= DSI_WCR_DSIEN;
- }
- void DSI_Stop(DSI_TypeDef *DSIx)
- {
-
- DSIx->CR &= ~DSI_CR_EN;
-
-
- DSIx->WCR &= ~DSI_WCR_DSIEN;
- }
- void DSI_Refresh(DSI_TypeDef *DSIx)
- {
-
- DSIx->WCR |= DSI_WCR_LTDCEN;
- }
- void DSI_ColorMode(DSI_TypeDef *DSIx, uint32_t ColorMode)
- {
-
- assert_param(IS_DSI_COLOR_MODE(ColorMode));
-
-
- DSIx->WCR &= ~DSI_WCR_COLM;
- DSIx->WCR |= ColorMode;
- }
- void DSI_Shutdown(DSI_TypeDef *DSIx, uint32_t Shutdown)
- {
-
- assert_param(IS_DSI_SHUT_DOWN(Shutdown));
-
-
- DSIx->WCR &= ~DSI_WCR_SHTDN;
- DSIx->WCR |= Shutdown;
- }
-
-
- void DSI_ShortWrite(DSI_TypeDef *DSIx,
- uint32_t ChannelID,
- uint32_t Mode,
- uint32_t Param1,
- uint32_t Param2)
- {
-
- assert_param(IS_DSI_SHORT_WRITE_PACKET_TYPE(Mode));
-
-
- while((DSIx->GPSR & DSI_GPSR_CMDFE) == 0)
- {}
-
-
- DSI_ConfigPacketHeader(DSIx,
- ChannelID,
- Mode,
- Param1,
- Param2);
- }
- void DSI_LongWrite(DSI_TypeDef *DSIx,
- uint32_t ChannelID,
- uint32_t Mode,
- uint32_t NbParams,
- uint32_t Param1,
- uint8_t* ParametersTable)
- {
- uint32_t uicounter = 0;
-
-
- assert_param(IS_DSI_LONG_WRITE_PACKET_TYPE(Mode));
-
-
- while((DSIx->GPSR & DSI_GPSR_CMDFE) == 0)
- {}
-
-
- while(uicounter < NbParams)
- {
- if(uicounter == 0x00)
- {
- DSIx->GPDR=(Param1 | \
- ((uint32_t)(*(ParametersTable+uicounter))<<8) | \
- ((uint32_t)(*(ParametersTable+uicounter+1))<<16) | \
- ((uint32_t)(*(ParametersTable+uicounter+2))<<24));
- uicounter += 3;
- }
- else
- {
- DSIx->GPDR=((*(ParametersTable+uicounter)) | \
- ((uint32_t)(*(ParametersTable+uicounter+1))<<8) | \
- ((uint32_t)(*(ParametersTable+uicounter+2))<<16) | \
- ((uint32_t)(*(ParametersTable+uicounter+3))<<24));
- uicounter+=4;
- }
- }
-
-
- DSI_ConfigPacketHeader(DSIx,
- ChannelID,
- Mode,
- ((NbParams+1)&0x00FF),
- (((NbParams+1)&0xFF00)>>8));
- }
- void DSI_Read(DSI_TypeDef *DSIx,
- uint32_t ChannelNbr,
- uint8_t* Array,
- uint32_t Size,
- uint32_t Mode,
- uint32_t DCSCmd,
- uint8_t* ParametersTable)
- {
-
-
- assert_param(IS_DSI_READ_PACKET_TYPE(Mode));
-
- if(Size > 2)
- {
-
- DSI_ShortWrite(DSIx, ChannelNbr, DSI_MAX_RETURN_PKT_SIZE, ((Size)&0xFF), (((Size)>>8)&0xFF));
- }
-
-
- if (Mode == DSI_DCS_SHORT_PKT_READ)
- {
- DSI_ConfigPacketHeader(DSIx, ChannelNbr, Mode, DCSCmd, 0);
- }
- else if (Mode == DSI_GEN_SHORT_PKT_READ_P0)
- {
- DSI_ConfigPacketHeader(DSIx, ChannelNbr, Mode, 0, 0);
- }
- else if (Mode == DSI_GEN_SHORT_PKT_READ_P1)
- {
- DSI_ConfigPacketHeader(DSIx, ChannelNbr, Mode, ParametersTable[0], 0);
- }
- else
- {
- DSI_ConfigPacketHeader(DSIx, ChannelNbr, Mode, ParametersTable[0], ParametersTable[1]);
- }
-
-
- while((DSIx->GPSR & DSI_GPSR_PRDFE) == DSI_GPSR_PRDFE)
- {}
-
-
- *((uint32_t *)Array) = (DSIx->GPDR);
- if (Size > 4)
- {
- Size -= 4;
- Array += 4;
- }
-
- while(((int)(Size)) > 0)
- {
- if((DSIx->GPSR & DSI_GPSR_PRDFE) == 0)
- {
- *((uint32_t *)Array) = (DSIx->GPDR);
- Size -= 4;
- Array += 4;
- }
- }
- }
- static void DSI_ConfigPacketHeader(DSI_TypeDef *DSIx,
- uint32_t ChannelID,
- uint32_t DataType,
- uint32_t Data0,
- uint32_t Data1)
- {
-
- DSIx->GHCR = (DataType | (ChannelID<<6) | (Data0<<8) | (Data1<<16));
- }
-
- void DSI_EnterULPMData(DSI_TypeDef *DSIx)
- {
-
- DSIx->PUCR |= DSI_PUCR_URDL;
-
-
-
- if((DSIx->PCONFR & DSI_PCONFR_NL) == DSI_ONE_DATA_LANE)
- {
- while((DSIx->PSR & DSI_PSR_UAN0) != 0)
- {}
- }
- else
- {
- while((DSIx->PSR & (DSI_PSR_UAN0 | DSI_PSR_UAN1)) != 0)
- {}
- }
- }
- void DSI_ExitULPMData(DSI_TypeDef *DSIx)
- {
-
- DSIx->PUCR |= DSI_PUCR_UEDL;
-
-
- if((DSIx->PCONFR & DSI_PCONFR_NL) == DSI_ONE_DATA_LANE)
- {
- while((DSIx->PSR & DSI_PSR_UAN0) != DSI_PSR_UAN0)
- {}
- }
- else
- {
- while((DSIx->PSR & (DSI_PSR_UAN0 | DSI_PSR_UAN1)) != (DSI_PSR_UAN0 | DSI_PSR_UAN1))
- {}
- }
-
-
- DSIx->PUCR = 0;
- }
- void DSI_EnterULPM(DSI_TypeDef *DSIx)
- {
-
- DSIx->CLCR &= ~DSI_CLCR_DPCC;
-
-
- RCC_DSIClockSourceConfig(RCC_DSICLKSource_PLLR);
-
-
- DSIx->PUCR |= (DSI_PUCR_URCL | DSI_PUCR_URDL);
-
-
- if((DSIx->PCONFR & DSI_PCONFR_NL) == DSI_ONE_DATA_LANE)
- {
- while((DSIx->PSR & (DSI_PSR_UAN0 | DSI_PSR_UANC)) != 0)
- {}
- }
- else
- {
- while((DSIx->PSR & (DSI_PSR_UAN0 | DSI_PSR_UAN1 | DSI_PSR_UANC)) != 0)
- {}
- }
-
-
- DSIx->WRPCR &= ~DSI_WRPCR_PLLEN;
- }
- void DSI_ExitULPM(DSI_TypeDef *DSIx)
- {
-
- DSIx->WRPCR |= DSI_WRPCR_PLLEN;
-
-
- while(DSI_GetFlagStatus(DSIx, DSI_FLAG_PLLLS) == RESET)
- {}
-
-
- DSIx->PUCR |= (DSI_PUCR_UECL | DSI_PUCR_UEDL);
-
-
- if((DSIx->PCONFR & DSI_PCONFR_NL) == DSI_ONE_DATA_LANE)
- {
- while((DSIx->PSR & (DSI_PSR_UAN0 | DSI_PSR_UANC)) != (DSI_PSR_UAN0 | DSI_PSR_UANC))
- {}
- }
- else
- {
- while((DSIx->PSR & (DSI_PSR_UAN0 | DSI_PSR_UAN1 | DSI_PSR_UANC)) != (DSI_PSR_UAN0 | DSI_PSR_UAN1 | DSI_PSR_UANC))
- {}
- }
-
-
- DSIx->PUCR = 0;
-
-
- RCC_DSIClockSourceConfig(RCC_DSICLKSource_PHY);
-
-
- DSIx->CLCR |= DSI_CLCR_DPCC;
- }
- void DSI_PatternGeneratorStart(DSI_TypeDef *DSIx, uint32_t Mode, uint32_t Orientation)
- {
-
-
- DSIx->VMCR &= ~(DSI_VMCR_PGM | DSI_VMCR_PGO);
- DSIx->VMCR |= ((Mode<<20) | (Orientation<<24));
-
-
- DSIx->VMCR |= DSI_VMCR_PGE;
-
- }
- void DSI_PatternGeneratorStop(DSI_TypeDef *DSIx)
- {
-
- DSIx->VMCR &= ~DSI_VMCR_PGE;
- }
- void DSI_SetSlewRateAndDelayTuning(DSI_TypeDef *DSIx, uint32_t CommDelay, uint32_t Lane, uint32_t Value)
- {
-
- assert_param(IS_DSI_COMMUNICATION_DELAY(CommDelay));
- assert_param(IS_DSI_LANE_GROUP(Lane));
-
- switch(CommDelay)
- {
- case DSI_SLEW_RATE_HSTX:
- if(Lane == DSI_CLOCK_LANE)
- {
-
- DSIx->WPCR[1] &= ~DSI_WPCR1_HSTXSRCCL;
- DSIx->WPCR[1] |= Value<<16;
- }
- else
- {
-
- DSIx->WPCR[1] &= ~DSI_WPCR1_HSTXSRCDL;
- DSIx->WPCR[1] |= Value<<18;
- }
- break;
- case DSI_SLEW_RATE_LPTX:
- if(Lane == DSI_CLOCK_LANE)
- {
-
- DSIx->WPCR[1] &= ~DSI_WPCR1_LPSRCCL;
- DSIx->WPCR[1] |= Value<<6;
- }
- else
- {
-
- DSIx->WPCR[1] &= ~DSI_WPCR1_LPSRCDL;
- DSIx->WPCR[1] |= Value<<8;
- }
- break;
- case DSI_HS_DELAY:
- if(Lane == DSI_CLOCK_LANE)
- {
-
- DSIx->WPCR[1] &= ~DSI_WPCR1_HSTXDCL;
- DSIx->WPCR[1] |= Value;
- }
- else
- {
-
- DSIx->WPCR[1] &= ~DSI_WPCR1_HSTXDDL;
- DSIx->WPCR[1] |= Value<<2;
- }
- break;
- default:
- break;
- }
- }
- void DSI_SetLowPowerRXFilter(DSI_TypeDef *DSIx, uint32_t Frequency)
- {
-
- DSIx->WPCR[1] &= ~DSI_WPCR1_LPRXFT;
- DSIx->WPCR[1] |= Frequency<<25;
- }
- void DSI_SetSDD(DSI_TypeDef *DSIx, FunctionalState State)
- {
-
- assert_param(IS_FUNCTIONAL_STATE(State));
-
-
- DSIx->WPCR[1] &= ~DSI_WPCR1_SDDC;
- DSIx->WPCR[1] |= ((uint32_t)State<<12);
- }
- void DSI_SetLanePinsConfiguration(DSI_TypeDef *DSIx, uint32_t CustomLane, uint32_t Lane, FunctionalState State)
- {
-
- assert_param(IS_DSI_CUSTOM_LANE(CustomLane));
- assert_param(IS_DSI_LANE(Lane));
- assert_param(IS_FUNCTIONAL_STATE(State));
-
- switch(CustomLane)
- {
- case DSI_SWAP_LANE_PINS:
- if(Lane == DSI_CLOCK_LANE)
- {
-
- DSIx->WPCR[0] &= ~DSI_WPCR0_SWCL;
- DSIx->WPCR[0] |= ((uint32_t)State<<6);
- }
- else if(Lane == DSI_DATA_LANE0)
- {
-
- DSIx->WPCR[0] &= ~DSI_WPCR0_SWDL0;
- DSIx->WPCR[0] |= ((uint32_t)State<<7);
- }
- else
- {
-
- DSIx->WPCR[0] &= ~DSI_WPCR0_SWDL1;
- DSIx->WPCR[0] |= ((uint32_t)State<<8);
- }
- break;
- case DSI_INVERT_HS_SIGNAL:
- if(Lane == DSI_CLOCK_LANE)
- {
-
- DSIx->WPCR[0] &= ~DSI_WPCR0_HSICL;
- DSIx->WPCR[0] |= ((uint32_t)State<<9);
- }
- else if(Lane == DSI_DATA_LANE0)
- {
-
- DSIx->WPCR[0] &= ~DSI_WPCR0_HSIDL0;
- DSIx->WPCR[0] |= ((uint32_t)State<<10);
- }
- else
- {
-
- DSIx->WPCR[0] &= ~DSI_WPCR0_HSIDL1;
- DSIx->WPCR[0] |= ((uint32_t)State<<11);
- }
- break;
- default:
- break;
- }
- }
- void DSI_SetPHYTimings(DSI_TypeDef *DSIx, uint32_t Timing, FunctionalState State, uint32_t Value)
- {
-
- assert_param(IS_DSI_PHY_TIMING(Timing));
- assert_param(IS_FUNCTIONAL_STATE(State));
-
- switch(Timing)
- {
- case DSI_TCLK_POST:
-
- DSIx->WPCR[0] &= ~DSI_WPCR0_TCLKPOSTEN;
- DSIx->WPCR[0] |= ((uint32_t)State<<27);
-
- if(State)
- {
-
- DSIx->WPCR[4] &= ~DSI_WPCR4_TCLKPOST;
- DSIx->WPCR[4] |= Value;
- }
-
- break;
- case DSI_TLPX_CLK:
-
- DSIx->WPCR[0] &= ~DSI_WPCR0_TLPXCEN;
- DSIx->WPCR[0] |= ((uint32_t)State<<26);
-
- if(State)
- {
-
- DSIx->WPCR[3] &= ~DSI_WPCR3_TLPXC;
- DSIx->WPCR[3] |= Value;
- }
-
- break;
- case DSI_THS_EXIT:
-
- DSIx->WPCR[0] &= ~DSI_WPCR0_THSEXITEN;
- DSIx->WPCR[0] |= ((uint32_t)State<<25);
-
- if(State)
- {
-
- DSIx->WPCR[3] &= ~DSI_WPCR3_THSEXIT;
- DSIx->WPCR[3] |= Value;
- }
-
- break;
- case DSI_TLPX_DATA:
-
- DSIx->WPCR[0] &= ~DSI_WPCR0_TLPXDEN;
- DSIx->WPCR[0] |= ((uint32_t)State<<24);
-
- if(State)
- {
-
- DSIx->WPCR[3] &= ~DSI_WPCR3_TLPXD;
- DSIx->WPCR[3] |= Value;
- }
-
- break;
- case DSI_THS_ZERO:
-
- DSIx->WPCR[0] &= ~DSI_WPCR0_THSZEROEN;
- DSIx->WPCR[0] |= ((uint32_t)State<<23);
-
- if(State)
- {
-
- DSIx->WPCR[3] &= ~DSI_WPCR3_THSZERO;
- DSIx->WPCR[3] |= Value;
- }
-
- break;
- case DSI_THS_TRAIL:
-
- DSIx->WPCR[0] &= ~DSI_WPCR0_THSTRAILEN;
- DSIx->WPCR[0] |= ((uint32_t)State<<22);
-
- if(State)
- {
-
- DSIx->WPCR[2] &= ~DSI_WPCR2_THSTRAIL;
- DSIx->WPCR[2] |= Value;
- }
-
- break;
- case DSI_THS_PREPARE:
-
- DSIx->WPCR[0] &= ~DSI_WPCR0_THSPREPEN;
- DSIx->WPCR[0] |= ((uint32_t)State<<21);
-
- if(State)
- {
-
- DSIx->WPCR[2] &= ~DSI_WPCR2_THSPREP;
- DSIx->WPCR[2] |= Value;
- }
-
- break;
- case DSI_TCLK_ZERO:
-
- DSIx->WPCR[0] &= ~DSI_WPCR0_TCLKZEROEN;
- DSIx->WPCR[0] |= ((uint32_t)State<<20);
-
- if(State)
- {
-
- DSIx->WPCR[2] &= ~DSI_WPCR2_TCLKZERO;
- DSIx->WPCR[2] |= Value;
- }
-
- break;
- case DSI_TCLK_PREPARE:
-
- DSIx->WPCR[0] &= ~DSI_WPCR0_TCLKPREPEN;
- DSIx->WPCR[0] |= ((uint32_t)State<<19);
-
- if(State)
- {
-
- DSIx->WPCR[2] &= ~DSI_WPCR2_TCLKPREP;
- DSIx->WPCR[2] |= Value;
- }
-
- break;
- default:
- break;
- }
- }
- void DSI_ForceTXStopMode(DSI_TypeDef *DSIx, uint32_t Lane, FunctionalState State)
- {
-
- assert_param(IS_DSI_LANE_GROUP(Lane));
- assert_param(IS_FUNCTIONAL_STATE(State));
-
- if(Lane == DSI_CLOCK_LANE)
- {
-
- DSIx->WPCR[0] &= ~DSI_WPCR0_FTXSMCL;
- DSIx->WPCR[0] |= ((uint32_t)State<<12);
- }
- else
- {
-
- DSIx->WPCR[0] &= ~DSI_WPCR0_FTXSMDL;
- DSIx->WPCR[0] |= ((uint32_t)State<<13);
- }
- }
- void DSI_ForceRXLowPower(DSI_TypeDef *DSIx, FunctionalState State)
- {
-
- assert_param(IS_FUNCTIONAL_STATE(State));
-
-
- DSIx->WPCR[1] &= ~DSI_WPCR1_FLPRXLPM;
- DSIx->WPCR[1] |= ((uint32_t)State<<22);
- }
- void DSI_ForceDataLanesInRX(DSI_TypeDef *DSIx, FunctionalState State)
- {
-
- assert_param(IS_FUNCTIONAL_STATE(State));
-
-
- DSIx->WPCR[0] &= ~DSI_WPCR0_TDDL;
- DSIx->WPCR[0] |= ((uint32_t)State<<16);
- }
- void DSI_SetPullDown(DSI_TypeDef *DSIx, FunctionalState State)
- {
-
- assert_param(IS_FUNCTIONAL_STATE(State));
-
-
- DSIx->WPCR[0] &= ~DSI_WPCR0_PDEN;
- DSIx->WPCR[0] |= ((uint32_t)State<<18);
- }
- void DSI_SetContentionDetectionOff(DSI_TypeDef *DSIx, FunctionalState State)
- {
-
- assert_param(IS_FUNCTIONAL_STATE(State));
-
-
- DSIx->WPCR[0] &= ~DSI_WPCR0_CDOFFDL;
- DSIx->WPCR[0] |= ((uint32_t)State<<14);
- }
- void DSI_ITConfig(DSI_TypeDef* DSIx, uint32_t DSI_IT, FunctionalState NewState)
- {
-
- assert_param(IS_DSI_ALL_PERIPH(DSIx));
- assert_param(IS_FUNCTIONAL_STATE(NewState));
- assert_param(IS_DSI_IT(DSI_IT));
- if(NewState != DISABLE)
- {
-
- DSIx->WIER |= DSI_IT;
- }
- else
- {
-
- DSIx->WIER &= ~DSI_IT;
- }
- }
- FlagStatus DSI_GetFlagStatus(DSI_TypeDef* DSIx, uint16_t DSI_FLAG)
- {
- FlagStatus bitstatus = RESET;
-
- assert_param(IS_DSI_ALL_PERIPH(DSIx));
- assert_param(IS_DSI_GET_FLAG(DSI_FLAG));
-
-
- if((DSIx->WISR & DSI_FLAG) != (uint32_t)RESET)
- {
-
- bitstatus = SET;
- }
- else
- {
-
- bitstatus = RESET;
- }
-
- return bitstatus;
- }
- void DSI_ClearFlag(DSI_TypeDef* DSIx, uint16_t DSI_FLAG)
- {
-
- assert_param(IS_DSI_ALL_PERIPH(DSIx));
- assert_param(IS_DSI_CLEAR_FLAG(DSI_FLAG));
-
-
- DSIx->WIFCR = (uint32_t)DSI_FLAG;
- }
- ITStatus DSI_GetITStatus(DSI_TypeDef* DSIx, uint32_t DSI_IT)
- {
- ITStatus bitstatus = RESET;
- uint32_t enablestatus = 0;
-
- assert_param(IS_DSI_ALL_PERIPH(DSIx));
- assert_param(IS_DSI_IT(DSI_IT));
-
- enablestatus = (DSIx->WIER & DSI_IT);
-
- if (((DSIx->WISR & DSI_IT) != (uint32_t)RESET) && enablestatus)
- {
-
- bitstatus = SET;
- }
- else
- {
-
- bitstatus = RESET;
- }
-
-
- return bitstatus;
- }
- void DSI_ClearITPendingBit(DSI_TypeDef* DSIx, uint32_t DSI_IT)
- {
-
- assert_param(IS_DSI_ALL_PERIPH(DSIx));
- assert_param(IS_DSI_IT(DSI_IT));
-
- DSIx->WIFCR = (uint32_t)DSI_IT;
- }
- void DSI_ConfigErrorMonitor(DSI_TypeDef *DSIx, uint32_t ActiveErrors)
- {
- DSIx->IER[0] = 0;
- DSIx->IER[1] = 0;
-
- if((ActiveErrors & DSI_ERROR_ACK) != RESET)
- {
-
- DSIx->IER[0] |= DSI_ERROR_ACK_MASK;
- }
-
- if((ActiveErrors & DSI_ERROR_PHY) != RESET)
- {
-
- DSIx->IER[0] |= DSI_ERROR_PHY_MASK;
- }
-
- if((ActiveErrors & DSI_ERROR_TX) != RESET)
- {
-
- DSIx->IER[1] |= DSI_ERROR_TX_MASK;
- }
-
- if((ActiveErrors & DSI_ERROR_RX) != RESET)
- {
-
- DSIx->IER[1] |= DSI_ERROR_RX_MASK;
- }
-
- if((ActiveErrors & DSI_ERROR_ECC) != RESET)
- {
-
- DSIx->IER[1] |= DSI_ERROR_ECC_MASK;
- }
-
- if((ActiveErrors & DSI_ERROR_CRC) != RESET)
- {
-
- DSIx->IER[1] |= DSI_ERROR_CRC_MASK;
- }
-
- if((ActiveErrors & DSI_ERROR_PSE) != RESET)
- {
-
- DSIx->IER[1] |= DSI_ERROR_PSE_MASK;
- }
-
- if((ActiveErrors & DSI_ERROR_EOT) != RESET)
- {
-
- DSIx->IER[1] |= DSI_ERROR_EOT_MASK;
- }
-
- if((ActiveErrors & DSI_ERROR_OVF) != RESET)
- {
-
- DSIx->IER[1] |= DSI_ERROR_OVF_MASK;
- }
-
- if((ActiveErrors & DSI_ERROR_GEN) != RESET)
- {
-
- DSIx->IER[1] |= DSI_ERROR_GEN_MASK;
- }
- }
- #endif
|