123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511 |
- /**
- ******************************************************************************
- * @file tae32f53xx_ll_i2c.h
- * @author MCD Application Team
- * @brief Header file for I2C LL module.
- *
- ******************************************************************************
- * @attention
- *
- * <h2><center>© Copyright (c) 2020 Tai-Action.
- * All rights reserved.</center></h2>
- *
- * This software is licensed by Tai-Action under BSD 3-Clause license,
- * the "License"; You may not use this file except in compliance with the
- * License. You may obtain a copy of the License at:
- * opensource.org/licenses/BSD-3-Clause
- *
- ******************************************************************************
- */
- /* Define to prevent recursive inclusion -------------------------------------*/
- #ifndef _TMF5XXX_LL_I2C_H_
- #define _TMF5XXX_LL_I2C_H_
- #ifdef __cplusplus
- extern "C" {
- #endif /* __cplusplus */
- /* Includes ------------------------------------------------------------------*/
- #include "tae32f53xx_ll_def.h"
- #ifdef LL_DMA_MODULE_ENABLED
- #include "tae32f53xx_ll_dma.h"
- #endif
- /** @addtogroup TAE32F53xx_LL_Driver
- * @{
- */
- /** @addtogroup I2C_LL
- * @{
- */
- /* Exported constants --------------------------------------------------------*/
- /** @defgroup I2C_LL_Exported_Constants I2C LL Exported Constants
- * @brief I2C LL Exported Constants
- * @{
- */
- /**
- * @brief I2C SS SPEED Max Macro Define
- */
- #define I2C_SS_SPEED_MAX (100000UL)
- /**
- * @brief I2C FS SPEED Max Macro Define
- */
- #define I2C_FS_SPEED_MAX (400000UL)
- /**
- * @brief I2C FS PLUS SPEED Max Macro Define
- */
- #define I2C_FS_PLUS_SPEED_MAX (1000000UL)
- /**
- * @brief I2C HS SPEED Max Macro Define
- */
- #define I2C_HS_SPEED_MAX (3400000UL)
- /**
- * @brief I2C FIFO Depth Define
- */
- #define I2C_FIFO_DEPTH (16)
- /**
- * @}
- */
- /* Exported macro ------------------------------------------------------------*/
- /** @defgroup I2C_LL_Exported_Macros I2C LL Exported Macros
- * @brief I2C LL Exported Macros
- * @{
- */
- /**
- * @brief I2C SMBUS Persistant Slave Address Enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_SlvPersistant_En(__I2C__) SET_BIT((__I2C__)->CON, I2C_SMBUS_PST_SLV_ADDR_EN_Msk)
- /**
- * @brief I2C SMBUS Persistant Slave Address Disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_SlvPersistant_Dis(__I2C__) CLEAR_BIT((__I2C__)->CON, I2C_SMBUS_PST_SLV_ADDR_EN_Msk)
- /**
- * @brief I2C SMBUS ARP Enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_ARP_En(__I2C__) SET_BIT((__I2C__)->CON, I2C_SMBUS_ARP_EN_Msk)
- /**
- * @brief I2C SMBUS ARP Disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_ARP_Dis(__I2C__) CLEAR_BIT((__I2C__)->CON, I2C_SMBUS_ARP_EN_Msk)
- /**
- * @brief I2C SMBUS Slave Quick Cmd Enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_SlvQuickCmd_En(__I2C__) SET_BIT((__I2C__)->CON, I2C_SMBUS_SLV_QUICK_CMD_EN_Msk)
- /**
- * @brief I2C SMBUS Slave Quick Cmd Disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_SlvQuickCmd_Dis(__I2C__) CLEAR_BIT((__I2C__)->CON, I2C_SMBUS_SLV_QUICK_CMD_EN_Msk)
- /**
- * @brief I2C Optional SAR Control Set
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_OptionalSarCtrl_Set(__I2C__) SET_BIT((__I2C__)->CON, I2C_OPTIONAL_SAR_CTRL_Msk)
- /**
- * @brief I2C Master Bus Clear Feature Enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_MST_BusClrFeature_En(__I2C__) SET_BIT((__I2C__)->CON, I2C_BUS_CLEAR_FEATURE_CTRL_Msk)
- /**
- * @brief I2C Master Bus Clear Feature Disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_MST_BusClrFeature_Dis(__I2C__) CLEAR_BIT((__I2C__)->CON, I2C_BUS_CLEAR_FEATURE_CTRL_Msk)
- /**
- * @brief I2C Stop Detect If Master Active Set
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_MST_StopDetIfActive_Set(__I2C__) SET_BIT((__I2C__)->CON, I2C_STOP_DET_IF_MASTER_ACT_Msk)
- /**
- * @brief I2C Stop Detect If Master Active Clear
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_MST_StopDetIfActive_Clr(__I2C__) CLEAR_BIT((__I2C__)->CON, I2C_STOP_DET_IF_MASTER_ACT_Msk)
- /**
- * @brief I2C RX FIFO Full Hold Enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_RxFIFOFullHold_En(__I2C__) SET_BIT((__I2C__)->CON, I2C_RX_FIFO_FULL_HLD_CTRL_Msk)
- /**
- * @brief I2C RX FIFO Full Hold Disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_RxFIFOFullHold_Dis(__I2C__) CLEAR_BIT((__I2C__)->CON, I2C_RX_FIFO_FULL_HLD_CTRL_Msk)
- /**
- * @brief I2C TX Empty Control Set
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_TxEmptyCtrl_Set(__I2C__) SET_BIT((__I2C__)->CON, I2C_TX_EMPTY_CTRL_Msk)
- /**
- * @brief I2C TX Empty Control Clear
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_TxEmptyCtrl_Clr(__I2C__) CLEAR_BIT((__I2C__)->CON, I2C_TX_EMPTY_CTRL_Msk)
- /**
- * @brief I2C Slave Stop Detect If Addressed Set
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SLV_StopDetIfAddressed_Set(__I2C__) SET_BIT((__I2C__)->CON, I2C_STOP_DET_IFADDRESSED_Msk)
- /**
- * @brief I2C Slave Stop Detect If Addressed Clear
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SLV_StopDetIfAddressed_Clr(__I2C__) CLEAR_BIT((__I2C__)->CON, I2C_STOP_DET_IFADDRESSED_Msk)
- /**
- * @brief I2C Slave Mode Enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SLAVE_Mode_En(__I2C__) CLEAR_BIT((__I2C__)->CON, I2C_SLAVE_DISABLE_Msk)
- /**
- * @brief I2C Slave Mode Disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SLAVE_Mode_Dis(__I2C__) SET_BIT((__I2C__)->CON, I2C_SLAVE_DISABLE_Msk)
- /**
- * @brief I2C Master Restart Enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_MST_Restart_En(__I2C__) SET_BIT((__I2C__)->CON, I2C_RESTART_EN_Msk)
- /**
- * @brief I2C Master Restart Disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_MST_Restart_Dis(__I2C__) CLEAR_BIT((__I2C__)->CON, I2C_RESTART_EN_Msk)
- /**
- * @brief I2C Master 7bit Address Mode Set
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_MST_7bAddr_Set(__I2C__) CLEAR_BIT((__I2C__)->CON, I2C_10BITADDR_MASTER_Msk)
- /**
- * @brief I2C Master 10bit Address Mode Set
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_MST_10bAddr_Set(__I2C__) SET_BIT((__I2C__)->CON, I2C_10BITADDR_MASTER_Msk)
- /**
- * @brief I2C Slave 7bit Address Mode Set
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SLV_7bAddr_Set(__I2C__) CLEAR_BIT((__I2C__)->CON, I2C_10BITADDR_SLAVE_Msk)
- /**
- * @brief I2C Slave 10bit Address Mode Set
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SLV_10bAddr_Set(__I2C__) SET_BIT((__I2C__)->CON, I2C_10BITADDR_SLAVE_Msk)
- /**
- * @brief I2C Speed Set
- * @param __I2C__ Specifies I2C peripheral
- * @param speed I2C Speed
- * @return None
- */
- #define __LL_I2C_Speed_Set(__I2C__, speed) MODIFY_REG((__I2C__)->CON, I2C_SPEED_Msk, speed)
- /**
- * @brief I2C Master Mode Enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_MASTER_Mode_En(__I2C__) SET_BIT((__I2C__)->CON, I2C_MASTER_MODE_Msk)
- /**
- * @brief I2C Master Mode Disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_MASTER_Mode_Dis(__I2C__) CLEAR_BIT((__I2C__)->CON, I2C_MASTER_MODE_Msk)
- /**
- * @brief I2C Master Mode is Enable or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 I2C isn't Master Mode
- * @retval 1 I2C is Master Mode
- */
- #define __LL_I2C_IsMasterMode(__I2C__) READ_BIT((__I2C__)->CON, I2C_MASTER_MODE_Msk)
- /**
- * @brief I2C TAR SMBUD Quick Cmd Set
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_TAR_SmbusQuickCmd_Set(__I2C__) SET_BIT((__I2C__)->TAR, I2C_SMBUS_QUICK_CMD_Msk)
- /**
- * @brief I2C TAR SMBUD Quick Cmd Clear
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_TAR_SmbusQuickCmd_Clr(__I2C__) CLEAR_BIT((__I2C__)->TAR, I2C_SMBUS_QUICK_CMD_Msk)
- /**
- * @brief I2C TAR Device ID Set
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_TAR_DevID_Set(__I2C__) SET_BIT((__I2C__)->TAR, I2C_TAR_DEV_ID_Msk)
- /**
- * @brief I2C TAR Device ID Clear
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_TAR_DevID_Clr(__I2C__) CLEAR_BIT((__I2C__)->TAR, I2C_TAR_DEV_ID_Msk)
- /**
- * @brief I2C TAR Master 7bit Address Set
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_TAR_MST_7bAddr_Set(__I2C__) CLEAR_BIT((__I2C__)->TAR, I2C_TAR_10BITADDR_MASTER_Msk)
- /**
- * @brief I2C TAR Master 10bit Address Set
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_TAR_MST_10bAddr_Set(__I2C__) SET_BIT((__I2C__)->TAR, I2C_TAR_10BITADDR_MASTER_Msk)
- /**
- * @brief I2C TAR Special Set
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_TAR_Special_Set(__I2C__) SET_BIT((__I2C__)->TAR, I2C_SPECIAL_Msk)
- /**
- * @brief I2C TAR Special Clear
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_TAR_Special_Clr(__I2C__) CLEAR_BIT((__I2C__)->TAR, I2C_SPECIAL_Msk)
- /**
- * @brief I2C TAR GC OR Start Set
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_TAR_GcOrStart_Set(__I2C__) SET_BIT((__I2C__)->TAR, I2C_GC_OR_START_Msk)
- /**
- * @brief I2C TAR GC OR Start Clear
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_TAR_GcOrStart_Clr(__I2C__) CLEAR_BIT((__I2C__)->TAR, I2C_GC_OR_START_Msk)
- /**
- * @brief I2C Master TAR Set
- * @param __I2C__ Specifies I2C peripheral
- * @param tar I2C Master TAR
- * @return None
- */
- #define __LL_I2C_TAR_Set(__I2C__, tar) MODIFY_REG((__I2C__)->TAR, I2C_TAR_Msk, ((tar & 0x3ffUL) << I2C_TAR_Pos))
- /**
- * @brief I2C Slave SAR Set
- * @param __I2C__ Specifies I2C peripheral
- * @param tar I2C Slave SAR
- * @return None
- */
- #define __LL_I2C_SAR_Set(__I2C__, sar) MODIFY_REG((__I2C__)->SAR, I2C_SAR_Msk, ((sar & 0x3ffUL) << I2C_SAR_Pos))
- /**
- * @brief Judge Is First Data Byte or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Isn't first data byte
- * @retval 1 Is first data byte
- */
- #define __LL_I2C_IsFirstDataByte(__I2C__) (READ_BIT((__I2C__)->DCMD, I2C_FIRST_DATA_BYTE_Msk) >> I2C_FIRST_DATA_BYTE_Pos)
- /**
- * @brief I2C Restart Set
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_Restart_Set(__I2C__) SET_BIT((__I2C__)->DCMD, I2C_RESTART_Msk)
- /**
- * @brief I2C Restart Clear
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_Restart_Clr(__I2C__) CLEAR_BIT((__I2C__)->DCMD, I2C_RESTART_Msk)
- /**
- * @brief I2C Stop Set
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_Stop_Set(__I2C__) SET_BIT((__I2C__)->DCMD, I2C_STOP_Msk)
- /**
- * @brief I2C Stop Clear
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_Stop_Clr(__I2C__) CLEAR_BIT((__I2C__)->DCMD, I2C_STOP_Msk)
- /**
- * @brief I2C Master Cmd Read Set
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_MST_CmdRead_Set(__I2C__) SET_BIT((__I2C__)->DCMD, I2C_CMD_Msk)
- /**
- * @brief I2C Master Cmd Write Set
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_MST_CmdWrite_Set(__I2C__) CLEAR_BIT((__I2C__)->DCMD, I2C_CMD_Msk)
- /**
- * @brief I2C Data Write
- * @param __I2C__ Specifies I2C peripheral
- * @param dat data to write
- * @return None
- */
- #define __LL_I2C_DAT_Write(__I2C__, dat) MODIFY_REG((__I2C__)->DCMD, I2C_DAT_Msk, (((dat) & 0xffUL) << I2C_DAT_Pos))
- /**
- * @brief I2C Data Read
- * @param __I2C__ Specifies I2C peripheral
- * @return read data
- */
- #define __LL_I2C_DAT_Read(__I2C__) (READ_BIT((__I2C__)->DCMD, I2C_DAT_Msk) >> I2C_DAT_Pos)
- /**
- * @brief I2C timing start and send 8b address
- * @param __I2C__ Specifies I2C peripheral
- * @param addr_8b 8b address
- * @return None
- */
- #define __LL_I2C_Timing_RestartAddr8b(__I2C__, addr_8b) \
- do { \
- WRITE_REG((__I2C__)->DCMD, I2C_RESTART_Msk | ((addr_8b & 0xffUL) << I2C_DAT_Pos)); \
- } while(0)
- /**
- * @brief I2C timing restart and send 16b address
- * @param __I2C__ Specifies I2C peripheral
- * @param addr_16b 16b address
- * @return None
- */
- #define __LL_I2C_Timing_RestartAddr16b(__I2C__, addr_16b) \
- do { \
- WRITE_REG((__I2C__)->DCMD, I2C_RESTART_Msk | (((addr_16b >> 8) & 0xffUL) << I2C_DAT_Pos)); \
- WRITE_REG((__I2C__)->DCMD, ((addr_16b & 0xffUL) << I2C_DAT_Pos)); \
- } while(0)
- /**
- * @brief I2C timing restart and send 32b address
- * @param __I2C__ Specifies I2C peripheral
- * @param addr_32b 32b address
- * @return None
- */
- #define __LL_I2C_Timing_RestartAddr32b(__I2C__, addr_32b) \
- do { \
- WRITE_REG((__I2C__)->DCMD, I2C_RESTART_Msk | (((addr_32b >> 24) & 0xffUL) << I2C_DAT_Pos)); \
- WRITE_REG((__I2C__)->DCMD, (((addr_32b >> 16) & 0xffUL) << I2C_DAT_Pos)); \
- WRITE_REG((__I2C__)->DCMD, (((addr_32b >> 8) & 0xffUL) << I2C_DAT_Pos)); \
- WRITE_REG((__I2C__)->DCMD, ((addr_32b & 0xffUL) << I2C_DAT_Pos)); \
- } while(0)
- /**
- * @brief I2C timing restart read stop
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_Timing_RestartReadStop(__I2C__) \
- do { \
- WRITE_REG((__I2C__)->DCMD, I2C_RESTART_Msk | I2C_CMD_READ | I2C_STOP_Msk); \
- } while(0)
- /**
- * @brief I2C timing restart read
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_Timing_RestartRead(__I2C__) \
- do { \
- WRITE_REG((__I2C__)->DCMD, I2C_RESTART_Msk | I2C_CMD_READ); \
- } while(0)
- /**
- * @brief I2C timing read
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_Timing_Read(__I2C__) \
- do { \
- WRITE_REG((__I2C__)->DCMD, I2C_CMD_READ); \
- } while(0)
- /**
- * @brief I2C timing read stop
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_Timing_ReadStop(__I2C__) \
- do { \
- WRITE_REG((__I2C__)->DCMD, I2C_CMD_READ | I2C_STOP_Msk); \
- } while(0)
- /**
- * @brief I2C timing write
- * @param __I2C__ Specifies I2C peripheral
- * @param dat write data
- * @return None
- */
- #define __LL_I2C_Timing_Write(__I2C__, dat) \
- do { \
- WRITE_REG((__I2C__)->DCMD, (((dat) & 0xffUL) << I2C_DAT_Pos)); \
- } while(0)
- /**
- * @brief I2C timing restart write
- * @param __I2C__ Specifies I2C peripheral
- * @param dat write data
- * @return None
- */
- #define __LL_I2C_Timing_RestartWrite(__I2C__, dat) \
- do { \
- WRITE_REG((__I2C__)->DCMD, I2C_RESTART_Msk | (((dat) & 0xffUL) << I2C_DAT_Pos)); \
- } while(0)
- /**
- * @brief I2C timing write stop
- * @param __I2C__ Specifies I2C peripheral
- * @param dat write data
- * @return None
- */
- #define __LL_I2C_Timing_WriteStop(__I2C__, dat) \
- do { \
- WRITE_REG((__I2C__)->DCMD, I2C_STOP_Msk | (((dat) & 0xffUL) << I2C_DAT_Pos)); \
- } while(0)
- /**
- * @brief I2C timing restart write stop
- * @param __I2C__ Specifies I2C peripheral
- * @param dat write data
- * @return None
- */
- #define __LL_I2C_Timing_RestartWriteStop(__I2C__, dat) \
- do { \
- WRITE_REG((__I2C__)->DCMD, I2C_RESTART_Msk | I2C_STOP_Msk | (((dat) & 0xffUL) << I2C_DAT_Pos)); \
- } while(0)
- /**
- * @brief I2C SS SCL High Count Set
- * @param __I2C__ Specifies I2C peripheral
- * @param cnt I2C SS SCL High Count
- * @return None
- */
- #define __LL_I2C_SS_SCLHcnt_Set(__I2C__, cnt) \
- MODIFY_REG((__I2C__)->SSHCNT, I2C_SS_SCL_HCNT_Msk, ((cnt & 0xffffUL) << I2C_SS_SCL_HCNT_Pos))
- /**
- * @brief I2C SS SCL Low Count Set
- * @param __I2C__ Specifies I2C peripheral
- * @param cnt I2C SS SCL Low Count
- * @return None
- */
- #define __LL_I2C_SS_SCLLcnt_Set(__I2C__, cnt) \
- MODIFY_REG((__I2C__)->SSLCNT, I2C_SS_SCL_LCNT_Msk, ((cnt & 0xffffUL) << I2C_SS_SCL_LCNT_Pos))
- /**
- * @brief I2C FS SCL High Count Set
- * @param __I2C__ Specifies I2C peripheral
- * @param cnt I2C FS SCL High Count
- * @return None
- */
- #define __LL_I2C_FS_SCLHcnt_Set(__I2C__, cnt) \
- MODIFY_REG((__I2C__)->FSHCNT, I2C_FS_SCL_HCNT_Msk, ((cnt & 0xffffUL) << I2C_FS_SCL_HCNT_Pos))
- /**
- * @brief I2C FS SCL Low Count Set
- * @param __I2C__ Specifies I2C peripheral
- * @param cnt I2C FS SCL Low Count
- * @return None
- */
- #define __LL_I2C_FS_SCLLcnt_Set(__I2C__, cnt) \
- MODIFY_REG((__I2C__)->FSLCNT, I2C_FS_SCL_LCNT_Msk, ((cnt & 0xffffUL) << I2C_FS_SCL_LCNT_Pos))
- /**
- * @brief Judge SCL Stuck at Low or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 SCL isn't Stuck at Low
- * @retval 1 SCL is Stuck at Low
- */
- #define __LL_I2C_IsSCLStuckAtLow(__I2C__) \
- (READ_BIT((__I2C__)->INTRST, I2C_SCL_STK_AT_LOW_INT_STA_Msk) >> I2C_SCL_STK_AT_LOW_INT_STA_Pos)
- /**
- * @brief Judge Master On Hold or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Master isn't On Hold
- * @retval 1 Master is On Hold
- */
- #define __LL_I2C_MST_IsOnHold(__I2C__) \
- (READ_BIT((__I2C__)->INTRST, I2C_MST_ON_HOLD_INT_STA_Msk) >> I2C_MST_ON_HOLD_INT_STA_Pos)
- /**
- * @brief Judge Slave is Restart Detect or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Slave isn't Restart Detect
- * @retval 1 Slave is Restart Detect
- */
- #define __LL_I2C_SLV_IsRestartDet(__I2C__) \
- (READ_BIT((__I2C__)->INTRST, I2C_RESTART_DET_INT_STA_Msk) >> I2C_RESTART_DET_INT_STA_Pos)
- /**
- * @brief Judge Slave Genaral Call or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Isn't Genaral Call
- * @retval 1 Is Genaral Call
- */
- #define __LL_I2C_SLV_IsGenCall(__I2C__) \
- (READ_BIT((__I2C__)->INTRST, I2C_GEN_CALL_INT_STA_Msk) >> I2C_GEN_CALL_INT_STA_Pos)
- /**
- * @brief Judge Start Detect or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Isn't start detect
- * @retval 1 Is start detect
- */
- #define __LL_I2C_IsStartDet(__I2C__) \
- (READ_BIT((__I2C__)->INTRST, I2C_START_DET_INT_STA_Msk) >> I2C_START_DET_INT_STA_Pos)
- /**
- * @brief Judge Stop Detect or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Isn't stop detect
- * @retval 1 Is stop detect
- */
- #define __LL_I2C_IsStopDet(__I2C__) \
- (READ_BIT((__I2C__)->INTRST, I2C_STOP_DET_INT_STA_Msk) >> I2C_STOP_DET_INT_STA_Pos)
- /**
- * @brief Judge I2C Activity or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 I2C isn't activity
- * @retval 1 I2C is activity
- */
- #define __LL_I2C_IsActivityInt(__I2C__) \
- (READ_BIT((__I2C__)->INTRST, I2C_ACTIVITY_INT_STA_Msk) >> I2C_ACTIVITY_INT_STA_Pos)
- /**
- * @brief Judge Slave RX Done or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Slave isn't RX Done
- * @retval 1 Slave is RX Done
- */
- #define __LL_I2C_SLV_IsRxDone(__I2C__) \
- (READ_BIT((__I2C__)->INTRST, I2C_RX_DONE_INT_STA_Msk) >> I2C_RX_DONE_INT_STA_Pos)
- /**
- * @brief Judge TX Abort or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Isn't TX Abort
- * @retval 1 Is TX Abort
- */
- #define __LL_I2C_IsTxAbort(__I2C__) \
- (READ_BIT((__I2C__)->INTRST, I2C_TX_ABRT_INT_STA_Msk) >> I2C_TX_ABRT_INT_STA_Pos)
- /**
- * @brief Judge Slave Read Request or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Slave isn't Read Request
- * @retval 1 Slave is Read Request
- */
- #define __LL_I2C_SLV_IsReadReq(__I2C__) \
- (READ_BIT((__I2C__)->INTRST, I2C_RD_REQ_INT_STA_Msk) >> I2C_RD_REQ_INT_STA_Pos)
- /**
- * @brief Judge TX Empty or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Isn't TX Empty
- * @retval 1 Is TX Empty
- */
- #define __LL_I2C_IsTxEmpty(__I2C__) \
- (READ_BIT((__I2C__)->INTRST, I2C_TX_EMPTY_INT_STA_Msk) >> I2C_TX_EMPTY_INT_STA_Pos)
- /**
- * @brief Judge TX Over or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Isn't TX Over
- * @retval 1 Is TX Over
- */
- #define __LL_I2C_IsTxOver(__I2C__) \
- (READ_BIT((__I2C__)->INTRST, I2C_TX_OVER_INT_STA_Msk) >> I2C_TX_OVER_INT_STA_Pos)
- /**
- * @brief Judge RX Full or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Isn't RX Full
- * @retval 1 Is RX Full
- */
- #define __LL_I2C_IsRxFull(__I2C__) \
- (READ_BIT((__I2C__)->INTRST, I2C_RX_FULL_INT_STA_Msk) >> I2C_RX_FULL_INT_STA_Pos)
- /**
- * @brief Judge RX Over or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Isn't RX Over
- * @retval 1 Is RX Over
- */
- #define __LL_I2C_IsRxOver(__I2C__) \
- (READ_BIT((__I2C__)->INTRST, I2C_RX_OVER_INT_STA_Msk) >> I2C_RX_OVER_INT_STA_Pos)
- /**
- * @brief Judge RX Under or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Isn't RX Under
- * @retval 1 Is RX Under
- */
- #define __LL_I2C_IsRxUnder(__I2C__) \
- (READ_BIT((__I2C__)->INTRST, I2C_RX_UNDER_INT_STA_Msk) >> I2C_RX_UNDER_INT_STA_Pos)
- /**
- * @brief I2C interrupt status get
- * @param __I2C__ Specifies I2C peripheral
- * @return I2C interrupt status
- */
- #define __LL_I2C_IntSta_Get(__I2C__) (READ_REG((__I2C__)->INTRST))
- /**
- * @brief I2C SCL Stuck at low Interrupt Enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SCLStuckAtLow_INT_En(__I2C__) SET_BIT((__I2C__)->INTRMS, I2C_SCL_STK_AT_LOW_INT_EN_Msk)
- /**
- * @brief I2C SCL Stuck at low Interrupt Disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SCLStuckAtLow_INT_Dis(__I2C__) CLEAR_BIT((__I2C__)->INTRMS, I2C_SCL_STK_AT_LOW_INT_EN_Msk)
- /**
- * @brief I2C Master on hold Interrupt Enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_MST_OnHold_INT_En(__I2C__) SET_BIT((__I2C__)->INTRMS, I2C_MST_ON_HOLD_INT_EN_Msk)
- /**
- * @brief I2C Master on hold Interrupt Disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_MST_OnHold_INT_Dis(__I2C__) CLEAR_BIT((__I2C__)->INTRMS, I2C_MST_ON_HOLD_INT_EN_Msk)
- /**
- * @brief I2C Slave Restart Detect Interrupt Enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SLV_RestartDet_INT_En(__I2C__) SET_BIT((__I2C__)->INTRMS, I2C_RESTART_DET_INT_EN_Msk)
- /**
- * @brief I2C Slave Restart Detect Interrupt Disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SLV_RestartDet_INT_Dis(__I2C__) CLEAR_BIT((__I2C__)->INTRMS, I2C_RESTART_DET_INT_EN_Msk)
- /**
- * @brief I2C Slave Genaral Call Interrupt Enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SLV_GenCall_INT_En(__I2C__) SET_BIT((__I2C__)->INTRMS, I2C_GEN_CALL_INT_EN_Msk)
- /**
- * @brief I2C Slave Genaral Call Interrupt Disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SLV_GenCall_INT_Dis(__I2C__) CLEAR_BIT((__I2C__)->INTRMS, I2C_GEN_CALL_INT_EN_Msk)
- /**
- * @brief I2C Start Detect Interrupt Enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_StartDet_INT_En(__I2C__) SET_BIT((__I2C__)->INTRMS, I2C_START_DET_INT_EN_Msk)
- /**
- * @brief I2C Start Detect Interrupt Disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_StartDet_INT_Dis(__I2C__) CLEAR_BIT((__I2C__)->INTRMS, I2C_START_DET_INT_EN_Msk)
- /**
- * @brief I2C Stop Detect Interrupt Enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_StopDet_INT_En(__I2C__) SET_BIT((__I2C__)->INTRMS, I2C_STOP_DET_INT_EN_Msk)
- /**
- * @brief I2C Stop Detect Interrupt Disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_StopDet_INT_Dis(__I2C__) CLEAR_BIT((__I2C__)->INTRMS, I2C_STOP_DET_INT_EN_Msk)
- /**
- * @brief I2C Activity Interrupt Enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_Activity_INT_En(__I2C__) SET_BIT((__I2C__)->INTRMS, I2C_ACTIVITY_INT_EN_Msk)
- /**
- * @brief I2C Activity Interrupt Disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_Activity_INT_Dis(__I2C__) CLEAR_BIT((__I2C__)->INTRMS, I2C_ACTIVITY_INT_EN_Msk)
- /**
- * @brief I2C Slave RX Done Interrupt Enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SLV_RxDone_INT_En(__I2C__) SET_BIT((__I2C__)->INTRMS, I2C_RX_DONE_INT_EN_Msk)
- /**
- * @brief I2C Slave RX Done Interrupt Disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SLV_RxDone_INT_Dis(__I2C__) CLEAR_BIT((__I2C__)->INTRMS, I2C_RX_DONE_INT_EN_Msk)
- /**
- * @brief I2C TX Abort Interrupt Enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_TxAbort_INT_En(__I2C__) SET_BIT((__I2C__)->INTRMS, I2C_TX_ABRT_INT_EN_Msk)
- /**
- * @brief I2C TX Abort Interrupt Disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_TxAbort_INT_Dis(__I2C__) CLEAR_BIT((__I2C__)->INTRMS, I2C_TX_ABRT_INT_EN_Msk)
- /**
- * @brief I2C Slave Read Request Interrupt Enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SLV_ReadReq_INT_En(__I2C__) SET_BIT((__I2C__)->INTRMS, I2C_RD_REQ_INT_EN_Msk)
- /**
- * @brief I2C Slave Read Request Interrupt Disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SLV_ReadReq_INT_Dis(__I2C__) CLEAR_BIT((__I2C__)->INTRMS, I2C_RD_REQ_INT_EN_Msk)
- /**
- * @brief I2C TX Empty Interrupt Enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_TxEmpty_INT_En(__I2C__) SET_BIT((__I2C__)->INTRMS, I2C_TX_EMPTY_INT_EN_Msk)
- /**
- * @brief I2C TX Empty Interrupt Disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_TxEmpty_INT_Dis(__I2C__) CLEAR_BIT((__I2C__)->INTRMS, I2C_TX_EMPTY_INT_EN_Msk)
- /**
- * @brief I2C TX Over Interrupt Enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_TxOver_INT_En(__I2C__) SET_BIT((__I2C__)->INTRMS, I2C_TX_OVER_INT_EN_Msk)
- /**
- * @brief I2C TX Over Interrupt Disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_TxOver_INT_Dis(__I2C__) CLEAR_BIT((__I2C__)->INTRMS, I2C_TX_OVER_INT_EN_Msk)
- /**
- * @brief I2C RX Full Interrupt Enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_RxFull_INT_En(__I2C__) SET_BIT((__I2C__)->INTRMS, I2C_RX_FULL_INT_EN_Msk)
- /**
- * @brief I2C RX Full Interrupt Disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_RxFull_INT_Dis(__I2C__) CLEAR_BIT((__I2C__)->INTRMS, I2C_RX_FULL_INT_EN_Msk)
- /**
- * @brief I2C RX Over Interrupt Enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_RxOver_INT_En(__I2C__) SET_BIT((__I2C__)->INTRMS, I2C_RX_OVER_INT_EN_Msk)
- /**
- * @brief I2C RX Over Interrupt Disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_RxOver_INT_Dis(__I2C__) CLEAR_BIT((__I2C__)->INTRMS, I2C_RX_OVER_INT_EN_Msk)
- /**
- * @brief I2C RX Under Interrupt Enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_RxUnder_INT_En(__I2C__) SET_BIT((__I2C__)->INTRMS, I2C_RX_UNDER_INT_EN_Msk)
- /**
- * @brief I2C RX Under Interrupt Disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_RxUnder_INT_Dis(__I2C__) CLEAR_BIT((__I2C__)->INTRMS, I2C_RX_UNDER_INT_EN_Msk)
- /**
- * @brief Judge SCL Stuck at Low Raw or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 SCL isn't Stuck at Low
- * @retval 1 SCL is Stuck at Low
- */
- #define __LL_I2C_IsSCLStuckAtLow_Raw(__I2C__) \
- (READ_BIT((__I2C__)->RINTRST, I2C_SCL_STK_AT_LOW_RAW_INT_STA_Msk) >> I2C_SCL_STK_AT_LOW_RAW_INT_STA_Pos)
- /**
- * @brief Judge Master On Hold Raw or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Master isn't On Hold
- * @retval 1 Master is On Hold
- */
- #define __LL_I2C_MST_IsOnHold_Raw(__I2C__) \
- (READ_BIT((__I2C__)->RINTRST, I2C_MST_ON_HOLD_RAW_INT_STA_Msk) >> I2C_MST_ON_HOLD_RAW_INT_STA_Pos)
- /**
- * @brief Judge Slave is Restart Detect Raw or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Slave isn't Restart Detect
- * @retval 1 Slave is Restart Detect
- */
- #define __LL_I2C_SLV_IsRestartDet_Raw(__I2C__) \
- (READ_BIT((__I2C__)->RINTRST, I2C_RESTART_DET_RAW_INT_STA_Msk) >> I2C_RESTART_DET_RAW_INT_STA_Pos)
- /**
- * @brief Judge Slave Genaral Call Raw or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Isn't Genaral Call
- * @retval 1 Is Genaral Call
- */
- #define __LL_I2C_SLV_IsGenCall_Raw(__I2C__) \
- (READ_BIT((__I2C__)->RINTRST, I2C_GEN_CALL_RAW_INT_STA_Msk) >> I2C_GEN_CALL_RAW_INT_STA_Pos)
- /**
- * @brief Judge Start Detect Raw or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Isn't start detect
- * @retval 1 Is start detect
- */
- #define __LL_I2C_IsStartDet_Raw(__I2C__) \
- (READ_BIT((__I2C__)->RINTRST, I2C_START_DET_RAW_INT_STA_Msk) >> I2C_START_DET_RAW_INT_STA_Pos)
- /**
- * @brief Judge Stop Detect Raw or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Isn't stop detect
- * @retval 1 Is stop detect
- */
- #define __LL_I2C_IsStopDet_Raw(__I2C__) \
- (READ_BIT((__I2C__)->RINTRST, I2C_STOP_DET_RAW_INT_STA_Msk) >> I2C_STOP_DET_RAW_INT_STA_Pos)
- /**
- * @brief Judge I2C Activity Raw or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 I2C isn't activity
- * @retval 1 I2C is activity
- */
- #define __LL_I2C_IsActivity_Raw(__I2C__) \
- (READ_BIT((__I2C__)->RINTRST, I2C_ACTIVITY_RAW_INT_STA_Msk) >> I2C_ACTIVITY_RAW_INT_STA_Pos)
- /**
- * @brief Judge Slave RX Done Raw or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Slave isn't RX Done
- * @retval 1 Slave is RX Done
- */
- #define __LL_I2C_SLV_IsRxDone_Raw(__I2C__) \
- (READ_BIT((__I2C__)->RINTRST, I2C_RX_DONE_RAW_INT_STA_Msk) >> I2C_RX_DONE_RAW_INT_STA_Pos)
- /**
- * @brief Judge TX Abort Raw or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Isn't TX Abort
- * @retval 1 Is TX Abort
- */
- #define __LL_I2C_IsTxAbort_Raw(__I2C__) \
- (READ_BIT((__I2C__)->RINTRST, I2C_TX_ABRT_RAW_INT_STA_Msk) >> I2C_TX_ABRT_RAW_INT_STA_Pos)
- /**
- * @brief Judge Slave Read Request Raw or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Slave isn't Read Request
- * @retval 1 Slave is Read Request
- */
- #define __LL_I2C_SLV_IsReadReq_Raw(__I2C__) \
- (READ_BIT((__I2C__)->RINTRST, I2C_RD_REQ_RAW_INT_STA_Msk) >> I2C_RD_REQ_RAW_INT_STA_Pos)
- /**
- * @brief Judge TX Empty Raw or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Isn't TX Empty
- * @retval 1 Is TX Empty
- */
- #define __LL_I2C_IsTxEmpty_Raw(__I2C__) \
- (READ_BIT((__I2C__)->RINTRST, I2C_TX_EMPTY_RAW_INT_STA_Msk) >> I2C_TX_EMPTY_RAW_INT_STA_Pos)
- /**
- * @brief Judge TX Over Raw or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Isn't TX Over
- * @retval 1 Is TX Over
- */
- #define __LL_I2C_IsTxOver_Raw(__I2C__) \
- (READ_BIT((__I2C__)->RINTRST, I2C_TX_OVER_RAW_INT_STA_Msk) >> I2C_TX_OVER_RAW_INT_STA_Pos)
- /**
- * @brief Judge RX Full Raw or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Isn't RX Full
- * @retval 1 Is RX Full
- */
- #define __LL_I2C_IsRxFull_Raw(__I2C__) \
- (READ_BIT((__I2C__)->RINTRST, I2C_RX_FULL_RAW_INT_STA_Msk) >> I2C_RX_FULL_RAW_INT_STA_Pos)
- /**
- * @brief Judge RX Over Raw or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Isn't RX Over
- * @retval 1 Is RX Over
- */
- #define __LL_I2C_IsRxOver_Raw(__I2C__) \
- (READ_BIT((__I2C__)->RINTRST, I2C_RX_OVER_RAW_INT_STA_Msk) >> I2C_RX_OVER_RAW_INT_STA_Pos)
- /**
- * @brief Judge RX Under Raw or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Isn't RX Under
- * @retval 1 Is RX Under
- */
- #define __LL_I2C_IsRxUnder_Raw(__I2C__) \
- (READ_BIT((__I2C__)->RINTRST, I2C_RX_UNDER_RAW_INT_STA_Msk) >> I2C_RX_UNDER_RAW_INT_STA_Pos)
- /**
- * @brief I2C RX Trigger Level Set
- * @param __I2C__ Specifies I2C peripheral
- * @param tl RX Trigger Level
- * @return None
- */
- #define __LL_I2C_RxTL_Set(__I2C__, tl) MODIFY_REG((__I2C__)->RXTL, I2C_RX_TL_Msk, (((tl-1) & 0xffUL) << I2C_RX_TL_Pos))
- /**
- * @brief I2C TX Trigger Level Set
- * @param __I2C__ Specifies I2C peripheral
- * @param tl TX Trigger Level
- * @return None
- */
- #define __LL_I2C_TxTL_Set(__I2C__, tl) MODIFY_REG((__I2C__)->TXTL, I2C_TX_TL_Msk, (((tl-1) & 0xffUL) << I2C_TX_TL_Pos))
- /**
- * @brief I2C Soft Interrupt Status Clear
- * @param __I2C__ Specifies I2C peripheral
- * @return Read Value, not use
- */
- #define __LL_I2C_SoftIntSta_Clr(__I2C__) (READ_BIT((__I2C__)->INTRCR, I2C_CLR_INT_Msk) >> I2C_CLR_INT_Pos)
- /**
- * @brief I2C RX Under Interrupt Status Clear
- * @param __I2C__ Specifies I2C peripheral
- * @return Read Value, not use
- */
- #define __LL_I2C_RxUnderRawIntSta_Clr(__I2C__) (READ_BIT((__I2C__)->RXUNCR, I2C_CLR_RX_UNDER_Msk) >> I2C_CLR_RX_UNDER_Pos)
- /**
- * @brief I2C RX Over Interrupt Status Clear
- * @param __I2C__ Specifies I2C peripheral
- * @return Read Value, not use
- */
- #define __LL_I2C_RxOverRawIntSta_Clr(__I2C__) (READ_BIT((__I2C__)->RXOVCR, I2C_CLR_RX_OVER_Msk) >> I2C_CLR_RX_OVER_Pos)
- /**
- * @brief I2C TX Over Interrupt Status Clear
- * @param __I2C__ Specifies I2C peripheral
- * @return Read Value, not use
- */
- #define __LL_I2C_TxOverRawIntSta_Clr(__I2C__) (READ_BIT((__I2C__)->TXOVCR, I2C_CLR_TX_OVER_Msk) >> I2C_CLR_TX_OVER_Pos)
- /**
- * @brief I2C Slave Read Request Interrupt Status Clear
- * @param __I2C__ Specifies I2C peripheral
- * @return Read Value, not use
- */
- #define __LL_I2C_SLV_ReadReqRawIntSta_Clr(__I2C__) (READ_BIT((__I2C__)->RDREQCR, I2C_CLR_RD_REQ_Msk) >> I2C_CLR_RD_REQ_Pos)
- /**
- * @brief I2C TX Abort Interrupt Status Clear
- * @param __I2C__ Specifies I2C peripheral
- * @return Read Value, not use
- */
- #define __LL_I2C_TxAbortRawIntSta_Clr(__I2C__) (READ_BIT((__I2C__)->TXABCR, I2C_CLR_TX_ABRT_Msk) >> I2C_CLR_TX_ABRT_Pos)
- /**
- * @brief I2C Slave RX Done Interrupt Status Clear
- * @param __I2C__ Specifies I2C peripheral
- * @return Read Value, not use
- */
- #define __LL_I2C_SLV_RxDoneRawIntSta_Clr(__I2C__) (READ_BIT((__I2C__)->RXDOCR, I2C_CLR_RX_DONE_Msk) >> I2C_CLR_RX_DONE_Pos)
- /**
- * @brief I2C Activity Interrupt Status Clear
- * @param __I2C__ Specifies I2C peripheral
- * @return Read Value, not use
- */
- #define __LL_I2C_ActivityRawIntSta_Clr(__I2C__) (READ_BIT((__I2C__)->ACTICR, I2C_CLR_ACTIVITY_Msk) >> I2C_CLR_ACTIVITY_Pos)
- /**
- * @brief I2C Stop Detect Interrupt Status Clear
- * @param __I2C__ Specifies I2C peripheral
- * @return Read Value, not use
- */
- #define __LL_I2C_StopDetRawIntSta_Clr(__I2C__) (READ_BIT((__I2C__)->SPDETCR, I2C_CLR_STOP_DET_Msk) >> I2C_CLR_STOP_DET_Pos)
- /**
- * @brief I2C Start Detect Interrupt Status Clear
- * @param __I2C__ Specifies I2C peripheral
- * @return Read Value, not use
- */
- #define __LL_I2C_StartDetRawIntSta_Clr(__I2C__) (READ_BIT((__I2C__)->STDETCR, I2C_CLR_START_DET_Msk) >> I2C_CLR_START_DET_Pos)
- /**
- * @brief I2C Slave Genaral Call Interrupt Status Clear
- * @param __I2C__ Specifies I2C peripheral
- * @return Read Value, not use
- */
- #define __LL_I2C_SLV_GenCallRawIntSta_Clr(__I2C__) (READ_BIT((__I2C__)->GCCR, I2C_CLR_GEN_CALL_Msk) >> I2C_CLR_GEN_CALL_Pos)
- /**
- * @brief I2C SMBUS Alert Enable Set
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_AlertEn_Set(__I2C__) SET_BIT((__I2C__)->ENABLE, I2C_SMBUS_ALERT_EN_Msk)
- /**
- * @brief I2C SMBUS Alert Enable Clear
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_AlertEn_Clr(__I2C__) CLEAR_BIT((__I2C__)->ENABLE, I2C_SMBUS_ALERT_EN_Msk)
- /**
- * @brief I2C SMBUS Suspend Enable Set
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_SuspendEn_Set(__I2C__) SET_BIT((__I2C__)->ENABLE, I2C_SMBUS_SUSPEND_EN_Msk)
- /**
- * @brief I2C SMBUS Suspend Enable Clear
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_SuspendEn_Clr(__I2C__) CLEAR_BIT((__I2C__)->ENABLE, I2C_SMBUS_SUSPEND_EN_Msk)
- /**
- * @brief I2C SMBUS CLK Reset Set
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_ClkReset_Set(__I2C__) SET_BIT((__I2C__)->ENABLE, I2C_SMBUS_CLK_RESET_Msk)
- /**
- * @brief I2C SMBUS CLK Reset Clear
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_ClkReset_Clr(__I2C__) CLEAR_BIT((__I2C__)->ENABLE, I2C_SMBUS_CLK_RESET_Msk)
- /**
- * @brief I2C SDA Stuck Recovery Enable Set
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SDAStuckRecoveryEn_Set(__I2C__) SET_BIT((__I2C__)->ENABLE, I2C_SDA_STK_RECOVERY_EN_Msk)
- /**
- * @brief I2C Master TX Cmd Block Set
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_MST_TxCmdBlock_Set(__I2C__) SET_BIT((__I2C__)->ENABLE, I2C_TX_CMD_BLOCK_Msk)
- /**
- * @brief I2C Master TX Cmd Block Clear
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_MST_TxCmdBlock_Clr(__I2C__) CLEAR_BIT((__I2C__)->ENABLE, I2C_TX_CMD_BLOCK_Msk)
- /**
- * @brief I2C Master Abort Set
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_MST_Abort_Set(__I2C__) SET_BIT((__I2C__)->ENABLE, I2C_ABORT_Msk)
- /**
- * @brief I2C Module Enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_Enable(__I2C__) SET_BIT((__I2C__)->ENABLE, I2C_ENABLE_Msk)
- /**
- * @brief I2C Module Disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_Disable(__I2C__) CLEAR_BIT((__I2C__)->ENABLE, I2C_ENABLE_Msk)
- /**
- * @brief Judge SMBUS Alert Status or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Isn't alert status
- * @retval 1 Is alert status
- */
- #define __LL_I2C_SMBUS_IsAlertSta(__I2C__) (READ_BIT((__I2C__)->STATUS, I2C_SMBUS_ALERT_STATUS_Msk) >> I2C_SMBUS_ALERT_STATUS_Pos)
- /**
- * @brief Judge SMBUS Suspend Status or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Isn't Suspend status
- * @retval 1 Is Suspend status
- */
- #define __LL_I2C_SMBUS_IsSuspendSta(__I2C__) (READ_BIT((__I2C__)->STATUS, I2C_SMBUS_SUSPEND_STATUS_Msk) >> I2C_SMBUS_SUSPEND_STATUS_Pos)
- /**
- * @brief Judge SMBUS Slave Address Resolved or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 SMBUS Slave Address Isn't Resolved
- * @retval 1 SMBUS Slave Address Is Resolved
- */
- #define __LL_I2C_SMBUS_IsSlvAddrResolved(__I2C__) \
- (READ_BIT((__I2C__)->STATUS, I2C_SMBUS_SLV_ADDR_RESOLVED_Msk) >> I2C_SMBUS_SLV_ADDR_RESOLVED_Pos)
- /**
- * @brief Judge SMBUS Slave Address Valid or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 SMBUS Slave Address Isn't Valid
- * @retval 1 SMBUS Slave Address Is Valid
- */
- #define __LL_I2C_SMBUS_IsSlvAddrValid(__I2C__) \
- (READ_BIT((__I2C__)->STATUS, I2C_SMBUS_SLV_ADDR_VALID_Msk) >> I2C_SMBUS_SLV_ADDR_VALID_Pos)
- /**
- * @brief I2C SMBUS Quick Cmd Bit
- * @param __I2C__ Specifies I2C peripheral
- * @return SMBUS Quick Cmd Bit(R/W)
- */
- #define __LL_I2C_SMBUS_QuickCmdBit(__I2C__) (READ_BIT((__I2C__)->STATUS, I2C_SMBUS_QUICK_CMD_BIT_Msk) >> I2C_SMBUS_QUICK_CMD_BIT_Pos)
- /**
- * @brief Judge SDA Stuck No Recovered or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 SDA Stuck has Recovered
- * @retval 1 SDA Stuck hasn't Recovered
- */
- #define __LL_I2C_IsSDAStuckNoRecovered(__I2C__) \
- (READ_BIT((__I2C__)->STATUS, I2C_SDA_STUCK_NOT_RECOVERED_Msk) >> I2C_SDA_STUCK_NOT_RECOVERED_Pos)
- /**
- * @brief Judge Slave Hold RX FIFO Full or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Slave Isn't Holding RX FIFO Full
- * @retval 1 Slave Is Holding RX FIFO Full
- */
- #define __LL_I2C_SLV_IsHoldRxFIFOFull(__I2C__) \
- (READ_BIT((__I2C__)->STATUS, I2C_SLV_HOLD_RX_FIFO_FULL_Msk) >> I2C_SLV_HOLD_RX_FIFO_FULL_Pos)
- /**
- * @brief Judge Slave Hold Tx FIFO Empty or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Slave Isn't Holding Tx FIFO Empty
- * @retval 1 Slave Is Holding Tx FIFO Empty
- */
- #define __LL_I2C_SLV_IsHoldTxFIFOEmpty(__I2C__) \
- (READ_BIT((__I2C__)->STATUS, I2C_SLV_HOLD_TX_FIFO_EMPTY_Msk) >> I2C_SLV_HOLD_TX_FIFO_EMPTY_Pos)
- /**
- * @brief Judge Master Hold RX FIFO Full or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Master Isn't Holding RX FIFO Full
- * @retval 1 Master Is Holding RX FIFO Full
- */
- #define __LL_I2C_MST_IsHoldRxFIFOFull(__I2C__) \
- (READ_BIT((__I2C__)->STATUS, I2C_MST_HOLD_RX_FIFO_FULL_Msk) >> I2C_MST_HOLD_RX_FIFO_FULL_Pos)
- /**
- * @brief Judge Master Hold Tx FIFO Empty or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Master Isn't Holding Tx FIFO Empty
- * @retval 1 Master Is Holding Tx FIFO Empty
- */
- #define __LL_I2C_MST_IsHoldTxFIFOEmpty(__I2C__) \
- (READ_BIT((__I2C__)->STATUS, I2C_MST_HOLD_TX_FIFO_EMPTY_Msk) >> I2C_MST_HOLD_TX_FIFO_EMPTY_Pos)
- /**
- * @brief Judge Slave Activity or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Slave Isn't Activity
- * @retval 1 Slave Is Activity
- */
- #define __LL_I2C_SLV_IsActivity(__I2C__) (READ_BIT((__I2C__)->STATUS, I2C_SLV_ACTIVITY_Msk) >> I2C_SLV_ACTIVITY_Pos)
- /**
- * @brief Judge Master Activity or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Master Isn't Activity
- * @retval 1 Master Is Activity
- */
- #define __LL_I2C_MST_IsActivity(__I2C__) (READ_BIT((__I2C__)->STATUS, I2C_MST_ACTIVITY_Msk) >> I2C_MST_ACTIVITY_Pos)
- /**
- * @brief Judge RXFIFO Full Entirely or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 RXFIFO isn't full Entirely
- * @retval 1 RXFIFO is full Entirely
- */
- #define __LL_I2C_IsRxFIFOFull(__I2C__) (READ_BIT((__I2C__)->STATUS, I2C_RFF_Msk) >> I2C_RFF_Pos)
- /**
- * @brief Judge RXFIFO Not Empty or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 RXFIO is empty
- * @retval 1 RXFIO isn't empty
- */
- #define __LL_I2C_IsRxFIFONotEmpty(__I2C__) (READ_BIT((__I2C__)->STATUS, I2C_RFNE_Msk) >> I2C_RFNE_Pos)
- /**
- * @brief Judge TXFIFO Empty or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 TXFIFO isn't empty
- * @retval 1 TXFIFO is empty
- */
- #define __LL_I2C_IsTxFIFOEmpty(__I2C__) (READ_BIT((__I2C__)->STATUS, I2C_TFE_Msk) >> I2C_TFE_Pos)
- /**
- * @brief Judge TXFIFO Not Full or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 TXFIFO is Full
- * @retval 1 TXFIFO isn't Full
- */
- #define __LL_I2C_IsTxFIFONotFull(__I2C__) (READ_BIT((__I2C__)->STATUS, I2C_TFNF_Msk) >> I2C_TFNF_Pos)
- /**
- * @brief Judge I2C Activity or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 I2C isn't activity
- * @retval 1 I2C is activity
- */
- #define __LL_I2C_IsActivitySta(__I2C__) (READ_BIT((__I2C__)->STATUS, I2C_ACTIVITY_Msk) >> I2C_ACTIVITY_Pos)
- /**
- * @brief I2C TXFIFO Level Get
- * @param __I2C__ Specifies I2C peripheral
- * @return TXFIFO Level
- */
- #define __LL_I2C_TxFIFOLevel_Get(__I2C__) (READ_BIT((__I2C__)->TXFLR, I2C_TXFLR_Msk) >> I2C_TXFLR_Pos)
- /**
- * @brief I2C RXFIFO Level Get
- * @param __I2C__ Specifies I2C peripheral
- * @return RXFIFO Level
- */
- #define __LL_I2C_RxFIFOLevel_Get(__I2C__) (READ_BIT((__I2C__)->RXFLR, I2C_RXFLR_Msk) >> I2C_RXFLR_Pos)
- /**
- * @brief I2C SDA RX Hold Set
- * @param __I2C__ Specifies I2C peripheral
- * @param hld SDA RX Hold
- * @return None
- */
- #define __LL_I2C_SDARxHold_Set(__I2C__, hld) \
- MODIFY_REG((__I2C__)->SDA_HOLD, I2C_SDA_RX_HOLD_Msk, ((hld & 0xffUL) << I2C_SDA_RX_HOLD_Pos))
- /**
- * @brief I2C SDA TX Hold Set
- * @param __I2C__ Specifies I2C peripheral
- * @param hld SDA TX Hold
- * @return None
- */
- #define __LL_I2C_SDATxHold_Set(__I2C__, hld) \
- MODIFY_REG((__I2C__)->SDA_HOLD, I2C_SDA_TX_HOLD_Msk, ((hld & 0xffffUL) << I2C_SDA_TX_HOLD_Pos))
- /**
- * @brief I2C TX Flush Count Get
- * @param __I2C__ Specifies I2C peripheral
- * @return TX Flush Count
- */
- #define __LL_I2C_TxFlushCnt_Get(__I2C__) (READ_BIT((__I2C__)->TXABSR, I2C_TX_FLUSH_CNT_Msk) >> I2C_TX_FLUSH_CNT_Pos)
- /**
- * @brief Judge Master Abort Source Device Write or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Abort Source Isn't Device Write
- * @retval 1 Abort Source Is Device Write
- */
- #define __LL_I2C_MST_AbortSrc_IsDevWrite(__I2C__) \
- (READ_BIT((__I2C__)->TXABSR, I2C_ABRT_DEV_WRITE_Msk) >> I2C_ABRT_DEV_WRITE_Pos)
- /**
- * @brief Judge Master Abort Source Device Slave Address No ACK or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Abort Source Isn't Device Slave Address No ACK
- * @retval 1 Abort Source Is Device Slave Address No ACK
- */
- #define __LL_I2C_MST_AbortSrc_IsDevSlvAddrNoAck(__I2C__) \
- (READ_BIT((__I2C__)->TXABSR, I2C_ABRT_DEV_SLV_ADDR_NOACK_Msk) >> I2C_ABRT_DEV_SLV_ADDR_NOACK_Pos)
- /**
- * @brief Judge Master Abort Source Device No ACK or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Abort Source Isn't Device No ACK
- * @retval 1 Abort Source Is Device No ACK
- */
- #define __LL_I2C_MST_AbortSrc_IsDevNoAck(__I2C__) \
- (READ_BIT((__I2C__)->TXABSR, I2C_ABRT_DEV_NOACK_Msk) >> I2C_ABRT_DEV_NOACK_Pos)
- /**
- * @brief Judge Master Abort Source SDA Stuck at Low or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Abort Source Isn't SDA Stuck at Low
- * @retval 1 Abort Source Is SDA Stuck at Low
- */
- #define __LL_I2C_MST_AbortSrc_IsSDAStuckAtLow(__I2C__) \
- (READ_BIT((__I2C__)->TXABSR, I2C_ABRT_SDA_STUCK_AT_LOW_Msk) >> I2C_ABRT_SDA_STUCK_AT_LOW_Pos)
- /**
- * @brief Judge Master Abort Source User Abort or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Abort Source Isn't User Abort
- * @retval 1 Abort Source Is User Abort
- */
- #define __LL_I2C_MST_AbortSrc_IsUserAbort(__I2C__) \
- (READ_BIT((__I2C__)->TXABSR, I2C_ABRT_USER_ABRT_Msk) >> I2C_ABRT_USER_ABRT_Pos)
- /**
- * @brief Judge Slave Abort Source Slave Read In TX or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Abort Source Isn't Slave Read In TX
- * @retval 1 Abort Source Is Slave Read In TX
- */
- #define __LL_I2C_SLV_AbortSrc_IsSlvReadInTx(__I2C__) \
- (READ_BIT((__I2C__)->TXABSR, I2C_ABRT_SLVRD_INTX_Msk) >> I2C_ABRT_SLVRD_INTX_Pos)
- /**
- * @brief Judge Slave Abort Source Slave Lost Bus or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Abort Source Isn't Slave Lost Bus
- * @retval 1 Abort Source Is Slave Lost Bus
- */
- #define __LL_I2C_SLV_AbortSrc_IsSlvLostBus(__I2C__) \
- (READ_BIT((__I2C__)->TXABSR, I2C_ABRT_SLV_ARBLOST_Msk) >> I2C_ABRT_SLV_ARBLOST_Pos)
- /**
- * @brief Judge Slave Abort Source Slave Flush TXFIFO or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Abort Source Isn't Slave Flush TXFIFO
- * @retval 1 Abort Source Is Slave Flush TXFIFO
- */
- #define __LL_I2C_SLV_AbortSrc_IsSlvFlushTxFIFO(__I2C__) \
- (READ_BIT((__I2C__)->TXABSR, I2C_ABRT_SLVFLUSH_TXFIFO_Msk) >> I2C_ABRT_SLVFLUSH_TXFIFO_Pos)
- /**
- * @brief Judge Abort Source ARB Lost or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Abort Source Isn't ARB Lost
- * @retval 1 Abort Source Is ARB Lost
- */
- #define __LL_I2C_AbortSrc_IsArbLost(__I2C__) \
- (READ_BIT((__I2C__)->TXABSR, I2C_ARB_LOST_Msk) >> I2C_ARB_LOST_Pos)
- /**
- * @brief Judge Abort Source Master Disable or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Abort Source Isn't Master Disable
- * @retval 1 Abort Source Is Master Disable
- */
- #define __LL_I2C_AbortSrc_IsMasterDis(__I2C__) \
- (READ_BIT((__I2C__)->TXABSR, I2C_ABRT_MASTER_DIS_Msk) >> I2C_ABRT_MASTER_DIS_Pos)
- /**
- * @brief Judge Master Abort Source 10bit Read No Restart or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Abort Source Isn't 10bit Read No Restart
- * @retval 1 Abort Source Is 10bit Read No Restart
- */
- #define __LL_I2C_MST_AbortSrc_Is10bReadNoRestart(__I2C__) \
- (READ_BIT((__I2C__)->TXABSR, I2C_ABRT_10B_RD_NORSTRT_Msk) >> I2C_ABRT_10B_RD_NORSTRT_Pos)
- /**
- * @brief Judge Master Abort Source Send Start No Restart or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Abort Source Isn't Send Start No Restart
- * @retval 1 Abort Source Is Send Start No Restart
- */
- #define __LL_I2C_MST_AbortSrc_IsSendStartNoRestart(__I2C__) \
- (READ_BIT((__I2C__)->TXABSR, I2C_ABRT_SBYTE_NORSTRT_Msk) >> I2C_ABRT_SBYTE_NORSTRT_Pos)
- /**
- * @brief Judge Master Abort Source HS No Restart or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Abort Source Isn't HS No Restart
- * @retval 1 Abort Source Is HS No Restart
- */
- #define __LL_I2C_MST_AbortSrc_IsHsNoRestart(__I2C__) \
- (READ_BIT((__I2C__)->TXABSR, I2C_ABRT_HS_NORSTRT_Msk) >> I2C_ABRT_HS_NORSTRT_Pos)
- /**
- * @brief Judge Master Abort Source Send Start ACK Detect or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Abort Source Isn't Send Start ACK Detect
- * @retval 1 Abort Source Is Send Start ACK Detect
- */
- #define __LL_I2C_MST_AbortSrc_IsSendStartAckDet(__I2C__) \
- (READ_BIT((__I2C__)->TXABSR, I2C_ABRT_SBYTE_ACKDET_Msk) >> I2C_ABRT_SBYTE_ACKDET_Pos)
- /**
- * @brief Judge Master Abort Source HS ACK Detect or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Abort Source Isn't HS ACK Detect
- * @retval 1 Abort Source Is HS ACK Detect
- */
- #define __LL_I2C_MST_AbortSrc_IsHsAckDet(__I2C__) \
- (READ_BIT((__I2C__)->TXABSR, I2C_ABRT_HS_ACKDET_Msk) >> I2C_ABRT_HS_ACKDET_Pos)
- /**
- * @brief Judge Master Abort Source Genaral Call Read or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Abort Source Isn't Genaral Call Read
- * @retval 1 Abort Source Is Genaral Call Read
- */
- #define __LL_I2C_MST_AbortSrc_IsGenCallRead(__I2C__) \
- (READ_BIT((__I2C__)->TXABSR, I2C_ABRT_GCALL_READ_Msk) >> I2C_ABRT_GCALL_READ_Pos)
- /**
- * @brief Judge Master Abort Source Genaral Call No ACK or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Abort Source Isn't Genaral Call No ACK
- * @retval 1 Abort Source Is Genaral Call No ACK
- */
- #define __LL_I2C_MST_AbortSrc_IsGenCallNoAck(__I2C__) \
- (READ_BIT((__I2C__)->TXABSR, I2C_ABRT_GCALL_NOACK_Msk) >> I2C_ABRT_GCALL_NOACK_Pos)
- /**
- * @brief Judge Master Abort Source TX Data No ACK or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Abort Source Isn't TX Data No ACK
- * @retval 1 Abort Source Is TX Data No ACK
- */
- #define __LL_I2C_MST_AbortSrc_IsTxDataNoAck(__I2C__) \
- (READ_BIT((__I2C__)->TXABSR, I2C_ABRT_TXDATA_NOACK_Msk) >> I2C_ABRT_TXDATA_NOACK_Pos)
- /**
- * @brief Judge Master Abort Source 10b Address 2 No ACK or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Abort Source Isn't 10b Address 2 No ACK
- * @retval 1 Abort Source Is 10b Address 2 No ACK
- */
- #define __LL_I2C_MST_AbortSrc_Is10bAddr2NoAck(__I2C__) \
- (READ_BIT((__I2C__)->TXABSR, I2C_ABRT_10ADDR2_NOACK_Msk) >> I2C_ABRT_10ADDR2_NOACK_Pos)
- /**
- * @brief Judge Master Abort Source 10b Address 1 No ACK or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Abort Source Isn't 10b Address 1 No ACK
- * @retval 1 Abort Source Is 10b Address 1 No ACK
- */
- #define __LL_I2C_MST_AbortSrc_Is10bAddr1NoAck(__I2C__) \
- (READ_BIT((__I2C__)->TXABSR, I2C_ABRT_10ADDR1_NOACK_Msk) >> I2C_ABRT_10ADDR1_NOACK_Pos)
- /**
- * @brief Judge Master Abort Source 7b Address No ACK or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Abort Source Isn't 7b Address No ACK
- * @retval 1 Abort Source Is 7b Address No ACK
- */
- #define __LL_I2C_MST_AbortSrc_Is7bAddrNoAck(__I2C__) \
- (READ_BIT((__I2C__)->TXABSR, I2C_ABRT_7B_ADDR_NOACK_Msk) >> I2C_ABRT_7B_ADDR_NOACK_Pos)
- /**
- * @brief I2C Slave Force Data No ACK Set
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SLV_ForceDataNoAck_Set(__I2C__) SET_BIT((__I2C__)->NACKEN, I2C_SLV_DATA_NACK_Msk)
- /**
- * @brief I2C Slave Force Data No ACK Clear
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SLV_ForceDataNoAck_Clr(__I2C__) CLEAR_BIT((__I2C__)->NACKEN, I2C_SLV_DATA_NACK_Msk)
- /**
- * @brief I2C TX DMA Enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_TxDMA_En(__I2C__) SET_BIT((__I2C__)->DMACT, I2C_DMA_TDMAE_Msk)
- /**
- * @brief I2C TX DMA Disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_TxDMA_Dis(__I2C__) CLEAR_BIT((__I2C__)->DMACT, I2C_DMA_TDMAE_Msk)
- /**
- * @brief I2C RX DMA Enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_RxDMA_En(__I2C__) SET_BIT((__I2C__)->DMACT, I2C_DMA_RDMAE_Msk)
- /**
- * @brief I2C RX DMA Disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_RxDMA_Dis(__I2C__) CLEAR_BIT((__I2C__)->DMACT, I2C_DMA_RDMAE_Msk)
- /**
- * @brief I2C TX DMA Trigger Level Set
- * @param __I2C__ Specifies I2C peripheral
- * @param tl TX DMA Trigger Level
- * @return None
- */
- #define __LL_I2C_TxDMATriggerLevel_Set(__I2C__, tl) \
- MODIFY_REG((__I2C__)->DMATDLR, I2C_DMA_DMATDL_Msk, ((tl & 0xfUL) << I2C_DMA_DMATDL_Pos))
- /**
- * @brief I2C RX DMA Trigger Level Set
- * @param __I2C__ Specifies I2C peripheral
- * @param tl RX DMA Trigger Level
- * @return None
- */
- #define __LL_I2C_RxDMATriggerLevel_Set(__I2C__, tl) \
- MODIFY_REG((__I2C__)->DMARDLR, I2C_DMA_DMARDL_Msk, (((tl-1) & 0xfUL) << I2C_DMA_DMARDL_Pos))
- #define __LL_I2C_SDA_Setup_Set(__I2C__, val) \
- MODIFY_REG((__I2C__)->SDA_SETUP, I2C_SDA_SETUP_Msk, ((val & 0xffUL) << I2C_SDA_SETUP_Pos))
- /**
- * @brief I2C ACK Genaral Call Enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_AckGenCall_En(__I2C__) SET_BIT((__I2C__)->GCACK, I2C_ACK_GEN_CALL_Msk)
- /**
- * @brief I2C ACK Genaral Call Disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_AckGenCall_Dis(__I2C__) CLEAR_BIT((__I2C__)->GCACK, I2C_ACK_GEN_CALL_Msk)
- /**
- * @brief Judge Slave RX Data Lost or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Slave Isn't RX Data Lost
- * @retval 1 Slave Is RX Data Lost
- */
- #define __LL_I2C_SLV_IsRxDataLost(__I2C__) \
- (READ_BIT((__I2C__)->ENST, I2C_SLV_RX_DATA_LOST_Msk) >> I2C_SLV_RX_DATA_LOST_Pos)
- /**
- * @brief Judge Slave Disable While Busy or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 Isn't Slave Disable While Busy
- * @retval 1 Is Slave Disable While Busy
- */
- #define __LL_I2C_SLV_IsSlvDisWhileBusy(__I2C__) \
- (READ_BIT((__I2C__)->ENST, I2C_SLVDIS_WHILEBUSY_Msk) >> I2C_SLVDIS_WHILEBUSY_Pos)
- /**
- * @brief Judge I2C Enable or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 I2C Isn't Enable
- * @retval 1 I2C Is Enable
- */
- #define __LL_I2C_IsEnable(__I2C__) (READ_BIT((__I2C__)->ENST, I2C_EN_Msk) >> I2C_EN_Pos)
- /**
- * @brief I2C FS Spike Lengh Set
- * @param __I2C__ Specifies I2C peripheral
- * @param len FS Spike Lengh
- * @return None
- */
- #define __LL_I2C_FsSpkLen_Set(__I2C__, len) \
- MODIFY_REG((__I2C__)->FS_SPKLEN, I2C_FS_SPKLEN_Msk, ((len & 0xffUL) << I2C_FS_SPKLEN_Pos))
- /**
- * @brief I2C Restart Detect RAW Interrupt Status Clear
- * @param __I2C__ Specifies I2C peripheral
- * @return Read Value, not use
- */
- #define __LL_I2C_RestartDetRawIntSta_Clr(__I2C__) \
- (READ_BIT((__I2C__)->RSDETCR, I2C_CLR_RESTART_DET_Msk) >> I2C_CLR_RESTART_DET_Pos)
- /**
- * @brief I2C SCL Stuck at Low Timeout Set
- * @param __I2C__ Specifies I2C peripheral
- * @param val Timeout Value
- * @return None
- */
- #define __LL_I2C_SCLStuckAtLowTimeout_Set(__I2C__, val) MODIFY_REG((__I2C__)->SCLLTO,\
- I2C_SCL_STK_LOW_TIMEOUT_Msk, ((val & 0xffffffffUL) << I2C_SCL_STK_LOW_TIMEOUT_Pos))
- /**
- * @brief I2C SDA Stuck at Low Timeout Set
- * @param __I2C__ Specifies I2C peripheral
- * @param val Timeout Value
- * @return None
- */
- #define __LL_I2C_SDAStuckAtLowTimeout_Set(__I2C__, val) MODIFY_REG((__I2C__)->SDALTO,\
- I2C_SDA_STK_LOW_TIMEOUT_Msk, ((val & 0xffffffffUL) << I2C_SDA_STK_LOW_TIMEOUT_Pos))
- /**
- * @brief I2C SCL Stuck Detect RAW Interrupt Status Clear
- * @param __I2C__ Specifies I2C peripheral
- * @return Read Value, not use
- */
- #define __LL_I2C_SCLStuckDetRawIntSta_Clr(__I2C__) \
- (READ_BIT((__I2C__)->SSTDETCR, I2C_CLR_SCL_STK_Msk) >> I2C_CLR_SCL_STK_Pos)
- /**
- * @brief I2C Device ID Set
- * @param __I2C__ Specifies I2C peripheral
- * @param id Device ID
- * @return None
- */
- #define __LL_I2C_DeviceID_Set(__I2C__, id) MODIFY_REG((__I2C__)->DEVICE_ID, I2C_DEV_ID_Msk, ((id & 0xffffffUL) << I2C_DEV_ID_Pos))
- /**
- * @brief I2C SMBUS Clock Low Sext Timeout Set
- * @param __I2C__ Specifies I2C peripheral
- * @param val Timeout Value
- * @return None
- */
- #define __LL_I2C_SMBUS_ClkLowSextTimeout_Set(__I2C__, val) MODIFY_REG((__I2C__)->TSEXT,\
- I2C_SMBUS_CLK_LOW_SEXT_TIMEOUT_Msk, ((val & 0xffffffffUL) << I2C_SMBUS_CLK_LOW_SEXT_TIMEOUT_Pos))
- /**
- * @brief I2C SMBUS Clock Low Mext Timeout Set
- * @param __I2C__ Specifies I2C peripheral
- * @param val Timeout Value
- * @return None
- */
- #define __LL_I2C_SMBUS_ClkLowMextTimeout_Set(__I2C__, val) MODIFY_REG((__I2C__)->TMEXT,\
- I2C_SMBUS_CLK_LOW_MEXT_TIMEOUT_Msk, ((val & 0xffffffffUL) << I2C_SMBUS_CLK_LOW_MEXT_TIMEOUT_Pos))
- /**
- * @brief I2C SMBUS Thigh Max Bus Idle Count Set
- * @param __I2C__ Specifies I2C peripheral
- * @param cnt Count
- * @return None
- */
- #define __LL_I2C_SMBUS_ThighMaxBusIdleCnt_Set(__I2C__, cnt) MODIFY_REG((__I2C__)->IDCNT,\
- I2C_SMBUS_THIGH_MAX_BUS_IDLE_CNT_Msk, ((cnt & 0xffffUL) << I2C_SMBUS_THIGH_MAX_BUS_IDLE_CNT_Pos))
- /**
- * @brief Judge SMBUS is alert detect or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 SMBUS isn't alert detect
- * @retval 1 SMBUS is alert detect
- */
- #define __LL_I2C_SMBUS_IsAlertDet(__I2C__) \
- (READ_BIT((__I2C__)->SMINTRST, I2C_SMBUS_ALERT_DET_INT_STA_Msk) << I2C_SMBUS_ALERT_DET_INT_STA_Pos)
- /**
- * @brief Judge SMBUS is suspend detect or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 SMBUS isn't suspend detect
- * @retval 1 SMBUS is suspend detect
- */
- #define __LL_I2C_SMBUS_IsSuspendDet(__I2C__) \
- (READ_BIT((__I2C__)->SMINTRST, I2C_SMBUS_SUSPEND_DET_INT_STA_Msk) << I2C_SMBUS_SUSPEND_DET_INT_STA_Pos)
- /**
- * @brief Judge SMBUS is slave RX PEC NACK or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 SMBUS isn't slave RX PEC NACK
- * @retval 1 SMBUS is slave RX PEC NACK
- */
- #define __LL_I2C_SMBUS_IsSlvRxPecNack(__I2C__) \
- (READ_BIT((__I2C__)->SMINTRST, I2C_SLV_RX_PEC_NACK_INT_STA_Msk) << I2C_SLV_RX_PEC_NACK_INT_STA_Pos)
- /**
- * @brief Judge SMBUS is ARP assgn address cmd detect or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 SMBUS isn't ARP assgn address cmd detect
- * @retval 1 SMBUS is ARP assgn address cmd detect
- */
- #define __LL_I2C_SMBUS_IsARPAssgnAddrCmdDet(__I2C__) \
- (READ_BIT((__I2C__)->SMINTRST, I2C_ARP_ASSGN_ADDR_CMD_DET_INT_STA_Msk) << I2C_ARP_ASSGN_ADDR_CMD_DET_INT_STA_Pos)
- /**
- * @brief Judge SMBUS is ARP get UDID cmd detect or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 SMBUS isn't ARP get UDID cmd detect
- * @retval 1 SMBUS is ARP get UDID cmd detect
- */
- #define __LL_I2C_SMBUS_IsARPGetUdidCmdDet(__I2C__) \
- (READ_BIT((__I2C__)->SMINTRST, I2C_ARP_GET_UDID_CMD_DET_INT_STA_Msk) << I2C_ARP_GET_UDID_CMD_DET_INT_STA_Pos)
- /**
- * @brief Judge SMBUS is ARP reset cmd detect or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 SMBUS isn't ARP reset cmd detect
- * @retval 1 SMBUS is ARP reset cmd detect
- */
- #define __LL_I2C_SMBUS_IsARPRstCmdDet(__I2C__) \
- (READ_BIT((__I2C__)->SMINTRST, I2C_ARP_RST_CMD_DET_INT_STA_Msk) << I2C_ARP_RST_CMD_DET_INT_STA_Pos)
- /**
- * @brief Judge SMBUS is ARP prepare cmd detect or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 SMBUS isn't ARP prepare cmd detect
- * @retval 1 SMBUS is ARP prepare cmd detect
- */
- #define __LL_I2C_SMBUS_IsARPPrepareCmdDet(__I2C__) \
- (READ_BIT((__I2C__)->SMINTRST, I2C_ARP_PREPARE_CMD_DET_INT_STA_Msk) << I2C_ARP_PREPARE_CMD_DET_INT_STA_Pos)
- /**
- * @brief Judge SMBUS is host nofity mst detect or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 SMBUS isn't host nofity mst detect
- * @retval 1 SMBUS is host nofity mst detect
- */
- #define __LL_I2C_SMBUS_IsHostNotifyMstDet(__I2C__) \
- (READ_BIT((__I2C__)->SMINTRST, I2C_HOST_NOTIFY_MST_DET_INT_STA_Msk) << I2C_HOST_NOTIFY_MST_DET_INT_STA_Pos)
- /**
- * @brief Judge SMBUS is quick cmd detect or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 SMBUS isn't quick cmd detect
- * @retval 1 SMBUS is quick cmd detect
- */
- #define __LL_I2C_SMBUS_IsQuickCmdDet(__I2C__) \
- (READ_BIT((__I2C__)->SMINTRST, I2C_QUICK_CMD_DET_INT_STA_Msk) << I2C_QUICK_CMD_DET_INT_STA_Pos)
- /**
- * @brief Judge SMBUS is mst clock extend timeout or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 SMBUS isn't mst clock extend timeout
- * @retval 1 SMBUS is mst clock extend timeout
- */
- #define __LL_I2C_SMBUS_IsMstClkExtendTimeout(__I2C__) \
- (READ_BIT((__I2C__)->SMINTRST, I2C_MST_CLK_EXTND_TIMEOUT_INT_STA_Msk) << I2C_MST_CLK_EXTND_TIMEOUT_INT_STA_Pos)
- /**
- * @brief Judge SMBUS is slave clock extend timeout or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 SMBUS isn't slave clock extend timeout
- * @retval 1 SMBUS is slave clock extend timeout
- */
- #define __LL_I2C_SMBUS_IsSlvClkExtendTimeout(__I2C__) \
- (READ_BIT((__I2C__)->SMINTRST, I2C_SLV_CLK_EXTND_TIMEOUT_INT_STA_Msk) << I2C_SLV_CLK_EXTND_TIMEOUT_INT_STA_Pos)
- /**
- * @brief SMBUS alert detect interrupt enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_AlertDet_INT_En(__I2C__) SET_BIT((__I2C__)->SMINTRMS, I2C_SMBUS_ALERT_DET_INT_EN_Msk)
- /**
- * @brief SMBUS alert detect interrupt Disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_AlertDet_INT_Dis(__I2C__) CLEAR_BIT((__I2C__)->SMINTRMS, I2C_SMBUS_ALERT_DET_INT_EN_Msk)
- /**
- * @brief SMBUS Suspend detect interrupt enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_SuspendDet_INT_En(__I2C__) SET_BIT((__I2C__)->SMINTRMS, I2C_SMBUS_SUSPEND_DET_INT_EN_Msk)
- /**
- * @brief SMBUS Suspend detect interrupt disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_SuspendDet_INT_Dis(__I2C__) CLEAR_BIT((__I2C__)->SMINTRMS, I2C_SMBUS_SUSPEND_DET_INT_EN_Msk)
- /**
- * @brief SMBUS slave RX PEC NACK interrupt enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_SlvRxPecNack_INT_En(__I2C__) SET_BIT((__I2C__)->SMINTRMS, I2C_SLV_RX_PEC_NACK_INT_EN_Msk)
- /**
- * @brief SMBUS slave RX PEC NACK interrupt disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_SlvRxPecNack_INT_Dis(__I2C__) CLEAR_BIT((__I2C__)->SMINTRMS, I2C_SLV_RX_PEC_NACK_INT_EN_Msk)
- /**
- * @brief SBMUS ARP assgn addr cmd detect interrupt enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_ARPAssgnAddrCmdDet_INT_En(__I2C__) SET_BIT((__I2C__)->SMINTRMS, I2C_ARP_ASSGN_ADDR_CMD_DET_INT_EN_Msk)
- /**
- * @brief SBMUS ARP assgn addr cmd detect interrupt disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_ARPAssgnAddrCmdDet_INT_Dis(__I2C__) CLEAR_BIT((__I2C__)->SMINTRMS, I2C_ARP_ASSGN_ADDR_CMD_DET_INT_EN_Msk)
- /**
- * @brief SMBUS ARP get UDID cmd detect interrupt enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_ARPGetUdidCmdDet_INT_En(__I2C__) SET_BIT((__I2C__)->SMINTRMS, I2C_ARP_GET_UDID_CMD_DET_INT_EN_Msk)
- /**
- * @brief SMBUS ARP get UDID cmd detect interrupt disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_ARPGetUdidCmdDet_INT_Dis(__I2C__) CLEAR_BIT((__I2C__)->SMINTRMS, I2C_ARP_GET_UDID_CMD_DET_INT_EN_Msk)
- /**
- * @brief SMBUS ARP reset cmd detect interrupt enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_ARPRstCmdDet_INT_En(__I2C__) SET_BIT((__I2C__)->SMINTRMS, I2C_ARP_RST_CMD_DET_INT_EN_Msk)
- /**
- * @brief SMBUS ARP reset cmd detect interrupt disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_ARPRstCmdDet_INT_Dis(__I2C__) CLEAR_BIT((__I2C__)->SMINTRMS, I2C_ARP_RST_CMD_DET_INT_EN_Msk)
- /**
- * @brief SMBUS ARP prepare cmd detect interrupt enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_ARPPrepareCmdDet_INT_En(__I2C__) SET_BIT((__I2C__)->SMINTRMS, I2C_ARP_PREPARE_CMD_DET_INT_EN_Msk)
- /**
- * @brief SMBUS ARP prepare cmd detect interrupt disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_ARPPrepareCmdDet_INT_Dis(__I2C__) CLEAR_BIT((__I2C__)->SMINTRMS, I2C_ARP_PREPARE_CMD_DET_INT_EN_Msk)
- /**
- * @brief SMBUS host notify master detect interrupt enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_HostNotifyMstDet_INT_En(__I2C__) SET_BIT((__I2C__)->SMINTRMS, I2C_HOST_NOTIFY_MST_DET_INT_EN_Msk)
- /**
- * @brief SMBUS host notify master detect interrupt disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_HostNotifyMstDet_INT_Dis(__I2C__) CLEAR_BIT((__I2C__)->SMINTRMS, I2C_HOST_NOTIFY_MST_DET_INT_EN_Msk)
- /**
- * @brief SMBUS quick cmd detect interrupt enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_QuickCmdDet_INT_En(__I2C__) SET_BIT((__I2C__)->SMINTRMS, I2C_QUICK_CMD_DET_INT_EN_Msk)
- /**
- * @brief SMBUS quick cmd detect interrupt disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_QuickCmdDet_INT_Dis(__I2C__) CLEAR_BIT((__I2C__)->SMINTRMS, I2C_QUICK_CMD_DET_INT_EN_Msk)
- /**
- * @brief SMBUS master clock extend timeout interrupt enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_MstClkExtendTimeout_INT_En(__I2C__) SET_BIT((__I2C__)->SMINTRMS, I2C_MST_CLK_EXTND_TIMEOUT_INT_EN_Msk)
- /**
- * @brief SMBUS master clock extend timeout interrupt disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_MstClkExtendTimeout_INT_Dis(__I2C__) CLEAR_BIT((__I2C__)->SMINTRMS, I2C_MST_CLK_EXTND_TIMEOUT_INT_EN_Msk)
- /**
- * @brief SMBUS slave clock extend timeout interrupt enable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_SlvClkExtendTimeout_INT_En(__I2C__) SET_BIT((__I2C__)->SMINTRMS, I2C_SLV_CLK_EXTND_TIMEOUT_INT_EN_Msk)
- /**
- * @brief SMBUS slave clock extend timeout interrupt disable
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_SlvClkExtendTimeout_INT_Dis(__I2C__) CLEAR_BIT((__I2C__)->SMINTRMS, I2C_SLV_CLK_EXTND_TIMEOUT_INT_EN_Msk)
- /**
- * @brief Judge SMBUS is alert detect raw or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 SMBUS isn't alert detect raw
- * @retval 1 SMBUS is alert detect raw
- */
- #define __LL_I2C_SMBUS_IsAlertDetRaw(__I2C__) \
- (READ_BIT((__I2C__)->SMINTRRST, I2C_SMBUS_ALERT_DET_RAW_INT_STA_Msk) << I2C_SMBUS_ALERT_DET_RAW_INT_STA_Pos)
- /**
- * @brief Judge SMBUS is suspend detect raw or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 SMBUS isn't suspend detect raw
- * @retval 1 SMBUS is suspend detect raw
- */
- #define __LL_I2C_SMBUS_IsSuspendDetRaw(__I2C__) \
- (READ_BIT((__I2C__)->SMINTRRST, I2C_SMBUS_SUSPEND_DET_RAW_INT_STA_Msk) << I2C_SMBUS_SUSPEND_DET_RAW_INT_STA_Pos)
- /**
- * @brief Judge SMBUS is slave RX PEC NACK or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 SMBUS isn't slave RX PEC NACK
- * @retval 1 SMBUS is slave RX PEC NACK
- */
- #define __LL_I2C_SMBUS_IsSlvRxPecNackRaw(__I2C__) \
- (READ_BIT((__I2C__)->SMINTRRST, I2C_SLV_RX_PEC_NACK_RAW_INT_STA_Msk) << I2C_SLV_RX_PEC_NACK_RAW_INT_STA_Pos)
- /**
- * @brief Judge SMBUS is ARP assgn address cmd detect raw or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 SMBUS isn't ARP assgn address cmd detect raw
- * @retval 1 SMBUS is ARP assgn address cmd detect raw
- */
- #define __LL_I2C_SMBUS_IsARPAssgnAddrCmdDetRaw(__I2C__) \
- (READ_BIT((__I2C__)->SMINTRRST, I2C_ARP_ASSGN_ADDR_CMD_DET_RAW_INT_STA_Msk) << I2C_ARP_ASSGN_ADDR_CMD_DET_RAW_INT_STA_Pos)
- /**
- * @brief Judge SMBUS is ARP get UDID cmd detect raw or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 SMBUS isn't ARP get UDID cmd detect raw
- * @retval 1 SMBUS is ARP get UDID cmd detect raw
- */
- #define __LL_I2C_SMBUS_IsARPGetUdidCmdDetRaw(__I2C__) \
- (READ_BIT((__I2C__)->SMINTRRST, I2C_ARP_GET_UDID_CMD_DET_RAW_INT_STA_Msk) << I2C_ARP_GET_UDID_CMD_DET_RAW_INT_STA_Pos)
- /**
- * @brief Judge SMBUS is ARP reset cmd detect raw or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 SMBUS isn't ARP reset cmd detect raw
- * @retval 1 SMBUS is ARP reset cmd detect raw
- */
- #define __LL_I2C_SMBUS_IsARPRstCmdDetRaw(__I2C__) \
- (READ_BIT((__I2C__)->SMINTRRST, I2C_ARP_RST_CMD_DET_RAW_INT_STA_Msk) << I2C_ARP_RST_CMD_DET_RAW_INT_STA_Pos)
- /**
- * @brief Judge SMBUS is ARP prepare cmd detect raw or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 SMBUS isn't ARP prepare cmd detect raw
- * @retval 1 SMBUS is ARP prepare cmd detect raw
- */
- #define __LL_I2C_SMBUS_IsARPPrepareCmdDetRaw(__I2C__) \
- (READ_BIT((__I2C__)->SMINTRRST, I2C_ARP_PREPARE_CMD_DET_RAW_INT_STA_Msk) << I2C_ARP_PREPARE_CMD_DET_RAW_INT_STA_Pos)
- /**
- * @brief Judge SMBUS is host nofity mst detect raw or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 SMBUS isn't host nofity mst detect raw
- * @retval 1 SMBUS is host nofity mst detect raw
- */
- #define __LL_I2C_SMBUS_IsHostNotifyMstDetRaw(__I2C__) \
- (READ_BIT((__I2C__)->SMINTRRST, I2C_HOST_NOTIFY_MST_DET_RAW_INT_STA_Msk) << I2C_HOST_NOTIFY_MST_DET_RAW_INT_STA_Pos)
- /**
- * @brief Judge SMBUS is quick cmd detect raw or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 SMBUS isn't quick cmd detect raw
- * @retval 1 SMBUS is quick cmd detect raw
- */
- #define __LL_I2C_SMBUS_IsQuickCmdDetRaw(__I2C__) \
- (READ_BIT((__I2C__)->SMINTRRST, I2C_QUICK_CMD_DET_RAW_INT_STA_Msk) << I2C_QUICK_CMD_DET_RAW_INT_STA_Pos)
- /**
- * @brief Judge SMBUS is mst clock extend timeout or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 SMBUS isn't mst clock extend timeout
- * @retval 1 SMBUS is mst clock extend timeout
- */
- #define __LL_I2C_SMBUS_IsMstClkExtendTimeoutRaw(__I2C__) \
- (READ_BIT((__I2C__)->SMINTRRST, I2C_MST_CLK_EXTND_TIMEOUT_RAW_INT_STA_Msk) << I2C_MST_CLK_EXTND_TIMEOUT_RAW_INT_STA_Pos)
- /**
- * @brief Judge SMBUS is slave clock extend timeout or not
- * @param __I2C__ Specifies I2C peripheral
- * @retval 0 SMBUS isn't slave clock extend timeout
- * @retval 1 SMBUS is slave clock extend timeout
- */
- #define __LL_I2C_SMBUS_IsSlvClkExtendTimeoutRaw(__I2C__) \
- (READ_BIT((__I2C__)->SMINTRRST, I2C_SLV_CLK_EXTND_TIMEOUT_RAW_INT_STA_Msk) << I2C_SLV_CLK_EXTND_TIMEOUT_RAW_INT_STA_Pos)
- /**
- * @brief SMBUS alert detect raw interrupt status clear
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_AlertDetRawIntSta_Clr(__I2C__) SET_BIT((__I2C__)->SMINTRCR, I2C_CLR_SMBUS_ALERT_DET_Msk)
- /**
- * @brief SMBUS suspend detect raw interrupt status clear
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_SuspendDetRawIntSta_Clr(__I2C__) SET_BIT((__I2C__)->SMINTRCR, I2C_CLR_SMBUS_SUSPEND_DET_Msk)
- /**
- * @brief SMBUS slave RX PEC NACK raw interrupt status clear
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_SlvRxPecNackRawIntSta_Clr(__I2C__) SET_BIT((__I2C__)->SMINTRCR, I2C_CLR_SLV_RX_PEC_NACK_Msk)
- /**
- * @brief SMBUS ARP assgn addredd cmd detect raw interrupt status clear
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_ARPAssgnAddrCmdDetRawIntSta_Clr(__I2C__) SET_BIT((__I2C__)->SMINTRCR, I2C_CLR_ARP_ASSGN_ADDR_CMD_DET_Msk)
- /**
- * @brief SMBUS ARP get UDID cmd detect raw interrupt status clear
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_ARPUdidCmdDetRawIntSta_Clr(__I2C__) SET_BIT((__I2C__)->SMINTRCR, I2C_CLR_ARP_GET_UDID_CMD_DET_Msk)
- /**
- * @brief SMBUS ARP reset cmd detect raw interrupt status clear
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_ARPRstCmdDetRawIntSta_Clr(__I2C__) SET_BIT((__I2C__)->SMINTRCR, I2C_CLR_ARP_RST_CMD_DET_Msk)
- /**
- * @brief SMBUS ARP prepare cmd detect raw interrupt status clear
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_ARPPrepareCmdDetRawIntSta_Clr(__I2C__) SET_BIT((__I2C__)->SMINTRCR, I2C_CLR_ARP_PREPARE_CMD_DET_Msk)
- /**
- * @brief SMBUS host notify master detect raw interrupt status clear
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_HostNotifyMstDetRawIntSta_Clr(__I2C__) SET_BIT((__I2C__)->SMINTRCR, I2C_CLR_HOST_NOTIFY_MST_DET_Msk)
- /**
- * @brief SMBUS quick cmd detect raw interrupt status clear
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_QuickCmdDetRawIntSta_Clr(__I2C__) SET_BIT((__I2C__)->SMINTRCR, I2C_CLR_QUICK_CMD_DET_Msk)
- /**
- * @brief SMBUS master clock extend timeout raw interrupt status clear
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_MstClkExtendTimeoutRawIntSta_Clr(__I2C__) SET_BIT((__I2C__)->SMINTRCR, I2C_CLR_MST_CLOCK_EXTND_TIMEOUT_Msk)
- /**
- * @brief SMBUS Slave clock extend timeout raw interrupt status clear
- * @param __I2C__ Specifies I2C peripheral
- * @return None
- */
- #define __LL_I2C_SMBUS_SlvClkExtendTimeoutRawIntSta_Clr(__I2C__) SET_BIT((__I2C__)->SMINTRCR, I2C_CLR_SLV_CLOCK_EXTND_TIMEOUT_Msk)
- /**
- * @brief SMBUS optional SAR set
- * @param __I2C__ Specifies I2C peripheral
- * @param sar optional SAR
- * @return None
- */
- #define __LL_I2C_SMBUS_OptionalSAR_Set(__I2C__, sar) \
- MODIFY_REG((__I2C__)->SAROP, I2C_OPTIONAL_SAR_Msk, ((sar & 0x7fUL) << I2C_OPTIONAL_SAR_Pos))
- /**
- * @brief SMBUS ARP UDID LSB set
- * @param __I2C__ Specifies I2C peripheral
- * @param lsb SMBUS ARP UDID LSB
- * @return None
- */
- #define __LL_I2C_SMBUS_ARPUdidLsb_Set(__I2C__, lsb) \
- MODIFY_REG((__I2C__)->UDIDLSB, I2C_SMBUS_ARP_UDID_LSB_Msk, ((lsb & 0xffffffffUL) << I2C_SMBUS_ARP_UDID_LSB_Pos))
- /**
- * @}
- */
- /* Exported types ------------------------------------------------------------*/
- /** @defgroup I2C_LL_Exported_Types I2C LL Exported Types
- * @brief I2C LL Exported Types
- * @{
- */
- /**
- * @brief I2C role definition
- */
- typedef enum {
- I2C_ROLE_MASTER, /*!< I2C role master */
- I2C_ROLE_SLAVE, /*!< I2C role slave */
- } I2C_RoleETypeDef;
- /**
- * @brief I2C address bit definition
- */
- typedef enum {
- I2C_ADDR_7BIT, /*!< I2C address mode 7b */
- I2C_ADDR_10BIT, /*!< I2C address mode 10b */
- } I2C_AddrModeETypeDef;
- /**
- * @brief I2C memmory address size definition
- */
- typedef enum {
- I2C_MEMADDR_SIZE_INVALID = 0, /*!< memmory address size invalid */
- I2C_MEMADDR_SIZE_8BIT = 1, /*!< memmory address size 8bit */
- I2C_MEMADDR_SIZE_16BIT = 2, /*!< memmory address size 16bit */
- I2C_MEMADDR_SIZE_32BIT = 4, /*!< memmory address size 32bit */
- } I2C_MemAddrSizeETypeDef;
- /**
- * @brief I2C user config
- */
- typedef struct __I2C_UserCfgTypeDef {
- I2C_RoleETypeDef role; /*!< role */
- I2C_AddrModeETypeDef addr_mode; /*!< address mode */
- uint32_t baudrate; /*!< baudrate */
- uint16_t slave_addr; /*!< slave address */
- LL_FuncStatusETypeDef smbus_enable; /*!< smbus enable */
- uint32_t smbus_master_extend_clk; /*!< smbus master extend clk */
- uint32_t smbus_slaver_extend_clk; /*!< smbus slaver extend clk */
- } I2C_UserCfgTypeDef;
- /**
- * @brief I2C DMA Status
- */
- typedef enum {
- IIC_DMA_STATE_RESET = 0, /*!< DMA State Reset: not yet initialized or disabled */
- IIC_DMA_STATE_READY, /*!< DMA State Ready: initialized and ready for use */
- IIC_DMA_STATE_BUSY, /*!< DMA State Busy: process is ongoing */
- IIC_DMA_STATE_ERROR, /*!< DMA State Error: process is Error */
- IIC_DMA_STATE_FINISH, /*!< DMA State Finish: process has been finished */
- } I2C_DMAStatusTypeDef;
- /**
- * @brief I2C frame definition
- */
- typedef struct __I2C_FrameTypeDef {
- I2C_TypeDef *Instance; /*!< I2C Reg base address */
- uint16_t target_addr; /*!< target address */
- uint32_t mem_addr; /*!< memory address */
- I2C_MemAddrSizeETypeDef mem_addr_size; /*!< memory address size */
- uint8_t *buf; /*!< buffer pointer */
- uint32_t buf_len; /*!< buffer length */
- uint32_t command; /*!< smbus_command */
- uint16_t XferCount; /*!< I2C transfer counter */
- uint32_t clk_cnt; /*!< I2C sent clk to read */
- #ifdef LL_DMA_MODULE_ENABLED
- DMA_ChannelETypeDef dma_tx_ch; /*!< I2C Tx DMA Channel */
- DMA_ChannelETypeDef dma_rx_ch; /*!< I2C Rx DMA Channel */
- I2C_DMAStatusTypeDef TXdma_status; /*!< I2C DMA status */
- I2C_DMAStatusTypeDef RXdma_status; /*!< I2C DMA status */
- #endif
- } I2C_FrameTypeDef;
- /**
- * @}
- */
- /* Exported functions --------------------------------------------------------*/
- /** @addtogroup I2C_LL_Exported_Functions
- * @{
- */
- /** @addtogroup I2C_LL_Exported_Functions_Group1
- * @{
- */
- LL_StatusETypeDef LL_I2C_Init(I2C_TypeDef *Instance, I2C_UserCfgTypeDef *user_cfg);
- LL_StatusETypeDef LL_I2C_DeInit(I2C_TypeDef *Instance);
- void LL_I2C_MspInit(I2C_TypeDef *Instance);
- void LL_I2C_MspDeInit(I2C_TypeDef *Instance);
- /**
- * @}
- */
- /** @addtogroup I2C_LL_Exported_Functions_Group2
- * @{
- */
- uint32_t LL_I2C_MasterWrite_CPU(I2C_TypeDef *Instance, I2C_FrameTypeDef *frame);
- uint32_t LL_I2C_MasterRead_CPU(I2C_TypeDef *Instance, I2C_FrameTypeDef *frame);
- LL_StatusETypeDef LL_I2C_SlaveWrite_CPU(I2C_TypeDef *Instance, I2C_FrameTypeDef *frame, uint32_t Timeout);
- LL_StatusETypeDef LL_I2C_SlaveRead_CPU(I2C_TypeDef *Instance, I2C_FrameTypeDef *frame, uint32_t Timeout);
- uint32_t LL_SMBUS_MasterWrite_CPU(I2C_TypeDef *Instance, I2C_FrameTypeDef *frame);
- uint32_t LL_SMBUS_MasterRead_CPU(I2C_TypeDef *Instance, I2C_FrameTypeDef *frame);
- LL_StatusETypeDef LL_SMBUS_SlaveRead_CPU(I2C_TypeDef *Instance, I2C_FrameTypeDef *frame, uint32_t Timeout);
- LL_StatusETypeDef LL_SMBUS_SlaveWrite_CPU(I2C_TypeDef *Instance, I2C_FrameTypeDef *frame, uint32_t Timeout);
- LL_StatusETypeDef LL_I2C_MasterWrite_IT(I2C_TypeDef *Instance, I2C_FrameTypeDef *frame);
- LL_StatusETypeDef LL_I2C_SlaveWrite_IT(I2C_TypeDef *Instance, I2C_FrameTypeDef *frame);
- LL_StatusETypeDef LL_I2C_MasterRead_IT(I2C_TypeDef *Instance, I2C_FrameTypeDef *frame);
- LL_StatusETypeDef LL_I2C_SlaveRead_IT(I2C_TypeDef *Instance, I2C_FrameTypeDef *frame);
- LL_StatusETypeDef LL_SMBUS_MasterWrite_IT(I2C_TypeDef *Instance, I2C_FrameTypeDef *frame);
- LL_StatusETypeDef LL_SMBUS_MasterRead_IT(I2C_TypeDef *Instance, I2C_FrameTypeDef *frame);
- LL_StatusETypeDef LL_SMBUS_SlaveRead_IT(I2C_TypeDef *Instance, I2C_FrameTypeDef *frame);
- LL_StatusETypeDef LL_SMBUS_SlaveWrite_IT(I2C_TypeDef *Instance, I2C_FrameTypeDef *frame);
- #ifdef LL_DMA_MODULE_ENABLED
- LL_StatusETypeDef LL_I2C_MasterWrite_DMA(I2C_TypeDef *Instance, DMA_UserCfgTypeDef *dma_user_cfg,
- I2C_FrameTypeDef *frame, uint32_t Timeout);
- LL_StatusETypeDef LL_I2C_MasterRead_DMA(I2C_TypeDef *Instance, DMA_UserCfgTypeDef *dma_user_cfg,
- I2C_FrameTypeDef *frame, uint32_t Timeout);
- LL_StatusETypeDef LL_I2C_SlaveRead_DMA(I2C_TypeDef *Instance, DMA_UserCfgTypeDef *dma_user_cfg,
- I2C_FrameTypeDef *frame, uint32_t Timeout);
- LL_StatusETypeDef LL_I2C_SlaveWrite_DMA(I2C_TypeDef *Instance, DMA_UserCfgTypeDef *dma_user_cfg,
- I2C_FrameTypeDef *frame, uint32_t Timeout);
- LL_StatusETypeDef LL_SMBUS_MasterWrite_DMA(I2C_TypeDef *Instance, DMA_UserCfgTypeDef *dma_user_cfg,
- I2C_FrameTypeDef *frame, uint32_t Timeout);
- LL_StatusETypeDef LL_SMBUS_MasterRead_DMA(I2C_TypeDef *Instance, DMA_UserCfgTypeDef *dma_user_cfg,
- I2C_FrameTypeDef *frame, uint32_t Timeout);
- LL_StatusETypeDef LL_SMBUS_SlaveWrite_DMA(I2C_TypeDef *Instance, DMA_UserCfgTypeDef *dma_user_cfg,
- I2C_FrameTypeDef *frame, uint32_t Timeout);
- LL_StatusETypeDef LL_SMBUS_SlaveRead_DMA(I2C_TypeDef *Instance, DMA_UserCfgTypeDef *dma_user_cfg,
- I2C_FrameTypeDef *frame, uint32_t Timeout);
- #endif
- /**
- * @}
- */
- /** @addtogroup I2C_LL_Exported_Functions_Group3
- * @{
- */
- void LL_I2C_IRQHandler(I2C_TypeDef *Instance, I2C_FrameTypeDef *hi2c);
- void LL_I2C_SCLStuckAtLowCallback(I2C_TypeDef *Instance);
- void LL_I2C_MstOnHoldCallback(I2C_TypeDef *Instance);
- void LL_I2C_SlvRestartDetCallback(I2C_TypeDef *Instance);
- void LL_I2C_SlvGenCallCallback(I2C_TypeDef *Instance);
- void LL_I2C_StartDetCallback(I2C_TypeDef *Instance);
- void LL_I2C_StopDetCallback(I2C_TypeDef *Instance);
- void LL_I2C_ActivityCallback(I2C_TypeDef *Instance);
- void LL_I2C_SlvRxDoneCallback(I2C_TypeDef *Instance);
- void LL_I2C_TxAbortCallback(I2C_TypeDef *Instance);
- void LL_I2C_SlvReadReqCallback(I2C_TypeDef *Instance);
- void LL_I2C_TxEmptyCallback(I2C_TypeDef *Instance);
- void LL_I2C_TxOverCallback(I2C_TypeDef *Instance);
- void LL_I2C_RxFullCallback(I2C_TypeDef *Instance);
- void LL_I2C_RxOverCallback(I2C_TypeDef *Instance);
- void LL_I2C_RxUnderCallback(I2C_TypeDef *Instance);
- void LL_SMBUS_SlvClkExtTimeoutCallback(I2C_TypeDef *Instance);
- void LL_SMBUS_MstClkExtTimeoutCallback(I2C_TypeDef *Instance);
- /**
- * @}
- */
- /**
- * @}
- */
- /* Private types -------------------------------------------------------------*/
- /* Private variables ---------------------------------------------------------*/
- /* Private constants ---------------------------------------------------------*/
- /* Private macros ------------------------------------------------------------*/
- /* Private functions ---------------------------------------------------------*/
- #ifdef __cplusplus
- }
- #endif /* __cplusplus */
- #endif /* _TMF5XXX_LL_I2C_H_ */
- /**
- * @}
- */
- /**
- * @}
- */
- /************************* (C) COPYRIGHT Tai-Action *****END OF FILE***********/
|