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.
This is a copy of the PCA9555 library by Akifumi "Tedd" OKANO, which is compatible with PCAL6416A chip.
base_classes/CompGpioExp/GpioDigital/GpioDigitalOut.cpp@0:035111d3d631, 2017-02-15 (annotated)
- Committer:
- andriym
- Date:
- Wed Feb 15 10:07:59 2017 +0000
- Revision:
- 0:035111d3d631
A change of name for the PCAL955x library to make it searchable for people needing PCAL6416A library.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
andriym | 0:035111d3d631 | 1 | #include "mbed.h" |
andriym | 0:035111d3d631 | 2 | #include "GpioDigitalOut.h" |
andriym | 0:035111d3d631 | 3 | |
andriym | 0:035111d3d631 | 4 | GpioDigitalOut::GpioDigitalOut( CompGpioExp &gpiop, GpioPinName pin_name ) |
andriym | 0:035111d3d631 | 5 | : GpioDigitalInOut( gpiop, pin_name ) |
andriym | 0:035111d3d631 | 6 | { |
andriym | 0:035111d3d631 | 7 | write( 0 ); |
andriym | 0:035111d3d631 | 8 | this->output(); |
andriym | 0:035111d3d631 | 9 | } |
andriym | 0:035111d3d631 | 10 | |
andriym | 0:035111d3d631 | 11 | GpioDigitalOut::~GpioDigitalOut() |
andriym | 0:035111d3d631 | 12 | { |
andriym | 0:035111d3d631 | 13 | } |
andriym | 0:035111d3d631 | 14 | |
andriym | 0:035111d3d631 | 15 | GpioDigitalOut& GpioDigitalOut::operator=( int rhs ) |
andriym | 0:035111d3d631 | 16 | { |
andriym | 0:035111d3d631 | 17 | write( rhs ); |
andriym | 0:035111d3d631 | 18 | return ( *this ); |
andriym | 0:035111d3d631 | 19 | } |
andriym | 0:035111d3d631 | 20 | |
andriym | 0:035111d3d631 | 21 | GpioDigitalOut& GpioDigitalOut::operator=( GpioDigitalOut& rhs ) |
andriym | 0:035111d3d631 | 22 | { |
andriym | 0:035111d3d631 | 23 | write( rhs.read() ); |
andriym | 0:035111d3d631 | 24 | return *this; |
andriym | 0:035111d3d631 | 25 | } |