Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of TCA9548A by
tca9548a.cpp
00001 /** 00002 * TCA9548A library 00003 * 00004 * @author Akash Vibhute 00005 * @author < akash . roboticist [at] gmail . com > 00006 * @version 0.1 00007 * @date May/24/2016 00008 */ 00009 00010 #include "tca9548a.h" 00011 00012 TCA9548A::TCA9548A( PinName sda, PinName scl, uint8_t i2c_address, PinName resetPin) : i2c_(sda, scl), reset_pin(resetPin) 00013 { 00014 i2c_addr = i2c_address; 00015 } 00016 00017 00018 void TCA9548A::select( uint8_t channel ) 00019 { 00020 if(channel >= 8) return; 00021 char data[1]; 00022 data[0] = 1 << channel; 00023 int err = i2c_.write(0xE0, data, 1); 00024 } 00025 00026 char TCA9548A::check_set_channel() 00027 { 00028 char data[1]; 00029 int err = i2c_.read(0xE1, data, 1); 00030 return data[0]; 00031 } 00032 00033 void TCA9548A::reset( ) 00034 { 00035 reset_pin = 0; 00036 wait_ms(1); 00037 reset_pin = 1; 00038 } 00039
Generated on Tue Jul 12 2022 22:50:20 by
1.7.2
