LibDriver PCF8575
Loading...
Searching...
No Matches
pcf8575 base driver function

pcf8575 base driver modules More...

Collaboration diagram for pcf8575 base driver function:

Data Structures

struct  pcf8575_handle_s
 pcf8575 handle structure definition More...
struct  pcf8575_info_s
 pcf8575 information structure definition More...

Typedefs

typedef struct pcf8575_handle_s pcf8575_handle_t
 pcf8575 handle structure definition
typedef struct pcf8575_info_s pcf8575_info_t
 pcf8575 information structure definition

Enumerations

enum  pcf8575_address_t {
  PCF8575_ADDRESS_A000 = 0 , PCF8575_ADDRESS_A001 = 1 , PCF8575_ADDRESS_A010 = 2 , PCF8575_ADDRESS_A011 = 3 ,
  PCF8575_ADDRESS_A100 = 4 , PCF8575_ADDRESS_A101 = 5 , PCF8575_ADDRESS_A110 = 6 , PCF8575_ADDRESS_A111 = 7
}
 pcf8575 address enumeration definition More...
enum  pcf8575_pin_t {
  PCF8575_PIN_00 = 0x08 , PCF8575_PIN_01 = 0x09 , PCF8575_PIN_02 = 0x0A , PCF8575_PIN_03 = 0x0B ,
  PCF8575_PIN_04 = 0x0C , PCF8575_PIN_05 = 0x0D , PCF8575_PIN_06 = 0x0E , PCF8575_PIN_07 = 0x0F ,
  PCF8575_PIN_10 = 0x00 , PCF8575_PIN_11 = 0x01 , PCF8575_PIN_12 = 0x02 , PCF8575_PIN_13 = 0x03 ,
  PCF8575_PIN_14 = 0x04 , PCF8575_PIN_15 = 0x05 , PCF8575_PIN_16 = 0x06 , PCF8575_PIN_17 = 0x07
}
 pcf8575 pin enumeration definition More...
enum  pcf8575_pin_level_t { PCF8575_PIN_LEVEL_LOW = 0x00 , PCF8575_PIN_LEVEL_HIGH = 0x01 }
 pcf8575 pin enumeration definition More...

Functions

uint8_t pcf8575_info (pcf8575_info_t *info)
 get chip's information
uint8_t pcf8575_set_addr_pin (pcf8575_handle_t *handle, pcf8575_address_t addr_pin)
 set the address pin
uint8_t pcf8575_get_addr_pin (pcf8575_handle_t *handle, pcf8575_address_t *addr_pin)
 get the address pin
uint8_t pcf8575_init (pcf8575_handle_t *handle)
 initialize the chip
uint8_t pcf8575_deinit (pcf8575_handle_t *handle)
 close the chip
uint8_t pcf8575_read (pcf8575_handle_t *handle, pcf8575_pin_t pin, pcf8575_pin_level_t *level)
 read the pin
uint8_t pcf8575_write (pcf8575_handle_t *handle, pcf8575_pin_t pin, pcf8575_pin_level_t level)
 write the pin

Detailed Description

pcf8575 base driver modules

Typedef Documentation

◆ pcf8575_handle_t

pcf8575 handle structure definition

◆ pcf8575_info_t

pcf8575 information structure definition

Enumeration Type Documentation

◆ pcf8575_address_t

pcf8575 address enumeration definition

Enumerator
PCF8575_ADDRESS_A000 

A2A1A0 000

PCF8575_ADDRESS_A001 

A2A1A0 001

PCF8575_ADDRESS_A010 

A2A1A0 010

PCF8575_ADDRESS_A011 

A2A1A0 011

PCF8575_ADDRESS_A100 

A2A1A0 100

PCF8575_ADDRESS_A101 

A2A1A0 101

PCF8575_ADDRESS_A110 

A2A1A0 110

PCF8575_ADDRESS_A111 

A2A1A0 111

Definition at line 62 of file driver_pcf8575.h.

◆ pcf8575_pin_level_t

pcf8575 pin enumeration definition

Enumerator
PCF8575_PIN_LEVEL_LOW 

low level

PCF8575_PIN_LEVEL_HIGH 

high level

Definition at line 100 of file driver_pcf8575.h.

◆ pcf8575_pin_t

pcf8575 pin enumeration definition

Enumerator
PCF8575_PIN_00 

pin 00

PCF8575_PIN_01 

pin 01

PCF8575_PIN_02 

pin 02

PCF8575_PIN_03 

pin 03

PCF8575_PIN_04 

pin 04

PCF8575_PIN_05 

pin 05

PCF8575_PIN_06 

pin 06

PCF8575_PIN_07 

pin 07

PCF8575_PIN_10 

pin 10

PCF8575_PIN_11 

pin 11

PCF8575_PIN_12 

pin 12

PCF8575_PIN_13 

pin 13

PCF8575_PIN_14 

pin 14

PCF8575_PIN_15 

pin 15

PCF8575_PIN_16 

pin 16

PCF8575_PIN_17 

pin 17

Definition at line 77 of file driver_pcf8575.h.

Function Documentation

◆ pcf8575_deinit()

uint8_t pcf8575_deinit ( pcf8575_handle_t * handle)

close the chip

Parameters
[in]*handlepointer to a pcf8575 handle structure
Returns
status code
  • 0 success
  • 1 iic deinit failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 179 of file driver_pcf8575.c.

◆ pcf8575_get_addr_pin()

uint8_t pcf8575_get_addr_pin ( pcf8575_handle_t * handle,
pcf8575_address_t * addr_pin )

get the address pin

Parameters
[in]*handlepointer to a pcf8575 handle structure
[out]*addr_pinpointer to a chip address pins buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 82 of file driver_pcf8575.c.

◆ pcf8575_info()

uint8_t pcf8575_info ( pcf8575_info_t * info)

get chip's information

Parameters
[out]*infopointer to a pcf8575 info structure
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 368 of file driver_pcf8575.c.

◆ pcf8575_init()

uint8_t pcf8575_init ( pcf8575_handle_t * handle)

initialize the chip

Parameters
[in]*handlepointer to a pcf8575 handle structure
Returns
status code
  • 0 success
  • 1 iic initialization failed
  • 2 handle is NULL
  • 3 linked functions is NULL
  • 4 iic write failed
Note
none

Definition at line 105 of file driver_pcf8575.c.

◆ pcf8575_read()

uint8_t pcf8575_read ( pcf8575_handle_t * handle,
pcf8575_pin_t pin,
pcf8575_pin_level_t * level )

read the pin

Parameters
[in]*handlepointer to a pcf8575 handle structure
[in]pinread pin
[out]*levelpointer to a level buffer
Returns
status code
  • 0 success
  • 1 read failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 216 of file driver_pcf8575.c.

◆ pcf8575_set_addr_pin()

uint8_t pcf8575_set_addr_pin ( pcf8575_handle_t * handle,
pcf8575_address_t addr_pin )

set the address pin

Parameters
[in]*handlepointer to a pcf8575 handle structure
[in]addr_pinchip address pins
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 60 of file driver_pcf8575.c.

◆ pcf8575_write()

uint8_t pcf8575_write ( pcf8575_handle_t * handle,
pcf8575_pin_t pin,
pcf8575_pin_level_t level )

write the pin

Parameters
[in]*handlepointer to a pcf8575 handle structure
[in]pinwritten pin
[in]levelpin level
Returns
status code
  • 0 success
  • 1 write failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 256 of file driver_pcf8575.c.