Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

otMCP23008 Class Reference
[MCP23008 - 8-Bit I/O Expander with Serial InterfaceMCP23008 - 8-Bit I/O Expander with Serial Interface]

Device driver for 8-Bit I/O Expander with Serial Interface.

#include <otMCP23008.h>

Inheritance diagram for otMCP23008:

otDigitalLens otMultimediaShield

Public Member Functions

 otMCP23008 ()
void init (U8 addressIndex=0)
U8 pinRead (U8 pin)
void pinWrite (U8 pin, bool set)
void pinPullUp (U8 pin, bool ena)
void pinMode (U8 pin, bool input)
void write (U8 data)
U8 read ()

Constructor & Destructor Documentation

otMCP23008.otMCP23008  ) 
 

Init the class


Member Function Documentation

void otMCP23008.init U8  addressIndex = 0  ) 
 

Set the base address

Parameters:
addressIndex Select which device is selected in the range 0:7

Reimplemented in otMultimediaShield.

void otMCP23008.pinMode U8  pin,
bool  input
 

Set the direction of a selected pin

Parameters:
pin Pin selection 0 to 7
input Set true for input or false for output

void otMCP23008.pinPullUp U8  pin,
bool  ena
 

Enable or disable a pull up on a selected pin

Parameters:
pin Pin selection 0 to 7
ena True enable the pull up

U8 otMCP23008.pinRead U8  pin  ) 
 

Read the value of a specified pin

Parameters:
pin Pin selection 0 to 7
Returns:
0 or 1

void otMCP23008.pinWrite U8  pin,
bool  set
 

Set a pin to a desidered value

Parameters:
pin Pin selection 0 to 7
set True set to 1 or false to 0

U8 otMCP23008.read  ) 
 

Read the port contents.

void otMCP23008.write U8  data  ) 
 

Writes all 8 bits of the port.

Parameters:
data Data to be write


The documentation for this class was generated from the following file: footer
otStudio - Library Reference - (C) 2020-23 Officina Turini, All Rights Reserved
Document built with Doxygen 1.4.0