PCA9555 / PCAL9555A Driver
API reference
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Typedefs | Enumerations | Functions
pcal95555.hpp File Reference

Driver for the PCA9555 and PCAL9555A 16-bit I/O expanders with I²C interface. More...

#include <array>
#include <cstddef>
#include <cstdint>
#include <functional>
#include <initializer_list>
#include <utility>
#include <stdio.h>
#include <string.h>
#include "pcal95555_i2c_interface.hpp"
#include "pcal95555_kconfig.hpp"
#include "pcal95555_version.h"
#include "../src/pcal95555.ipp"

Go to the source code of this file.

Classes

struct  pcal95555::PinReadResult
 Fixed-capacity result container for multi-pin read operations. More...
 
class  pcal95555::PCAL95555< I2cType >
 Driver for the PCA9555 / PCAL9555A / PCAL95555AHF I²C GPIO expander. More...
 
struct  pcal95555::PCAL95555< I2cType >::PinInterruptCallback
 Structure to store pin interrupt callback information. More...
 

Namespaces

namespace  pcal95555
 

Macros

#define PCAL95555_HEADER_INCLUDED
 

Typedefs

using Pcal95555Reg = pcal95555::Pcal95555Reg
 
using GPIODir = pcal95555::GPIODir
 
using Polarity = pcal95555::Polarity
 
using DriveStrength = pcal95555::DriveStrength
 
using OutputMode = pcal95555::OutputMode
 
using InterruptEdge = pcal95555::InterruptEdge
 
using InterruptState = pcal95555::InterruptState
 
using Error = pcal95555::Error
 

Enumerations

enum class  pcal95555::Pcal95555Reg : uint8_t {
  pcal95555::INPUT_PORT_0 = 0x00 , pcal95555::INPUT_PORT_1 = 0x01 , pcal95555::OUTPUT_PORT_0 = 0x02 , pcal95555::OUTPUT_PORT_1 = 0x03 ,
  pcal95555::POLARITY_INV_0 = 0x04 , pcal95555::POLARITY_INV_1 = 0x05 , pcal95555::CONFIG_PORT_0 = 0x06 , pcal95555::CONFIG_PORT_1 = 0x07 ,
  pcal95555::DRIVE_STRENGTH_0 = 0x40 , pcal95555::DRIVE_STRENGTH_1 = 0x41 , pcal95555::DRIVE_STRENGTH_2 = 0x42 , pcal95555::DRIVE_STRENGTH_3 = 0x43 ,
  pcal95555::INPUT_LATCH_0 = 0x44 , pcal95555::INPUT_LATCH_1 = 0x45 , pcal95555::PULL_ENABLE_0 = 0x46 , pcal95555::PULL_ENABLE_1 = 0x47 ,
  pcal95555::PULL_SELECT_0 = 0x48 , pcal95555::PULL_SELECT_1 = 0x49 , pcal95555::INT_MASK_0 = 0x4A , pcal95555::INT_MASK_1 = 0x4B ,
  pcal95555::INT_STATUS_0 = 0x4C , pcal95555::INT_STATUS_1 = 0x4D , pcal95555::OUTPUT_CONF = 0x4F
}
 Register addresses for the PCA9555 / PCAL9555A I/O expander chips. More...
 
enum class  pcal95555::GPIODir : uint8_t { pcal95555::Input = 1 , pcal95555::Output = 0 }
 
enum class  pcal95555::Polarity : uint8_t { pcal95555::Normal = 0 , pcal95555::Inverted = 1 }
 
enum class  pcal95555::DriveStrength : uint8_t { pcal95555::Level0 = 0 , pcal95555::Level1 = 1 , pcal95555::Level2 = 2 , pcal95555::Level3 = 3 }
 
enum class  pcal95555::OutputMode : uint8_t { pcal95555::PushPull = 0 , pcal95555::OpenDrain = 1 }
 
enum class  pcal95555::InterruptEdge : uint8_t { pcal95555::Rising = 1 , pcal95555::Falling = 2 , pcal95555::Both = 3 }
 
enum class  pcal95555::InterruptState : uint8_t { pcal95555::Enabled = 0 , pcal95555::Disabled = 1 }
 
enum class  pcal95555::Error : uint16_t {
  pcal95555::None = 0 , pcal95555::InvalidPin = 1 << 0 , pcal95555::InvalidMask = 1 << 1 , pcal95555::I2CReadFail = 1 << 2 ,
  pcal95555::I2CWriteFail = 1 << 3 , pcal95555::UnsupportedFeature = 1 << 4 , pcal95555::InvalidAddress = 1 << 5
}
 
enum class  pcal95555::ChipVariant : uint8_t { pcal95555::Unknown = 0 , pcal95555::PCA9555 = 1 , pcal95555::PCAL9555A = 2 }
 Identifies the detected or user-specified chip variant. More...
 

Functions

constexpr Error pcal95555::operator| (Error lhs, Error rhs) noexcept
 Combine two Error flags.
 
constexpr Error pcal95555::operator& (Error lhs, Error rhs) noexcept
 Intersect two Error flags.
 
constexpr Error pcal95555::operator~ (Error e) noexcept
 Complement an Error flag (useful with ClearErrorFlags).
 
const char * pcal95555::GetDriverVersion () noexcept
 

Detailed Description

Driver for the PCA9555 and PCAL9555A 16-bit I/O expanders with I²C interface.

Macro Definition Documentation

◆ PCAL95555_HEADER_INCLUDED

#define PCAL95555_HEADER_INCLUDED

Typedef Documentation

◆ DriveStrength

◆ Error

◆ GPIODir

◆ InterruptEdge

◆ InterruptState

◆ OutputMode

◆ Pcal95555Reg

◆ Polarity