openi2c1.c
来自「基於 c51/8051 的 nand Flash Memory HY27US08」· C语言 代码 · 共 34 行
C
34 行
#if defined(__PIC24F__)
#include <p24Fxxxx.h>
#endif
#include <i2c.h>
/******************************************************************************
* Function Name: OpenI2C1
* Description: This function configures the I2C module for enable bit,
* disable slew rate, SM bus input levels, SCL release,
* Intelligent Peripheral Management Interface enable,
* sleep mode, general call enable,acknowledge data bit,
* acknowledge sequence enable, receive enable, stop
* condition enable, restart condition enable and start
* condition enable. The Baud rate value is also configured
* Parameters: unsigned int : config1
* unsigned int : config2
* Return Value: void
*******************************************************************************/
#ifdef _I2C_V2_1
void OpenI2C1(unsigned int config1,unsigned int config2)
{
I2C1BRG = config2;
I2C1CON = config1;
}
#else
#warning "Does not build on this target"
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?