I2C_Public_Functions
[I2C]
Functions | |
void | I2C_SetClock (LPC_I2C_TypeDef *I2Cx, uint32_t target_clock) |
Setup clock rate for I2C peripheral. | |
void | I2C_DeInit (LPC_I2C_TypeDef *I2Cx) |
De-initializes the I2C peripheral registers to their default reset values. | |
void | I2C_Init (LPC_I2C_TypeDef *I2Cx, uint32_t clockrate) |
Initializes the I2Cx peripheral with specified parameter. | |
void | I2C_Cmd (LPC_I2C_TypeDef *I2Cx, FunctionalState NewState) |
Enable or disable I2C peripheral's operation. | |
Status | I2C_MasterTransferData (LPC_I2C_TypeDef *I2Cx, I2C_M_SETUP_Type *TransferCfg, I2C_TRANSFER_OPT_Type Opt) |
Transmit and Receive data in master mode. | |
Status | I2C_SlaveTransferData (LPC_I2C_TypeDef *I2Cx, I2C_S_SETUP_Type *TransferCfg, I2C_TRANSFER_OPT_Type Opt) |
Receive and Transmit data in slave mode. | |
void | I2C_SetOwnSlaveAddr (LPC_I2C_TypeDef *I2Cx, I2C_OWNSLAVEADDR_CFG_Type *OwnSlaveAddrConfigStruct) |
Set Own slave address in I2C peripheral corresponding to parameter specified in OwnSlaveAddrConfigStruct. | |
uint8_t | I2C_GetLastStatusCode (LPC_I2C_TypeDef *I2Cx) |
void | I2C_MonitorModeConfig (LPC_I2C_TypeDef *I2Cx, uint32_t MonitorCfgType, FunctionalState NewState) |
Configures functionality in I2C monitor mode. | |
void | I2C_MonitorModeCmd (LPC_I2C_TypeDef *I2Cx, FunctionalState NewState) |
Enable/Disable I2C monitor mode. | |
uint8_t | I2C_MonitorGetDatabuffer (LPC_I2C_TypeDef *I2Cx) |
Get data from I2C data buffer in monitor mode. | |
void | I2C0_StdIntHandler (void) |
Standard Interrupt handler for I2C0 peripheral. | |
void | I2C1_StdIntHandler (void) |
Standard Interrupt handler for I2C1 peripheral. | |
void | I2C2_StdIntHandler (void) |
Standard Interrupt handler for I2C2 peripheral. |
Function Documentation
void I2C0_StdIntHandler | ( | void | ) |
Standard Interrupt handler for I2C0 peripheral.
- Parameters:
-
[in] None
- Returns:
- None
Definition at line 1277 of file lpc17xx_i2c.c.
void I2C1_StdIntHandler | ( | void | ) |
Standard Interrupt handler for I2C1 peripheral.
- Parameters:
-
[in] None
- Returns:
- None
Definition at line 1287 of file lpc17xx_i2c.c.
void I2C2_StdIntHandler | ( | void | ) |
Standard Interrupt handler for I2C2 peripheral.
- Parameters:
-
[in] None
- Returns:
- None
Definition at line 1297 of file lpc17xx_i2c.c.
void I2C_Cmd | ( | LPC_I2C_TypeDef * | I2Cx, | |
FunctionalState | NewState | |||
) |
Enable or disable I2C peripheral's operation.
- Parameters:
-
[in] I2Cx I2C peripheral selected, should be I2C0, I2C1 or I2C2 [in] NewState New State of I2Cx peripheral's operation
- Returns:
- none
Definition at line 728 of file lpc17xx_i2c.c.
void I2C_DeInit | ( | LPC_I2C_TypeDef * | I2Cx | ) |
De-initializes the I2C peripheral registers to their default reset values.
- Parameters:
-
[in] I2Cx I2C peripheral selected, should be I2C0, I2C1 or I2C2
- Returns:
- None
Definition at line 650 of file lpc17xx_i2c.c.
uint8_t I2C_GetLastStatusCode | ( | LPC_I2C_TypeDef * | I2Cx | ) |
void I2C_Init | ( | LPC_I2C_TypeDef * | I2Cx, | |
uint32_t | clockrate | |||
) |
Initializes the I2Cx peripheral with specified parameter.
- Parameters:
-
[in] I2Cx I2C peripheral selected, should be I2C0, I2C1 or I2C2 [in] clockrate Target clock rate value to initialized I2C peripheral
- Returns:
- None
Definition at line 682 of file lpc17xx_i2c.c.
Status I2C_MasterTransferData | ( | LPC_I2C_TypeDef * | I2Cx, | |
I2C_M_SETUP_Type * | TransferCfg, | |||
I2C_TRANSFER_OPT_Type | Opt | |||
) |
Transmit and Receive data in master mode.
- Parameters:
-
[in] I2Cx I2C peripheral selected, should be I2C0, I2C1 or I2C2 [in] TransferCfg Pointer to a I2C_M_SETUP_Type structure that contains specified information about the configuration for master transfer. [in] Opt a I2C_TRANSFER_OPT_Type type that selected for interrupt or polling mode.
- Returns:
- SUCCESS or ERROR
- In case of using I2C to transmit data only, either transmit length set to 0 or transmit data pointer set to NULL.
- In case of using I2C to receive data only, either receive length set to 0 or receive data pointer set to NULL.
- In case of using I2C to transmit followed by receive data, transmit length, transmit data pointer, receive length and receive data pointer should be set corresponding.
Definition at line 763 of file lpc17xx_i2c.c.
uint8_t I2C_MonitorGetDatabuffer | ( | LPC_I2C_TypeDef * | I2Cx | ) |
Get data from I2C data buffer in monitor mode.
- Parameters:
-
[in] I2Cx I2C peripheral selected, should be I2C0, I2C1 or I2C2
- Returns:
- None Note: In monitor mode, the I2C module may lose the ability to stretch the clock (stall the bus) if the ENA_SCL bit is not set. This means that the processor will have a limited amount of time to read the contents of the data received on the bus. If the processor reads the I2DAT shift register, as it ordinarily would, it could have only one bit-time to respond to the interrupt before the received data is overwritten by new data.
Definition at line 1266 of file lpc17xx_i2c.c.
void I2C_MonitorModeCmd | ( | LPC_I2C_TypeDef * | I2Cx, | |
FunctionalState | NewState | |||
) |
Enable/Disable I2C monitor mode.
- Parameters:
-
[in] I2Cx I2C peripheral selected, should be I2C0, I2C1 or I2C2 [in] NewState New State of this function, should be: - ENABLE: Enable monitor mode.
- DISABLE: Disable monitor mode.
- Returns:
- None
Definition at line 1238 of file lpc17xx_i2c.c.
void I2C_MonitorModeConfig | ( | LPC_I2C_TypeDef * | I2Cx, | |
uint32_t | MonitorCfgType, | |||
FunctionalState | NewState | |||
) |
Configures functionality in I2C monitor mode.
- Parameters:
-
[in] I2Cx I2C peripheral selected, should be I2C0, I2C1 or I2C2 [in] MonitorCfgType Monitor Configuration type, should be: - I2C_MONITOR_CFG_SCL_OUTPUT: I2C module can 'stretch' the clock line (hold it low) until it has had time to respond to an I2C interrupt.
- I2C_MONITOR_CFG_MATCHALL: When this bit is set to '1' and the I2C is in monitor mode, an interrupt will be generated on ANY address received.
[in] NewState New State of this function, should be: - ENABLE: Enable this function.
- DISABLE: Disable this function.
- Returns:
- None
Definition at line 1213 of file lpc17xx_i2c.c.
void I2C_SetClock | ( | LPC_I2C_TypeDef * | I2Cx, | |
uint32_t | target_clock | |||
) |
Setup clock rate for I2C peripheral.
- Parameters:
-
[in] I2Cx I2C peripheral selected, should be I2C0, I2C1 or I2C2 [in] target_clock : clock of SSP (Hz)
- Returns:
- None
Definition at line 618 of file lpc17xx_i2c.c.
void I2C_SetOwnSlaveAddr | ( | LPC_I2C_TypeDef * | I2Cx, | |
I2C_OWNSLAVEADDR_CFG_Type * | OwnSlaveAddrConfigStruct | |||
) |
Set Own slave address in I2C peripheral corresponding to parameter specified in OwnSlaveAddrConfigStruct.
- Parameters:
-
[in] I2Cx I2C peripheral selected, should be I2C0, I2C1 or I2C2 [in] OwnSlaveAddrConfigStruct Pointer to a I2C_OWNSLAVEADDR_CFG_Type structure that contains the configuration information for the specified I2C slave address.
- Returns:
- None
Definition at line 1163 of file lpc17xx_i2c.c.
Status I2C_SlaveTransferData | ( | LPC_I2C_TypeDef * | I2Cx, | |
I2C_S_SETUP_Type * | TransferCfg, | |||
I2C_TRANSFER_OPT_Type | Opt | |||
) |
Receive and Transmit data in slave mode.
- Parameters:
-
[in] I2Cx I2C peripheral selected, should be I2C0, I2C1 or I2C2 [in] TransferCfg Pointer to a I2C_S_SETUP_Type structure that contains specified information about the configuration for master transfer. [in] Opt I2C_TRANSFER_OPT_Type type that selected for interrupt or polling mode.
- Returns:
- SUCCESS or ERROR
- In case of reading operation (from master): slave will return I2C_I2DAT_IDLE_CHAR value.
- In case of writing operation (from master): slave will ignore remain data from master.
Definition at line 973 of file lpc17xx_i2c.c.
Generated on Mon Feb 8 10:01:44 2010 for LPC1700CMSIS Standard Peripheral Firmware Library by
