* drivers/ioexpander/pcf8575.h
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
#ifndef __DRIVERS_IOEXPANDER_PCF8575_H
#define __DRIVERS_IOEXPANDER_PCF8575_H
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <nuttx/mutex.h>
#include <nuttx/ioexpander/ioexpander.h>
#include <nuttx/ioexpander/pcf8575.h>
#include <nuttx/i2c/i2c_master.h>
#if defined(CONFIG_IOEXPANDER) && defined(CONFIG_IOEXPANDER_PCF8575)
* Pre-processor Definitions
****************************************************************************/
* CONFIG_I2C
* I2C support is required
* CONFIG_IOEXPANDER
* Enables I/O expander support
*
* CONFIG_IOEXPANDER_PCF8575
* Enables support for the PCF8575 driver (Needs CONFIG_INPUT)
* CONFIG_PCF8575_MULTIPLE
* Can be defined to support multiple PCF8575 devices on board.
*/
#ifndef CONFIG_I2C
# error "CONFIG_I2C is required by PCF8575"
#endif
#define PCF8575_I2C_MAXFREQUENCY 400000
* Public Types
****************************************************************************/
struct pcf8575_dev_s
{
struct ioexpander_dev_s dev;
* expander. */
FAR struct pcf8575_config_s *config;
FAR struct i2c_master_s *i2c;
mutex_t lock;
uint16_t inpins;
uint16_t outstate;
};
#endif
#endif