mirror of
https://github.com/tebl/RC6502-Apple-1-Replica.git
synced 2024-09-11 00:54:28 +00:00
Added MCP23S17 library to PlatformIO project
This commit is contained in:
parent
3f9d9af053
commit
ba325dcfe5
5
software/arduino/PIA Communicator/.gitignore
vendored
Normal file
5
software/arduino/PIA Communicator/.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
.pio
|
||||
.vscode/.browse.c_cpp.db*
|
||||
.vscode/c_cpp_properties.json
|
||||
.vscode/launch.json
|
||||
.vscode/ipch
|
67
software/arduino/PIA Communicator/.travis.yml
Normal file
67
software/arduino/PIA Communicator/.travis.yml
Normal file
@ -0,0 +1,67 @@
|
||||
# Continuous Integration (CI) is the practice, in software
|
||||
# engineering, of merging all developer working copies with a shared mainline
|
||||
# several times a day < https://docs.platformio.org/page/ci/index.html >
|
||||
#
|
||||
# Documentation:
|
||||
#
|
||||
# * Travis CI Embedded Builds with PlatformIO
|
||||
# < https://docs.travis-ci.com/user/integration/platformio/ >
|
||||
#
|
||||
# * PlatformIO integration with Travis CI
|
||||
# < https://docs.platformio.org/page/ci/travis.html >
|
||||
#
|
||||
# * User Guide for `platformio ci` command
|
||||
# < https://docs.platformio.org/page/userguide/cmd_ci.html >
|
||||
#
|
||||
#
|
||||
# Please choose one of the following templates (proposed below) and uncomment
|
||||
# it (remove "# " before each line) or use own configuration according to the
|
||||
# Travis CI documentation (see above).
|
||||
#
|
||||
|
||||
|
||||
#
|
||||
# Template #1: General project. Test it using existing `platformio.ini`.
|
||||
#
|
||||
|
||||
# language: python
|
||||
# python:
|
||||
# - "2.7"
|
||||
#
|
||||
# sudo: false
|
||||
# cache:
|
||||
# directories:
|
||||
# - "~/.platformio"
|
||||
#
|
||||
# install:
|
||||
# - pip install -U platformio
|
||||
# - platformio update
|
||||
#
|
||||
# script:
|
||||
# - platformio run
|
||||
|
||||
|
||||
#
|
||||
# Template #2: The project is intended to be used as a library with examples.
|
||||
#
|
||||
|
||||
# language: python
|
||||
# python:
|
||||
# - "2.7"
|
||||
#
|
||||
# sudo: false
|
||||
# cache:
|
||||
# directories:
|
||||
# - "~/.platformio"
|
||||
#
|
||||
# env:
|
||||
# - PLATFORMIO_CI_SRC=path/to/test/file.c
|
||||
# - PLATFORMIO_CI_SRC=examples/file.ino
|
||||
# - PLATFORMIO_CI_SRC=path/to/test/directory
|
||||
#
|
||||
# install:
|
||||
# - pip install -U platformio
|
||||
# - platformio update
|
||||
#
|
||||
# script:
|
||||
# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N
|
7
software/arduino/PIA Communicator/.vscode/extensions.json
vendored
Normal file
7
software/arduino/PIA Communicator/.vscode/extensions.json
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
||||
// for the documentation about the extensions.json format
|
||||
"recommendations": [
|
||||
"platformio.platformio-ide"
|
||||
]
|
||||
}
|
39
software/arduino/PIA Communicator/include/README
Normal file
39
software/arduino/PIA Communicator/include/README
Normal file
@ -0,0 +1,39 @@
|
||||
|
||||
This directory is intended for project header files.
|
||||
|
||||
A header file is a file containing C declarations and macro definitions
|
||||
to be shared between several project source files. You request the use of a
|
||||
header file in your project source file (C, C++, etc) located in `src` folder
|
||||
by including it, with the C preprocessing directive `#include'.
|
||||
|
||||
```src/main.c
|
||||
|
||||
#include "header.h"
|
||||
|
||||
int main (void)
|
||||
{
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
Including a header file produces the same results as copying the header file
|
||||
into each source file that needs it. Such copying would be time-consuming
|
||||
and error-prone. With a header file, the related declarations appear
|
||||
in only one place. If they need to be changed, they can be changed in one
|
||||
place, and programs that include the header file will automatically use the
|
||||
new version when next recompiled. The header file eliminates the labor of
|
||||
finding and changing all the copies as well as the risk that a failure to
|
||||
find one copy will result in inconsistencies within a program.
|
||||
|
||||
In C, the usual convention is to give header files names that end with `.h'.
|
||||
It is most portable to use only letters, digits, dashes, and underscores in
|
||||
header file names, and at most one dot.
|
||||
|
||||
Read more about using header files in official GCC documentation:
|
||||
|
||||
* Include Syntax
|
||||
* Include Operation
|
||||
* Once-Only Headers
|
||||
* Computed Includes
|
||||
|
||||
https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html
|
13
software/arduino/PIA Communicator/lib/MCP23S17/.gitignore
vendored
Normal file
13
software/arduino/PIA Communicator/lib/MCP23S17/.gitignore
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
# Compiled Object files
|
||||
*.slo
|
||||
*.lo
|
||||
*.o
|
||||
|
||||
# Compiled Dynamic libraries
|
||||
*.so
|
||||
*.dylib
|
||||
|
||||
# Compiled Static libraries
|
||||
*.lai
|
||||
*.la
|
||||
*.a
|
1890
software/arduino/PIA Communicator/lib/MCP23S17/Doxyfile
Normal file
1890
software/arduino/PIA Communicator/lib/MCP23S17/Doxyfile
Normal file
File diff suppressed because it is too large
Load Diff
29
software/arduino/PIA Communicator/lib/MCP23S17/LICENSE
Normal file
29
software/arduino/PIA Communicator/lib/MCP23S17/LICENSE
Normal file
@ -0,0 +1,29 @@
|
||||
Copyright (c) 2014, Majenko Technologies
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this
|
||||
list of conditions and the following disclaimer in the documentation and/or
|
||||
other materials provided with the distribution.
|
||||
|
||||
* Neither the name of Majenko Technologies nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
547
software/arduino/PIA Communicator/lib/MCP23S17/MCP23S17.cpp
Normal file
547
software/arduino/PIA Communicator/lib/MCP23S17/MCP23S17.cpp
Normal file
@ -0,0 +1,547 @@
|
||||
/*
|
||||
* Copyright (c) 2014, Majenko Technologies
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of Majenko Technologies nor the names of its contributors may be used
|
||||
* to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <MCP23S17.h>
|
||||
|
||||
/*! The constructor takes three parameters. The first is an SPI class
|
||||
* pointer. This is the address of an SPI object (either the default
|
||||
* SPI object on the Arduino, or an object made using the DSPIx classes
|
||||
* on the chipKIT). The second parameter is the chip select pin number
|
||||
* to use when communicating with the chip. The third is the internal
|
||||
* address number of the chip. This is controlled by the three Ax pins
|
||||
* on the chip.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
*
|
||||
* MCP23S17 myExpander(&SPI, 10, 0);
|
||||
*
|
||||
*/
|
||||
#ifdef __PIC32MX__
|
||||
MCP23S17::MCP23S17(DSPI *spi, uint8_t cs, uint8_t addr) {
|
||||
#else
|
||||
MCP23S17::MCP23S17(SPIClass *spi, uint8_t cs, uint8_t addr) {
|
||||
#endif
|
||||
_spi = spi;
|
||||
_cs = cs;
|
||||
_addr = addr;
|
||||
|
||||
_reg[IODIRA] = 0xFF;
|
||||
_reg[IODIRB] = 0xFF;
|
||||
_reg[IPOLA] = 0x00;
|
||||
_reg[IPOLB] = 0x00;
|
||||
_reg[GPINTENA] = 0x00;
|
||||
_reg[GPINTENB] = 0x00;
|
||||
_reg[DEFVALA] = 0x00;
|
||||
_reg[DEFVALB] = 0x00;
|
||||
_reg[INTCONA] = 0x00;
|
||||
_reg[INTCONB] = 0x00;
|
||||
_reg[IOCONA] = 0x18;
|
||||
_reg[IOCONB] = 0x18;
|
||||
_reg[GPPUA] = 0x00;
|
||||
_reg[GPPUB] = 0x00;
|
||||
_reg[INTFA] = 0x00;
|
||||
_reg[INTFB] = 0x00;
|
||||
_reg[INTCAPA] = 0x00;
|
||||
_reg[INTCAPB] = 0x00;
|
||||
_reg[GPIOA] = 0x00;
|
||||
_reg[GPIOB] = 0x00;
|
||||
_reg[OLATA] = 0x00;
|
||||
_reg[OLATB] = 0x00;
|
||||
}
|
||||
|
||||
#ifdef __PIC32MX__
|
||||
MCP23S17::MCP23S17(DSPI &spi, uint8_t cs, uint8_t addr) {
|
||||
#else
|
||||
MCP23S17::MCP23S17(SPIClass &spi, uint8_t cs, uint8_t addr) {
|
||||
#endif
|
||||
_spi = &spi;
|
||||
_cs = cs;
|
||||
_addr = addr;
|
||||
|
||||
_reg[IODIRA] = 0xFF;
|
||||
_reg[IODIRB] = 0xFF;
|
||||
_reg[IPOLA] = 0x00;
|
||||
_reg[IPOLB] = 0x00;
|
||||
_reg[GPINTENA] = 0x00;
|
||||
_reg[GPINTENB] = 0x00;
|
||||
_reg[DEFVALA] = 0x00;
|
||||
_reg[DEFVALB] = 0x00;
|
||||
_reg[INTCONA] = 0x00;
|
||||
_reg[INTCONB] = 0x00;
|
||||
_reg[IOCONA] = 0x18;
|
||||
_reg[IOCONB] = 0x18;
|
||||
_reg[GPPUA] = 0x00;
|
||||
_reg[GPPUB] = 0x00;
|
||||
_reg[INTFA] = 0x00;
|
||||
_reg[INTFB] = 0x00;
|
||||
_reg[INTCAPA] = 0x00;
|
||||
_reg[INTCAPB] = 0x00;
|
||||
_reg[GPIOA] = 0x00;
|
||||
_reg[GPIOB] = 0x00;
|
||||
_reg[OLATA] = 0x00;
|
||||
_reg[OLATB] = 0x00;
|
||||
}
|
||||
|
||||
/*! The begin function performs the initial configuration of the IO expander chip.
|
||||
* Not only does it set up the SPI communications, but it also configures the chip
|
||||
* for address-based communication and sets the default parameters and registers
|
||||
* to sensible values.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* myExpander.begin();
|
||||
*
|
||||
*/
|
||||
void MCP23S17::begin() {
|
||||
_spi->begin();
|
||||
::pinMode(_cs, OUTPUT);
|
||||
::digitalWrite(_cs, HIGH);
|
||||
uint8_t cmd = 0b01000000;
|
||||
::digitalWrite(_cs, LOW);
|
||||
_spi->transfer(cmd);
|
||||
_spi->transfer(IOCONA);
|
||||
_spi->transfer(0x18);
|
||||
::digitalWrite(_cs, HIGH);
|
||||
writeAll();
|
||||
}
|
||||
|
||||
/*! This private function reads a value from the specified register on the chip and
|
||||
* stores it in the _reg array for later usage.
|
||||
*/
|
||||
void MCP23S17::readRegister(uint8_t addr) {
|
||||
if (addr > 21) {
|
||||
return;
|
||||
}
|
||||
uint8_t cmd = 0b01000001 | ((_addr & 0b111) << 1);
|
||||
::digitalWrite(_cs, LOW);
|
||||
_spi->transfer(cmd);
|
||||
_spi->transfer(addr);
|
||||
_reg[addr] = _spi->transfer(0xFF);
|
||||
::digitalWrite(_cs, HIGH);
|
||||
}
|
||||
|
||||
/*! This private function writes the current value of a register (as stored in the
|
||||
* _reg array) out to the register in the chip.
|
||||
*/
|
||||
void MCP23S17::writeRegister(uint8_t addr) {
|
||||
if (addr > 21) {
|
||||
return;
|
||||
}
|
||||
uint8_t cmd = 0b01000000 | ((_addr & 0b111) << 1);
|
||||
::digitalWrite(_cs, LOW);
|
||||
_spi->transfer(cmd);
|
||||
_spi->transfer(addr);
|
||||
_spi->transfer(_reg[addr]);
|
||||
::digitalWrite(_cs, HIGH);
|
||||
}
|
||||
|
||||
/*! This private function performs a bulk read on all the registers in the chip to
|
||||
* ensure the _reg array contains all the correct current values.
|
||||
*/
|
||||
void MCP23S17::readAll() {
|
||||
uint8_t cmd = 0b01000001 | ((_addr & 0b111) << 1);
|
||||
::digitalWrite(_cs, LOW);
|
||||
_spi->transfer(cmd);
|
||||
_spi->transfer(0);
|
||||
for (uint8_t i = 0; i < 22; i++) {
|
||||
_reg[i] = _spi->transfer(0xFF);
|
||||
}
|
||||
::digitalWrite(_cs, HIGH);
|
||||
}
|
||||
|
||||
/*! This private function performs a bulk write of all the data in the _reg array
|
||||
* out to all the registers on the chip. It is mainly used during the initialisation
|
||||
* of the chip.
|
||||
*/
|
||||
void MCP23S17::writeAll() {
|
||||
uint8_t cmd = 0b01000000 | ((_addr & 0b111) << 1);
|
||||
::digitalWrite(_cs, LOW);
|
||||
_spi->transfer(cmd);
|
||||
_spi->transfer(0);
|
||||
for (uint8_t i = 0; i < 22; i++) {
|
||||
_spi->transfer(_reg[i]);
|
||||
}
|
||||
::digitalWrite(_cs, HIGH);
|
||||
}
|
||||
|
||||
/*! Just like the pinMode() function of the Arduino API, this function sets the
|
||||
* direction of the pin. The first parameter is the pin nimber (0-15) to use,
|
||||
* and the second parameter is the direction of the pin. There are standard
|
||||
* Arduino macros for different modes which should be used. The supported macros are:
|
||||
*
|
||||
* * OUTPUT
|
||||
* * INPUT
|
||||
* * INPUT_PULLUP
|
||||
*
|
||||
* The INPUT_PULLUP mode enables the weak pullup that is available on any pin.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* myExpander.pinMode(5, INPUT_PULLUP);
|
||||
*/
|
||||
void MCP23S17::pinMode(uint8_t pin, uint8_t mode) {
|
||||
if (pin >= 16) {
|
||||
return;
|
||||
}
|
||||
uint8_t dirReg = IODIRA;
|
||||
uint8_t puReg = GPPUA;
|
||||
if (pin >= 8) {
|
||||
pin -= 8;
|
||||
dirReg = IODIRB;
|
||||
puReg = GPPUB;
|
||||
}
|
||||
|
||||
switch (mode) {
|
||||
case OUTPUT:
|
||||
_reg[dirReg] &= ~(1<<pin);
|
||||
writeRegister(dirReg);
|
||||
break;
|
||||
|
||||
case INPUT:
|
||||
case INPUT_PULLUP:
|
||||
_reg[dirReg] |= (1<<pin);
|
||||
writeRegister(dirReg);
|
||||
if (mode == INPUT_PULLUP) {
|
||||
_reg[puReg] |= (1<<pin);
|
||||
} else {
|
||||
_reg[puReg] &= ~(1<<pin);
|
||||
}
|
||||
writeRegister(puReg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*! Like the Arduino API's namesake, this function will set an output pin to a specific
|
||||
* value, either HIGH (1) or LOW (0). If the pin is currently set to an INPUT instead of
|
||||
* an OUTPUT, then this function acts like the old way of enabling / disabling the pullup
|
||||
* resistor, which pre-1.0.0 versions of the Arduino API used - i.e., set HIGH to enable the
|
||||
* pullup, or LOW to disable it.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* myExpander.digitalWrite(3, HIGH);
|
||||
*/
|
||||
void MCP23S17::digitalWrite(uint8_t pin, uint8_t value) {
|
||||
if (pin >= 16) {
|
||||
return;
|
||||
}
|
||||
uint8_t dirReg = IODIRA;
|
||||
uint8_t puReg = GPPUA;
|
||||
uint8_t latReg = OLATA;
|
||||
if (pin >= 8) {
|
||||
pin -= 8;
|
||||
dirReg = IODIRB;
|
||||
puReg = GPPUB;
|
||||
latReg = OLATB;
|
||||
}
|
||||
|
||||
uint8_t mode = (_reg[dirReg] & (1<<pin)) == 0 ? OUTPUT : INPUT;
|
||||
|
||||
switch (mode) {
|
||||
case OUTPUT:
|
||||
if (value == 0) {
|
||||
_reg[latReg] &= ~(1<<pin);
|
||||
} else {
|
||||
_reg[latReg] |= (1<<pin);
|
||||
}
|
||||
writeRegister(latReg);
|
||||
break;
|
||||
|
||||
case INPUT:
|
||||
if (value == 0) {
|
||||
_reg[puReg] &= ~(1<<pin);
|
||||
} else {
|
||||
_reg[puReg] |= (1<<pin);
|
||||
}
|
||||
writeRegister(puReg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*! This will return the current state of a pin set to INPUT, or the last
|
||||
* value written to a pin set to OUTPUT.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* byte value = myExpander.digitalRead(4);
|
||||
*/
|
||||
uint8_t MCP23S17::digitalRead(uint8_t pin) {
|
||||
if (pin >= 16) {
|
||||
return 0;
|
||||
}
|
||||
uint8_t dirReg = IODIRA;
|
||||
uint8_t portReg = GPIOA;
|
||||
uint8_t latReg = OLATA;
|
||||
if (pin >= 8) {
|
||||
pin -= 8;
|
||||
dirReg = IODIRB;
|
||||
portReg = GPIOB;
|
||||
latReg = OLATB;
|
||||
}
|
||||
|
||||
uint8_t mode = (_reg[dirReg] & (1<<pin)) == 0 ? OUTPUT : INPUT;
|
||||
|
||||
switch (mode) {
|
||||
case OUTPUT:
|
||||
return _reg[latReg] & (1<<pin) ? HIGH : LOW;
|
||||
case INPUT:
|
||||
readRegister(portReg);
|
||||
return _reg[portReg] & (1<<pin) ? HIGH : LOW;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*! This function returns the entire 8-bit value of a GPIO port. Note that
|
||||
* only the bits which correspond to a GPIO pin set to INPUT are valid.
|
||||
* Other pins should be ignored. The only parameter defines which port (A/B)
|
||||
* to retrieve: 0 is port A and 1 (or anything other than 0) is port B.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* byte portA = myExpander.readPort(0);
|
||||
*/
|
||||
uint8_t MCP23S17::readPort(uint8_t port) {
|
||||
if (port == 0) {
|
||||
readRegister(GPIOA);
|
||||
return _reg[GPIOA];
|
||||
} else {
|
||||
readRegister(GPIOB);
|
||||
return _reg[GPIOB];
|
||||
}
|
||||
}
|
||||
|
||||
/*! This is a full 16-bit version of the parameterised readPort function. This
|
||||
* version reads the value of both ports and combines them into a single 16-bit
|
||||
* value.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* unsigned int value = myExpander.readPort();
|
||||
*/
|
||||
uint16_t MCP23S17::readPort() {
|
||||
readRegister(GPIOA);
|
||||
readRegister(GPIOB);
|
||||
return (_reg[GPIOB] << 8) | _reg[GPIOA];
|
||||
}
|
||||
|
||||
/*! This writes an 8-bit value to one of the two IO port banks (A/B) on the chip.
|
||||
* The value is output direct to any pins on that bank that are set as OUTPUT. Any
|
||||
* bits that correspond to pins set to INPUT are ignored. As with the readPort
|
||||
* function the first parameter defines which bank to use (0 = A, 1+ = B).
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* myExpander.writePort(0, 0x55);
|
||||
*/
|
||||
void MCP23S17::writePort(uint8_t port, uint8_t val) {
|
||||
if (port == 0) {
|
||||
_reg[OLATA] = val;
|
||||
writeRegister(OLATA);
|
||||
} else {
|
||||
_reg[OLATB] = val;
|
||||
writeRegister(OLATB);
|
||||
}
|
||||
}
|
||||
|
||||
/*! This is the 16-bit version of the writePort function. This takes a single
|
||||
* 16-bit value and splits it between the two IO ports, the upper half going to
|
||||
* port B and the lower to port A.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* myExpander.writePort(0x55AA);
|
||||
*/
|
||||
void MCP23S17::writePort(uint16_t val) {
|
||||
_reg[OLATB] = val >> 8;
|
||||
_reg[OLATA] = val & 0xFF;
|
||||
writeRegister(OLATA);
|
||||
writeRegister(OLATB);
|
||||
}
|
||||
|
||||
/*! This enables the interrupt functionality of a pin. The interrupt type can be one of:
|
||||
*
|
||||
* * CHANGE
|
||||
* * RISING
|
||||
* * FALLING
|
||||
*
|
||||
* When an interrupt occurs the corresponding port's INT pin will be driven to it's configured
|
||||
* level, and will remain there until either the port is read with a readPort or digitalRead, or the
|
||||
* captured port status at the time of the interrupt is read using getInterruptValue.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* myExpander.enableInterrupt(4, RISING);
|
||||
*/
|
||||
void MCP23S17::enableInterrupt(uint8_t pin, uint8_t type) {
|
||||
if (pin >= 16) {
|
||||
return;
|
||||
}
|
||||
uint8_t intcon = INTCONA;
|
||||
uint8_t defval = DEFVALA;
|
||||
uint8_t gpinten = GPINTENA;
|
||||
|
||||
if (pin >= 8) {
|
||||
pin -= 8;
|
||||
intcon = INTCONB;
|
||||
defval = DEFVALB;
|
||||
gpinten = GPINTENB;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case CHANGE:
|
||||
_reg[intcon] &= ~(1<<pin);
|
||||
break;
|
||||
case RISING:
|
||||
_reg[intcon] |= (1<<pin);
|
||||
_reg[defval] &= ~(1<<pin);
|
||||
break;
|
||||
case FALLING:
|
||||
_reg[intcon] |= (1<<pin);
|
||||
_reg[defval] |= (1<<pin);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
_reg[gpinten] |= (1<<pin);
|
||||
|
||||
writeRegister(intcon);
|
||||
writeRegister(defval);
|
||||
writeRegister(gpinten);
|
||||
}
|
||||
|
||||
/*! This disables the interrupt functionality of a pin.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* myExpander.disableInterrupt(4);
|
||||
*/
|
||||
void MCP23S17::disableInterrupt(uint8_t pin) {
|
||||
if (pin >= 16) {
|
||||
return;
|
||||
}
|
||||
uint8_t gpinten = GPINTENA;
|
||||
|
||||
if (pin >= 8) {
|
||||
pin -= 8;
|
||||
gpinten = GPINTENB;
|
||||
}
|
||||
|
||||
_reg[gpinten] &= ~(1<<pin);
|
||||
writeRegister(gpinten);
|
||||
}
|
||||
|
||||
/*! The two IO banks can have their INT pins connected together.
|
||||
* This enables you to monitor both banks with just one interrupt pin
|
||||
* on the host microcontroller. Calling setMirror with a parameter of
|
||||
* *true* will enable this feature. Calling it with *false* will disable
|
||||
* it.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* myExpander.setMirror(true);
|
||||
*/
|
||||
void MCP23S17::setMirror(boolean m) {
|
||||
if (m) {
|
||||
_reg[IOCONA] |= (1<<6);
|
||||
_reg[IOCONB] |= (1<<6);
|
||||
} else {
|
||||
_reg[IOCONA] &= ~(1<<6);
|
||||
_reg[IOCONB] &= ~(1<<6);
|
||||
}
|
||||
writeRegister(IOCONA);
|
||||
}
|
||||
|
||||
/*! This function returns a 16-bit bitmap of the the pin or pins that have cause an interrupt to fire.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* unsigned int pins = myExpander.getInterruptPins();
|
||||
*/
|
||||
uint16_t MCP23S17::getInterruptPins() {
|
||||
readRegister(INTFA);
|
||||
readRegister(INTFB);
|
||||
|
||||
return (_reg[INTFB] << 8) | _reg[INTFA];
|
||||
}
|
||||
|
||||
/*! This returns a snapshot of the IO pin states at the moment the last interrupt occured. Reading
|
||||
* this value clears the interrupt status (and hence the INT pins) for the whole chip.
|
||||
* Until this value is read (or the current live port value is read) no further interrupts can
|
||||
* be indicated.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* unsigned int pinValues = myExpander.getInterruptPins();
|
||||
*/
|
||||
uint16_t MCP23S17::getInterruptValue() {
|
||||
readRegister(INTCAPA);
|
||||
readRegister(INTCAPB);
|
||||
|
||||
return (_reg[INTCAPB] << 8) | _reg[INTCAPA];
|
||||
}
|
||||
|
||||
/*! This sets the "active" level for an interrupt. HIGH means the interrupt pin
|
||||
* will go HIGH when an interrupt occurs, LOW means it will go LOW.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* myExpander.setInterruptLevel(HIGH);
|
||||
*/
|
||||
void MCP23S17::setInterruptLevel(uint8_t level) {
|
||||
if (level == LOW) {
|
||||
_reg[IOCONA] &= ~(1<<1);
|
||||
_reg[IOCONB] &= ~(1<<1);
|
||||
} else {
|
||||
_reg[IOCONA] |= (1<<1);
|
||||
_reg[IOCONB] |= (1<<1);
|
||||
}
|
||||
writeRegister(IOCONA);
|
||||
}
|
||||
|
||||
/*! Using this function it is possible to configure the interrupt output pins to be open
|
||||
* drain. This means that interrupt pins from multiple chips can share the same interrupt
|
||||
* pin on the host MCU. This causes the level set by setInterruptLevel to be ignored. A
|
||||
* pullup resistor will be required on the host MCU's interrupt pin.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* myExpander.setInterruptOD(true);
|
||||
*/
|
||||
void MCP23S17::setInterruptOD(boolean openDrain) {
|
||||
if (openDrain) {
|
||||
_reg[IOCONA] |= (1<<2);
|
||||
_reg[IOCONB] |= (1<<2);
|
||||
} else {
|
||||
_reg[IOCONA] &= ~(1<<2);
|
||||
_reg[IOCONB] &= ~(1<<2);
|
||||
}
|
||||
writeRegister(IOCONA);
|
||||
}
|
104
software/arduino/PIA Communicator/lib/MCP23S17/MCP23S17.h
Normal file
104
software/arduino/PIA Communicator/lib/MCP23S17/MCP23S17.h
Normal file
@ -0,0 +1,104 @@
|
||||
/*
|
||||
* Copyright (c) , Majenko Technologies
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of Majenko Technologies nor the names of its contributors may be used
|
||||
* to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _MCP23S17_H
|
||||
#define _MCP23S17_H
|
||||
|
||||
#if (ARDUINO >= 100)
|
||||
# include <Arduino.h>
|
||||
#else
|
||||
# include <WProgram.h>
|
||||
#endif
|
||||
|
||||
#ifdef __PIC32MX__
|
||||
#include <DSPI.h>
|
||||
#else
|
||||
#include <SPI.h>
|
||||
#endif
|
||||
|
||||
class MCP23S17 {
|
||||
private:
|
||||
#ifdef __PIC32MX__
|
||||
DSPI *_spi; /*! This points to a valid SPI object created from the chipKIT DSPI library. */
|
||||
#else
|
||||
SPIClass *_spi; /*! This points to a valid SPI object created from the Arduino SPI library. */
|
||||
#endif
|
||||
uint8_t _cs; /*! Chip select pin */
|
||||
uint8_t _addr; /*! 3-bit chip address */
|
||||
|
||||
uint8_t _reg[22]; /*! Local mirrors of the 22 internal registers of the MCP23S17 chip */
|
||||
|
||||
enum {
|
||||
IODIRA, IODIRB,
|
||||
IPOLA, IPOLB,
|
||||
GPINTENA, GPINTENB,
|
||||
DEFVALA, DEFVALB,
|
||||
INTCONA, INTCONB,
|
||||
IOCONA, IOCONB,
|
||||
GPPUA, GPPUB,
|
||||
INTFA, INTFB,
|
||||
INTCAPA, INTCAPB,
|
||||
GPIOA, GPIOB,
|
||||
OLATA, OLATB
|
||||
};
|
||||
|
||||
void readRegister(uint8_t addr);
|
||||
void writeRegister(uint8_t addr);
|
||||
void readAll();
|
||||
void writeAll();
|
||||
|
||||
public:
|
||||
#ifdef __PIC32MX__
|
||||
MCP23S17(DSPI *spi, uint8_t cs, uint8_t addr);
|
||||
MCP23S17(DSPI &spi, uint8_t cs, uint8_t addr);
|
||||
#else
|
||||
MCP23S17(SPIClass *spi, uint8_t cs, uint8_t addr);
|
||||
MCP23S17(SPIClass &spi, uint8_t cs, uint8_t addr);
|
||||
#endif
|
||||
void begin();
|
||||
void pinMode(uint8_t pin, uint8_t mode);
|
||||
void digitalWrite(uint8_t pin, uint8_t value);
|
||||
uint8_t digitalRead(uint8_t pin);
|
||||
|
||||
uint8_t readPort(uint8_t port);
|
||||
uint16_t readPort();
|
||||
void writePort(uint8_t port, uint8_t val);
|
||||
void writePort(uint16_t val);
|
||||
void enableInterrupt(uint8_t pin, uint8_t type);
|
||||
void disableInterrupt(uint8_t pin);
|
||||
void setMirror(boolean m);
|
||||
uint16_t getInterruptPins();
|
||||
uint16_t getInterruptValue();
|
||||
void setInterruptLevel(uint8_t level);
|
||||
void setInterruptOD(boolean openDrain);
|
||||
|
||||
};
|
||||
#endif
|
4
software/arduino/PIA Communicator/lib/MCP23S17/README.md
Normal file
4
software/arduino/PIA Communicator/lib/MCP23S17/README.md
Normal file
@ -0,0 +1,4 @@
|
||||
MCP23S17
|
||||
========
|
||||
|
||||
Arduino library for MCP23S17 IO Expanders
|
1
software/arduino/PIA Communicator/lib/MCP23S17/debian/.gitignore
vendored
Normal file
1
software/arduino/PIA Communicator/lib/MCP23S17/debian/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
changelog
|
@ -0,0 +1 @@
|
||||
8
|
@ -0,0 +1,13 @@
|
||||
Source: libmcp23s17
|
||||
Section: libraries
|
||||
Priority: extra
|
||||
XBSC-Group: IO
|
||||
Maintainer: Matt Jenkins <matt@majenko.co.uk>
|
||||
Build-Depends: debhelper (>= 8.0.0)
|
||||
Standards-Version: 3.9.4
|
||||
|
||||
Package: libmcp23s17
|
||||
Provides: MCP23S17.h
|
||||
Architecture: all
|
||||
Description: MCP23S17 library
|
||||
|
@ -0,0 +1,40 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
my $package = "unknown";
|
||||
|
||||
my $maj = 0;
|
||||
my $min = 0;
|
||||
|
||||
my $out = "";
|
||||
|
||||
open (CONTROL, "<debian/control");
|
||||
while (my $l = <CONTROL>) {
|
||||
chomp($l);
|
||||
if ($l =~ /Source: (.*)/) {
|
||||
$package = $1;
|
||||
}
|
||||
}
|
||||
close(CONTROL);
|
||||
|
||||
open(LOG, "git log --reverse --pretty=format:'%aN|%aE|%cD|%s'|");
|
||||
while (my $l = <LOG>) {
|
||||
chomp($l);
|
||||
my ($author, $email, $time, $subject) = split(/\|/, $l);
|
||||
my $add = "$package (1.$maj.$min) uecide; urgency=low\n";
|
||||
$add .= "\n";
|
||||
$add .= " * $subject\n";
|
||||
$add .= "\n";
|
||||
$add .= " -- $author <$email> $time\n";
|
||||
$add .= "\n";
|
||||
$min++;
|
||||
if ($min == 10) {
|
||||
$min = 0;
|
||||
$maj++;
|
||||
}
|
||||
$out = $add . $out;
|
||||
}
|
||||
close(LOG);
|
||||
|
||||
open(CL, ">debian/changelog");
|
||||
print CL $out;
|
||||
close(CL);
|
@ -0,0 +1,113 @@
|
||||
Doxyfile libraries/IO/MCP23S17/
|
||||
LICENSE usr/share/doc/libmcp23s17/
|
||||
MCP23S17.cpp libraries/IO/MCP23S17/
|
||||
MCP23S17.h libraries/IO/MCP23S17/
|
||||
README.md usr/share/doc/libmcp23s17/
|
||||
examples/Expander32/EchoInput/EchoInput.ino libraries/IO/MCP23S17/examples/Expander32/EchoInput
|
||||
html/jquery.js libraries/IO/MCP23S17/html
|
||||
html/bdwn.png libraries/IO/MCP23S17/html
|
||||
html/annotated.html libraries/IO/MCP23S17/html
|
||||
html/ftv2doc.png libraries/IO/MCP23S17/html
|
||||
html/ftv2pnode.png libraries/IO/MCP23S17/html
|
||||
html/tab_a.png libraries/IO/MCP23S17/html
|
||||
html/ftv2mlastnode.png libraries/IO/MCP23S17/html
|
||||
html/MCP23S17_8h_source.html libraries/IO/MCP23S17/html
|
||||
html/ftv2plastnode.png libraries/IO/MCP23S17/html
|
||||
html/sync_on.png libraries/IO/MCP23S17/html
|
||||
html/open.png libraries/IO/MCP23S17/html
|
||||
html/doxygen.png libraries/IO/MCP23S17/html
|
||||
html/ftv2splitbar.png libraries/IO/MCP23S17/html
|
||||
html/tab_b.png libraries/IO/MCP23S17/html
|
||||
html/closed.png libraries/IO/MCP23S17/html
|
||||
html/doxygen.css libraries/IO/MCP23S17/html
|
||||
html/nav_g.png libraries/IO/MCP23S17/html
|
||||
html/classes.html libraries/IO/MCP23S17/html
|
||||
html/nav_f.png libraries/IO/MCP23S17/html
|
||||
html/ftv2blank.png libraries/IO/MCP23S17/html
|
||||
html/nav_h.png libraries/IO/MCP23S17/html
|
||||
html/ftv2node.png libraries/IO/MCP23S17/html
|
||||
html/classMCP23S17.html libraries/IO/MCP23S17/html
|
||||
html/files.html libraries/IO/MCP23S17/html
|
||||
html/ftv2folderclosed.png libraries/IO/MCP23S17/html
|
||||
html/ftv2link.png libraries/IO/MCP23S17/html
|
||||
html/sync_off.png libraries/IO/MCP23S17/html
|
||||
html/dynsections.js libraries/IO/MCP23S17/html
|
||||
html/classMCP23S17-members.html libraries/IO/MCP23S17/html
|
||||
html/tabs.css libraries/IO/MCP23S17/html
|
||||
html/index.html libraries/IO/MCP23S17/html
|
||||
html/functions.html libraries/IO/MCP23S17/html
|
||||
html/ftv2mnode.png libraries/IO/MCP23S17/html
|
||||
html/ftv2vertline.png libraries/IO/MCP23S17/html
|
||||
html/ftv2ns.png libraries/IO/MCP23S17/html
|
||||
html/bc_s.png libraries/IO/MCP23S17/html
|
||||
html/pages.html libraries/IO/MCP23S17/html
|
||||
html/tab_s.png libraries/IO/MCP23S17/html
|
||||
html/ftv2folderopen.png libraries/IO/MCP23S17/html
|
||||
html/md_README.html libraries/IO/MCP23S17/html
|
||||
html/ftv2mo.png libraries/IO/MCP23S17/html
|
||||
html/functions_func.html libraries/IO/MCP23S17/html
|
||||
html/ftv2lastnode.png libraries/IO/MCP23S17/html
|
||||
html/ftv2cl.png libraries/IO/MCP23S17/html
|
||||
html/search/pages_6d.html libraries/IO/MCP23S17/html/search
|
||||
html/search/all_67.js libraries/IO/MCP23S17/html/search
|
||||
html/search/functions_6d.js libraries/IO/MCP23S17/html/search
|
||||
html/search/all_6d.html libraries/IO/MCP23S17/html/search
|
||||
html/search/classes_6d.js libraries/IO/MCP23S17/html/search
|
||||
html/search/search.css libraries/IO/MCP23S17/html/search
|
||||
html/search/functions_72.html libraries/IO/MCP23S17/html/search
|
||||
html/search/all_72.html libraries/IO/MCP23S17/html/search
|
||||
html/search/functions_67.html libraries/IO/MCP23S17/html/search
|
||||
html/search/functions_73.html libraries/IO/MCP23S17/html/search
|
||||
html/search/all_65.js libraries/IO/MCP23S17/html/search
|
||||
html/search/functions_77.html libraries/IO/MCP23S17/html/search
|
||||
html/search/functions_65.html libraries/IO/MCP23S17/html/search
|
||||
html/search/all_73.js libraries/IO/MCP23S17/html/search
|
||||
html/search/functions_67.js libraries/IO/MCP23S17/html/search
|
||||
html/search/functions_6d.html libraries/IO/MCP23S17/html/search
|
||||
html/search/all_70.html libraries/IO/MCP23S17/html/search
|
||||
html/search/all_62.html libraries/IO/MCP23S17/html/search
|
||||
html/search/search_l.png libraries/IO/MCP23S17/html/search
|
||||
html/search/search.js libraries/IO/MCP23S17/html/search
|
||||
html/search/all_73.html libraries/IO/MCP23S17/html/search
|
||||
html/search/functions_72.js libraries/IO/MCP23S17/html/search
|
||||
html/search/close.png libraries/IO/MCP23S17/html/search
|
||||
html/search/functions_64.js libraries/IO/MCP23S17/html/search
|
||||
html/search/all_70.js libraries/IO/MCP23S17/html/search
|
||||
html/search/classes_6d.html libraries/IO/MCP23S17/html/search
|
||||
html/search/functions_70.html libraries/IO/MCP23S17/html/search
|
||||
html/search/all_65.html libraries/IO/MCP23S17/html/search
|
||||
html/search/all_72.js libraries/IO/MCP23S17/html/search
|
||||
html/search/all_6d.js libraries/IO/MCP23S17/html/search
|
||||
html/search/functions_77.js libraries/IO/MCP23S17/html/search
|
||||
html/search/search_r.png libraries/IO/MCP23S17/html/search
|
||||
html/search/functions_70.js libraries/IO/MCP23S17/html/search
|
||||
html/search/all_62.js libraries/IO/MCP23S17/html/search
|
||||
html/search/all_77.html libraries/IO/MCP23S17/html/search
|
||||
html/search/mag_sel.png libraries/IO/MCP23S17/html/search
|
||||
html/search/all_77.js libraries/IO/MCP23S17/html/search
|
||||
html/search/all_64.js libraries/IO/MCP23S17/html/search
|
||||
html/search/search_m.png libraries/IO/MCP23S17/html/search
|
||||
html/search/functions_65.js libraries/IO/MCP23S17/html/search
|
||||
html/search/all_64.html libraries/IO/MCP23S17/html/search
|
||||
html/search/functions_64.html libraries/IO/MCP23S17/html/search
|
||||
html/search/functions_62.js libraries/IO/MCP23S17/html/search
|
||||
html/search/functions_73.js libraries/IO/MCP23S17/html/search
|
||||
html/search/all_67.html libraries/IO/MCP23S17/html/search
|
||||
html/search/nomatches.html libraries/IO/MCP23S17/html/search
|
||||
html/search/pages_6d.js libraries/IO/MCP23S17/html/search
|
||||
html/search/functions_62.html libraries/IO/MCP23S17/html/search
|
||||
html/tab_h.png libraries/IO/MCP23S17/html
|
||||
latex/refman.ilg libraries/IO/MCP23S17/latex
|
||||
latex/refman.tex libraries/IO/MCP23S17/latex
|
||||
latex/Makefile libraries/IO/MCP23S17/latex
|
||||
latex/doxygen.sty libraries/IO/MCP23S17/latex
|
||||
latex/annotated.tex libraries/IO/MCP23S17/latex
|
||||
latex/refman.pdf libraries/IO/MCP23S17/latex
|
||||
latex/refman.idx libraries/IO/MCP23S17/latex
|
||||
latex/refman.log libraries/IO/MCP23S17/latex
|
||||
latex/md_README.tex libraries/IO/MCP23S17/latex
|
||||
latex/refman.out libraries/IO/MCP23S17/latex
|
||||
latex/refman.aux libraries/IO/MCP23S17/latex
|
||||
latex/refman.ind libraries/IO/MCP23S17/latex
|
||||
latex/refman.toc libraries/IO/MCP23S17/latex
|
||||
latex/classMCP23S17.tex libraries/IO/MCP23S17/latex
|
@ -0,0 +1,4 @@
|
||||
#!/usr/bin/make -f
|
||||
|
||||
%:
|
||||
dh $@
|
@ -0,0 +1 @@
|
||||
3.0 (native)
|
@ -0,0 +1,32 @@
|
||||
#include <MCP23S17.h>
|
||||
|
||||
#ifdef __PIC32MX__
|
||||
// chipKIT uses the DSPI library instead of the SPI library as it's better
|
||||
#include <DSPI.h>
|
||||
DSPI0 SPI;
|
||||
#else
|
||||
// Everytying else uses the SPI library
|
||||
#include <SPI.h>
|
||||
#endif
|
||||
|
||||
const uint8_t chipSelect = 10;
|
||||
|
||||
// Create an object for each chip
|
||||
// Bank 0 is address 0
|
||||
// Bank 1 is address 1.
|
||||
// Increase the addresses by 2 for each BA value.
|
||||
|
||||
MCP23S17 Bank1(&SPI, chipSelect, 0);
|
||||
MCP23S17 Bank2(&SPI, chipSelect, 1);
|
||||
|
||||
void setup() {
|
||||
Bank1.begin();
|
||||
Bank2.begin();
|
||||
|
||||
Bank1.pinMode(15, OUTPUT);
|
||||
Bank2.pinMode(15, INPUT_PULLUP);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
Bank1.digitalWrite(15, !Bank2.digitalRead(15));
|
||||
}
|
@ -0,0 +1,194 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||
<meta name="generator" content="Doxygen 1.8.4"/>
|
||||
<title>MCP23S17 Library: MCP23S17.h Source File</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="jquery.js"></script>
|
||||
<script type="text/javascript" src="dynsections.js"></script>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/search.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||
</script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td style="padding-left: 0.5em;">
|
||||
<div id="projectname">MCP23S17 Library
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.8.4 -->
|
||||
<script type="text/javascript">
|
||||
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||||
</script>
|
||||
<div id="navrow1" class="tabs">
|
||||
<ul class="tablist">
|
||||
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||
<li>
|
||||
<div id="MSearchBox" class="MSearchBoxInactive">
|
||||
<span class="left">
|
||||
<img id="MSearchSelect" src="search/mag_sel.png"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
alt=""/>
|
||||
<input type="text" id="MSearchField" value="Search" accesskey="S"
|
||||
onfocus="searchBox.OnSearchFieldFocus(true)"
|
||||
onblur="searchBox.OnSearchFieldFocus(false)"
|
||||
onkeyup="searchBox.OnSearchFieldChange(event)"/>
|
||||
</span><span class="right">
|
||||
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="navrow2" class="tabs2">
|
||||
<ul class="tablist">
|
||||
<li><a href="files.html"><span>File List</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div><!-- top -->
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Pages</a></div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<iframe src="javascript:void(0)" frameborder="0"
|
||||
name="MSearchResults" id="MSearchResults">
|
||||
</iframe>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<div class="headertitle">
|
||||
<div class="title">MCP23S17.h</div> </div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div>
|
||||
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> * Copyright (c) , Majenko Technologies</span></div>
|
||||
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> * All rights reserved.</span></div>
|
||||
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> * </span></div>
|
||||
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> * Redistribution and use in source and binary forms, with or without modification, </span></div>
|
||||
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> * are permitted provided that the following conditions are met:</span></div>
|
||||
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> * </span></div>
|
||||
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> * 1. Redistributions of source code must retain the above copyright notice, </span></div>
|
||||
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"> * this list of conditions and the following disclaimer.</span></div>
|
||||
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> * </span></div>
|
||||
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> * 2. Redistributions in binary form must reproduce the above copyright notice,</span></div>
|
||||
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> * this list of conditions and the following disclaimer in the documentation</span></div>
|
||||
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"> * and/or other materials provided with the distribution.</span></div>
|
||||
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> * </span></div>
|
||||
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"> * 3. Neither the name of Majenko Technologies nor the names of its contributors may be used</span></div>
|
||||
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment"> * to endorse or promote products derived from this software without </span></div>
|
||||
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment"> * specific prior written permission.</span></div>
|
||||
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment"> * </span></div>
|
||||
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" </span></div>
|
||||
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="comment"> * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE </span></div>
|
||||
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="comment"> * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE </span></div>
|
||||
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="comment"> * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE </span></div>
|
||||
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="comment"> * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL </span></div>
|
||||
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="comment"> * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR </span></div>
|
||||
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="comment"> * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER </span></div>
|
||||
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="comment"> * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, </span></div>
|
||||
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="comment"> * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE </span></div>
|
||||
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="comment"> * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></div>
|
||||
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="comment"> */</span></div>
|
||||
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> </div>
|
||||
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> </div>
|
||||
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="preprocessor">#ifndef _MCP23S17_H</span></div>
|
||||
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="preprocessor"></span><span class="preprocessor">#define _MCP23S17_H</span></div>
|
||||
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="preprocessor"></span></div>
|
||||
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="preprocessor">#if (ARDUINO >= 100) </span></div>
|
||||
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="preprocessor"></span><span class="preprocessor"># include <Arduino.h></span></div>
|
||||
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="preprocessor">#else</span></div>
|
||||
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="preprocessor"></span><span class="preprocessor"># include <WProgram.h></span></div>
|
||||
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="preprocessor">#endif</span></div>
|
||||
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="preprocessor"></span></div>
|
||||
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="preprocessor">#ifdef __PIC32MX__</span></div>
|
||||
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="preprocessor"></span><span class="preprocessor">#include <DSPI.h></span></div>
|
||||
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="preprocessor">#else</span></div>
|
||||
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span> <span class="preprocessor"></span><span class="preprocessor">#include <SPI.h></span></div>
|
||||
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <span class="preprocessor">#endif</span></div>
|
||||
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span> <span class="preprocessor"></span></div>
|
||||
<div class="line"><a name="l00047"></a><span class="lineno"><a class="code" href="classMCP23S17.html"> 47</a></span> <span class="keyword">class </span><a class="code" href="classMCP23S17.html">MCP23S17</a> {</div>
|
||||
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  <span class="keyword">private</span>:</div>
|
||||
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span> <span class="preprocessor">#ifdef __PIC32MX__</span></div>
|
||||
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span> <span class="preprocessor"></span> DSPI *_spi; </div>
|
||||
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span> <span class="preprocessor">#else</span></div>
|
||||
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span> <span class="preprocessor"></span> SPIClass *_spi; </div>
|
||||
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span> <span class="preprocessor">#endif</span></div>
|
||||
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span> <span class="preprocessor"></span> uint8_t _cs; </div>
|
||||
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  uint8_t _addr; </div>
|
||||
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  uint8_t _reg[22]; </div>
|
||||
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  <span class="keyword">enum</span> {</div>
|
||||
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  IODIRA, IODIRB,</div>
|
||||
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  IPOLA, IPOLB,</div>
|
||||
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  GPINTENA, GPINTENB,</div>
|
||||
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  DEFVALA, DEFVALB,</div>
|
||||
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  INTCONA, INTCONB,</div>
|
||||
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  IOCONA, IOCONB,</div>
|
||||
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  GPPUA, GPPUB,</div>
|
||||
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  INTFA, INTFB,</div>
|
||||
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  INTCAPA, INTCAPB,</div>
|
||||
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  GPIOA, GPIOB,</div>
|
||||
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  OLATA, OLATB</div>
|
||||
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  };</div>
|
||||
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span> </div>
|
||||
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  <span class="keywordtype">void</span> readRegister(uint8_t addr); </div>
|
||||
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  <span class="keywordtype">void</span> writeRegister(uint8_t addr);</div>
|
||||
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  <span class="keywordtype">void</span> readAll();</div>
|
||||
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  <span class="keywordtype">void</span> writeAll();</div>
|
||||
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  </div>
|
||||
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  <span class="keyword">public</span>:</div>
|
||||
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span> <span class="preprocessor">#ifdef __PIC32MX__</span></div>
|
||||
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span> <span class="preprocessor"></span> <a class="code" href="classMCP23S17.html#a97d5acfce335affc1fd0e90f27bb2773">MCP23S17</a>(DSPI *spi, uint8_t cs, uint8_t addr);</div>
|
||||
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span> <span class="preprocessor">#else</span></div>
|
||||
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span> <span class="preprocessor"></span> <a class="code" href="classMCP23S17.html#a97d5acfce335affc1fd0e90f27bb2773">MCP23S17</a>(SPIClass *spi, uint8_t cs, uint8_t addr);</div>
|
||||
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span> <span class="preprocessor">#endif</span></div>
|
||||
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span> <span class="preprocessor"></span> <span class="keywordtype">void</span> <a class="code" href="classMCP23S17.html#a406756f19493cdec55b56617ddc109f1">begin</a>();</div>
|
||||
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  <span class="keywordtype">void</span> <a class="code" href="classMCP23S17.html#a6e9078f8c0e9c623de2505ed4c19f09e">pinMode</a>(uint8_t pin, uint8_t mode);</div>
|
||||
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  <span class="keywordtype">void</span> <a class="code" href="classMCP23S17.html#a14834358725d440513946ac3d6c6a02e">digitalWrite</a>(uint8_t pin, uint8_t value);</div>
|
||||
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  uint8_t <a class="code" href="classMCP23S17.html#a30386f1e0486570613ea06d110387093">digitalRead</a>(uint8_t pin);</div>
|
||||
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span> </div>
|
||||
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  uint8_t <a class="code" href="classMCP23S17.html#a45d1747d85825e3bf2cf4be7268c9b92">readPort</a>(uint8_t port);</div>
|
||||
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  uint16_t <a class="code" href="classMCP23S17.html#a45d1747d85825e3bf2cf4be7268c9b92">readPort</a>();</div>
|
||||
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <span class="keywordtype">void</span> <a class="code" href="classMCP23S17.html#ad11ed96faaef273362d2c54260e68891">writePort</a>(uint8_t port, uint8_t val);</div>
|
||||
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <span class="keywordtype">void</span> <a class="code" href="classMCP23S17.html#ad11ed96faaef273362d2c54260e68891">writePort</a>(uint16_t val);</div>
|
||||
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  <span class="keywordtype">void</span> <a class="code" href="classMCP23S17.html#a8cfe7bd574736faeca00e133e5e19ec3">enableInterrupt</a>(uint8_t pin, uint8_t type);</div>
|
||||
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  <span class="keywordtype">void</span> <a class="code" href="classMCP23S17.html#aff570e5211f9443769a53f017626b180">disableInterrupt</a>(uint8_t pin);</div>
|
||||
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  <span class="keywordtype">void</span> <a class="code" href="classMCP23S17.html#a5b9bcf0d06c5a15875f406e1ed73ecc7">setMirror</a>(<span class="keywordtype">boolean</span> m);</div>
|
||||
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  uint16_t <a class="code" href="classMCP23S17.html#ad1a11133076a20b9c16e30fb2ddc566c">getInterruptPins</a>();</div>
|
||||
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  uint16_t <a class="code" href="classMCP23S17.html#adf3b48d655eb9850a9349973d0ece330">getInterruptValue</a>();</div>
|
||||
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  <span class="keywordtype">void</span> <a class="code" href="classMCP23S17.html#a5786c6b9a618a1c7c0fd95ca7d93774d">setInterruptLevel</a>(uint8_t level);</div>
|
||||
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  <span class="keywordtype">void</span> <a class="code" href="classMCP23S17.html#aef7c2e4c24141e8ba455aa1d2e497e6c">setInterruptOD</a>(<span class="keywordtype">boolean</span> openDrain);</div>
|
||||
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span> </div>
|
||||
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span> };</div>
|
||||
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span> <span class="preprocessor">#endif</span></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated on Wed Jun 25 2014 19:37:57 for MCP23S17 Library by  <a href="http://www.doxygen.org/index.html">
|
||||
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
||||
</a> 1.8.4
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,101 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||
<meta name="generator" content="Doxygen 1.8.4"/>
|
||||
<title>MCP23S17 Library: Class List</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="jquery.js"></script>
|
||||
<script type="text/javascript" src="dynsections.js"></script>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/search.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||
</script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td style="padding-left: 0.5em;">
|
||||
<div id="projectname">MCP23S17 Library
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||