All Projects → hepingood → pcf8574

hepingood / pcf8574

Licence: MIT license
pcf8574 full function driver

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to pcf8574

max30102
max30102 full function driver
Stars: ✭ 88 (-16.98%)
Mutual labels:  mcu, iic, full-function
bmp388
bmp388 full function driver
Stars: ✭ 14 (-86.79%)
Mutual labels:  mcu, iic
mcp9600
mcp9600 full function driver
Stars: ✭ 22 (-79.25%)
Mutual labels:  mcu, iic
sht31
sht31 full function driver
Stars: ✭ 28 (-73.58%)
Mutual labels:  mcu, iic
adxl345
ADXL345 full function driver for general MCU and Linux.
Stars: ✭ 170 (+60.38%)
Mutual labels:  mcu, iic
amg8833
amg8833 full function driver
Stars: ✭ 78 (-26.42%)
Mutual labels:  mcu, full-function
w25qxx
w25qxx full function driver
Stars: ✭ 440 (+315.09%)
Mutual labels:  mcu, full-function
max30205
max30205 full function driver
Stars: ✭ 18 (-83.02%)
Mutual labels:  mcu, iic
uvis25
uvis25 full function driver
Stars: ✭ 13 (-87.74%)
Mutual labels:  mcu, iic
bmp180
bmp180 full function driver
Stars: ✭ 57 (-46.23%)
Mutual labels:  mcu, iic
fm24clxx
fm24clxx full function driver
Stars: ✭ 0 (-100%)
Mutual labels:  mcu, iic
sgp30
sgp30 full function driver
Stars: ✭ 24 (-77.36%)
Mutual labels:  mcu, iic
mlx90614
mlx90614 full function driver
Stars: ✭ 17 (-83.96%)
Mutual labels:  mcu, iic
pcf8591
pcf8591 full function driver
Stars: ✭ 32 (-69.81%)
Mutual labels:  mcu, iic
mcp4725
mcp4725 full function driver
Stars: ✭ 15 (-85.85%)
Mutual labels:  mcu, iic
ina219
ina219 full function driver
Stars: ✭ 27 (-74.53%)
Mutual labels:  mcu, iic
at24cxx
at24cxx full function driver
Stars: ✭ 28 (-73.58%)
Mutual labels:  mcu, iic
stm32-rustup
A guide to rust your stm32 microcontroller
Stars: ✭ 25 (-76.42%)
Mutual labels:  mcu
mystery
WebRTC Server implemented by ❤️ Rust + Node.js.
Stars: ✭ 150 (+41.51%)
Mutual labels:  mcu
faucon
NVIDIA Falcon Microprocessor Suite
Stars: ✭ 28 (-73.58%)
Mutual labels:  mcu

English | 简体中文 | 繁體中文 | 日本語 | Deutsch | 한국어

LibDriver PCF8574

MISRA API License

The PCF8574/74A provides general-purpose remote I/O expansion via the two-wire bidirectional I2C-bus (serial clock (SCL), serial data (SDA)).The devices consist of eight quasi-bidirectional ports, 100 kHz I2C-bus interface, three hardware address inputs and interrupt output operating between 2.5 V and 6 V. The quasi-bidirectional port can be independently assigned as an input to monitor interrupt status or keypads, or as an output to activate indicator devices such as LEDs. System master can read from the input port or write to the output port through a single register. The low current consumption of 2.5 uA (typical, static) is great for mobile applications and the latched output ports directly drive LEDs.The PCF8574 and PCF8574A are identical, except for the different fixed portion of the slave address. The three hardware address pins allow eight of each device to be on the same I2C-bus, so there can be up to 16 of these I/O expanders PCF8574/74A together on the same I2C-bus, supporting up to 128 I/Os (for example, 128 LEDs).The active LOW open-drain interrupt output (INT) can be connected to the interrupt logic of the microcontroller and is activated when any input state differs from its corresponding input port register state. It is used to indicate to the microcontroller that an input state has changed and the device needs to be interrogated without the microcontroller continuously polling the input register via the I2C-bus.The internal Power-On Reset (POR) initializes the I/Os as inputs with a weak internal pull-up 100 uA current source. PCF8574 is used in LED signs and displays, servers, key pads, industrial control, medical equipment, PLC, cellular telephones, mobile devices, gaming machines and instrumentation test measurement.

LibDriver PCF8574 is a full function driver of PCF8574 launched by LibDriver.It provides I/O writing, I/O reading and other functions. LibDriver is MISRA compliant.

Table of Contents

Instruction

/src includes LibDriver PCF8574 source files.

/interface includes LibDriver PCF8574 IIC platform independent template。

/test includes LibDriver PCF8574 driver test code and this code can test the chip necessary function simply。

/example includes LibDriver PCF8574 sample code.

/doc includes LibDriver PCF8574 offline document.

/datasheet includes PCF8574 datasheet。

/project includes the common Linux and MCU development board sample code. All projects use the shell script to debug the driver and the detail instruction can be found in each project's README.md.

Install

Reference /interface IIC platform independent template and finish your platform IIC driver.

Add /src, /interface and /example to your project.

Usage

example basic

uint8_t res;
pcf8574_pin_level_t level;

/* basic init */
res = pcf8574_basic_init(PCF8574_ADDRESS_A000);
if (res != 0)
{
    return 1;
}

...

/* read pin */
res = pcf8574_basic_read(PCF8574_PIN_0, (pcf8574_pin_level_t *)&level);
if (res != 0)
{
    (void)pcf8574_basic_deinit();

    return 1;
}

/* write pin */
res = pcf8574_basic_write(PCF8574_PIN_0, PCF8574_PIN_LEVEL_HIGH);
if (res != 0)
{
    (void)pcf8574_basic_deinit();

    return 1;
}

...

(void)pcf8574_basic_deinit();

return 0;

Document

Online documents: https://www.libdriver.com/docs/pcf8574/index.html

Offline documents: /doc/html/index.html

Contributing

Please sent an e-mail to [email protected]

License

Copyright (c) 2015 - present LibDriver All rights reserved

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy

of this software and associated documentation files (the "Software"), to deal

in the Software without restriction, including without limitation the rights

to use, copy, modify, merge, publish, distribute, sublicense, and/or sell

copies of the Software, and to permit persons to whom the Software is

furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all

copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR

IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,

FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE

AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER

LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,

OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE

SOFTWARE.

Contact Us

Please sent an e-mail to [email protected]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].