mirror of https://github.com/ARMmbed/mbed-os.git
				
				
				
			Add support I2C #3 (#ifdef I2C2) for target EFM32G11
							parent
							
								
									b635c024a4
								
							
						
					
					
						commit
						c685b6e242
					
				| 
						 | 
				
			
			@ -63,6 +63,11 @@ static uint8_t i2c_get_index(i2c_t *obj)
 | 
			
		|||
        case I2C_1:
 | 
			
		||||
            index = 1;
 | 
			
		||||
            break;
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef I2C2
 | 
			
		||||
        case I2C_2:
 | 
			
		||||
            index = 2;
 | 
			
		||||
            break;
 | 
			
		||||
#endif
 | 
			
		||||
        default:
 | 
			
		||||
            printf("I2C module not available.. Out of bound access.");
 | 
			
		||||
| 
						 | 
				
			
			@ -84,6 +89,11 @@ static CMU_Clock_TypeDef i2c_get_clock(i2c_t *obj)
 | 
			
		|||
        case I2C_1:
 | 
			
		||||
            clock = cmuClock_I2C1;
 | 
			
		||||
            break;
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef I2C2
 | 
			
		||||
        case I2C_2:
 | 
			
		||||
            clock = cmuClock_I2C2;
 | 
			
		||||
            break;
 | 
			
		||||
#endif
 | 
			
		||||
        default:
 | 
			
		||||
            printf("I2C module not available.. Out of bound access. (clock)");
 | 
			
		||||
| 
						 | 
				
			
			@ -175,6 +185,11 @@ void i2c_enable_interrupt(i2c_t *obj, uint32_t address, uint8_t enable)
 | 
			
		|||
        case 1:
 | 
			
		||||
            irq_number = I2C1_IRQn;
 | 
			
		||||
            break;
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef I2C2
 | 
			
		||||
        case 2:
 | 
			
		||||
            irq_number = I2C2_IRQn;
 | 
			
		||||
            break;
 | 
			
		||||
#endif
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue