I2C2 Class Reference

#include <i2c2.hpp>

Inheritance diagram for I2C2:
Collaboration diagram for I2C2:

Public Member Functions

bool init (unsigned int speedInKhz)
 Initializes I2C2 at the given. More...
 
- Public Member Functions inherited from I2C_Base
void handleInterrupt ()
 
uint8_t readReg (uint8_t deviceAddress, uint8_t registerAddress)
 
bool writeReg (uint8_t deviceAddress, uint8_t registerAddress, uint8_t value)
 
bool readRegisters (uint8_t deviceAddress, uint8_t firstReg, uint8_t *pData, uint32_t transferSize)
 
bool writeRegisters (uint8_t deviceAddress, uint8_t firstReg, uint8_t *pData, uint32_t transferSize)
 
bool checkDeviceResponse (uint8_t deviceAddress)
 

Friends

class SingletonTemplate< I2C2 >
 Friend class used for Singleton Template. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from SingletonTemplate< I2C2 >
static I2C2getInstance ()
 Public member to get instance of this SINGLETON class. More...
 
- Protected Member Functions inherited from I2C_Base
 I2C_Base (LPC_I2C_TypeDef *pI2CBaseAddr)
 
bool init (uint32_t pclk, uint32_t busRateInKhz)
 
void disableOperation ()
 
- Protected Member Functions inherited from SingletonTemplate< I2C2 >
 SingletonTemplate ()
 
- Static Protected Attributes inherited from SingletonTemplate< I2C2 >
static SingletonTemplatempSingletonInstance
 

Detailed Description

I2C2 Singleton Driver This is a thin wrapper around I2C_Base class and merely gives the base address of the I2C2 memory map.

Member Function Documentation

bool I2C2::init ( unsigned int  speedInKhz)

Initializes I2C2 at the given.

Parameters
speedInKhz

Before I2C is initialized, check to be sure that the I2C wires are logic "1" means that they are pulled high, otherwise there may be a short circuit.

I2C2 is on P0.10, and P0.11

I2C wires should be pulled high for normal operation, so if they are, initialize I2C otherwise disable operations on I2C since I2C has a likely hardware BUS fault such as:

  • I2C SDA/SCL with no pull-up
  • I2C SDA/SCL shorted to ground

Friends And Related Function Documentation

friend class SingletonTemplate< I2C2 >
friend

Friend class used for Singleton Template.


The documentation for this class was generated from the following files:
  • /var/www/html/SJSU-DEV-Linux/firmware/default/lib/L2_Drivers/i2c2.hpp
  • /var/www/html/SJSU-DEV-Linux/firmware/default/lib/L2_Drivers/src/i2c2.cpp