| 数据搜索系统,热门电子元器件搜索 |
|
AN1045 数据表(PDF) 9 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN1045 数据表(HTML) 9 Page - STMicroelectronics |
|
9 / 16 page ![]() 9/16 ST7 S/W IMPLEMENTATION OF I2C BUS MASTER /* MODEL => [static] type_name var_name; or #define */ void delay (unsigned char time) { #ifdef __HIWARE__ asm { nop /* Time is stored on the Accumulator automatically */ again: DEC A /* When the function is called. */ JRNE again /* (15+6*time) clock cycles */ } #else #ifdef __CSMC__ { _asm ("nop"); _asm("again: DEC A"); _asm(" JRNE again"); } #endif #endif } /*-------------------------------------------------------------------------- ROUTINE NAME : I2Cm_Start INPUT/OUTPUT : None. DESCRIPTION : Generates I2C-Bus Start Condition. COMMENTS : --------------------------------------------------------------------------*/ void I2Cm_Start (void) { ClrBit(PADDR,SDA); /* Configure SDA and SCL as floating input to have a high state */ ClrBit(PADDR,SCL); delay(10); SetBit(PADDR,SDA); /* Configure SDA as output open drain to have a low state */ delay(4); /* Waits 39 cycles=4.875µs at a Fcpu=8MHz to keep the high state on SCL */ SetBit(PADDR,SCL); /* Configure SCL as output open drain to have a low state */ delay(6); /* Delay to wait after a START */ } /*-------------------------------------------------------------------------- ROUTINE NAME : I2Cm_Stop |
|
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |