The PCAL6416A is a low-voltage 16-bit general purpose I/O (GPIO) expander with interrupt. This component library is compatible to basic operation as GPIO expanders: PCAL6416A, PCAL9555, PCA9555, PCA9535, PCA9539, PCAL9554, PCA9554 and PCA9538. On addition to this, this library is including mbed-SDK-style APIs. APIs that similar to DigitaiInOut, DigitalOut, DigitalIn, BusInOUt, BusOut and BusIn are available.
GpioBusOut.cpp
00001 #include "mbed.h" 00002 #include "GpioBusOut.h" 00003 00004 GpioBusOut::GpioBusOut( 00005 CompGpioExp &gpiop, 00006 GpioPinName p0, GpioPinName p1, GpioPinName p2, GpioPinName p3, 00007 GpioPinName p4, GpioPinName p5, GpioPinName p6, GpioPinName p7, 00008 GpioPinName p8, GpioPinName p9, GpioPinName p10, GpioPinName p11, 00009 GpioPinName p12, GpioPinName p13, GpioPinName p14, GpioPinName p15 ) 00010 : 00011 GpioBusInOut( gpiop, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15 ) 00012 { 00013 init(); 00014 } 00015 00016 GpioBusOut::GpioBusOut( CompGpioExp &gpiop, GpioPinName pins[ 16 ] ) 00017 : GpioBusInOut( gpiop, pins ) 00018 { 00019 init(); 00020 } 00021 00022 GpioBusOut::~GpioBusOut() 00023 { 00024 } 00025 00026 GpioBusOut& GpioBusOut::operator=( int rhs ) 00027 { 00028 write( rhs ); 00029 return ( *this ); 00030 } 00031 00032 GpioBusOut& GpioBusOut::operator=( GpioBusOut& rhs ) 00033 { 00034 write( rhs.read() ); 00035 return *this; 00036 } 00037 00038 void GpioBusOut::init( void ) 00039 { 00040 write( 0x0 ); 00041 this->output(); 00042 }
Generated on Tue Jul 12 2022 14:15:36 by 1.7.2