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/GpioBus/GpioBusOut.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 "GpioBusOut.h" |
andriym | 0:035111d3d631 | 3 | |
andriym | 0:035111d3d631 | 4 | GpioBusOut::GpioBusOut( |
andriym | 0:035111d3d631 | 5 | CompGpioExp &gpiop, |
andriym | 0:035111d3d631 | 6 | GpioPinName p0, GpioPinName p1, GpioPinName p2, GpioPinName p3, |
andriym | 0:035111d3d631 | 7 | GpioPinName p4, GpioPinName p5, GpioPinName p6, GpioPinName p7, |
andriym | 0:035111d3d631 | 8 | GpioPinName p8, GpioPinName p9, GpioPinName p10, GpioPinName p11, |
andriym | 0:035111d3d631 | 9 | GpioPinName p12, GpioPinName p13, GpioPinName p14, GpioPinName p15 ) |
andriym | 0:035111d3d631 | 10 | : |
andriym | 0:035111d3d631 | 11 | GpioBusInOut( gpiop, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15 ) |
andriym | 0:035111d3d631 | 12 | { |
andriym | 0:035111d3d631 | 13 | init(); |
andriym | 0:035111d3d631 | 14 | } |
andriym | 0:035111d3d631 | 15 | |
andriym | 0:035111d3d631 | 16 | GpioBusOut::GpioBusOut( CompGpioExp &gpiop, GpioPinName pins[ 16 ] ) |
andriym | 0:035111d3d631 | 17 | : GpioBusInOut( gpiop, pins ) |
andriym | 0:035111d3d631 | 18 | { |
andriym | 0:035111d3d631 | 19 | init(); |
andriym | 0:035111d3d631 | 20 | } |
andriym | 0:035111d3d631 | 21 | |
andriym | 0:035111d3d631 | 22 | GpioBusOut::~GpioBusOut() |
andriym | 0:035111d3d631 | 23 | { |
andriym | 0:035111d3d631 | 24 | } |
andriym | 0:035111d3d631 | 25 | |
andriym | 0:035111d3d631 | 26 | GpioBusOut& GpioBusOut::operator=( int rhs ) |
andriym | 0:035111d3d631 | 27 | { |
andriym | 0:035111d3d631 | 28 | write( rhs ); |
andriym | 0:035111d3d631 | 29 | return ( *this ); |
andriym | 0:035111d3d631 | 30 | } |
andriym | 0:035111d3d631 | 31 | |
andriym | 0:035111d3d631 | 32 | GpioBusOut& GpioBusOut::operator=( GpioBusOut& rhs ) |
andriym | 0:035111d3d631 | 33 | { |
andriym | 0:035111d3d631 | 34 | write( rhs.read() ); |
andriym | 0:035111d3d631 | 35 | return *this; |
andriym | 0:035111d3d631 | 36 | } |
andriym | 0:035111d3d631 | 37 | |
andriym | 0:035111d3d631 | 38 | void GpioBusOut::init( void ) |
andriym | 0:035111d3d631 | 39 | { |
andriym | 0:035111d3d631 | 40 | write( 0x0 ); |
andriym | 0:035111d3d631 | 41 | this->output(); |
andriym | 0:035111d3d631 | 42 | } |