LibDriver PCF8574
Loading...
Searching...
No Matches
pcf8574 base driver function

pcf8574 base driver modules More...

Collaboration diagram for pcf8574 base driver function:

Data Structures

struct  pcf8574_handle_s
 pcf8574 handle structure definition More...
struct  pcf8574_info_s
 pcf8574 information structure definition More...

Typedefs

typedef struct pcf8574_handle_s pcf8574_handle_t
 pcf8574 handle structure definition
typedef struct pcf8574_info_s pcf8574_info_t
 pcf8574 information structure definition

Enumerations

enum  pcf8574_address_t {
  PCF8574_ADDRESS_A000 = 0 , PCF8574_ADDRESS_A001 = 1 , PCF8574_ADDRESS_A010 = 2 , PCF8574_ADDRESS_A011 = 3 ,
  PCF8574_ADDRESS_A100 = 4 , PCF8574_ADDRESS_A101 = 5 , PCF8574_ADDRESS_A110 = 6 , PCF8574_ADDRESS_A111 = 7
}
 pcf8574 address enumeration definition More...
enum  pcf8574_pin_t {
  PCF8574_PIN_0 = 0x00 , PCF8574_PIN_1 = 0x01 , PCF8574_PIN_2 = 0x02 , PCF8574_PIN_3 = 0x03 ,
  PCF8574_PIN_4 = 0x04 , PCF8574_PIN_5 = 0x05 , PCF8574_PIN_6 = 0x06 , PCF8574_PIN_7 = 0x07
}
 pcf8574 pin enumeration definition More...
enum  pcf8574_pin_level_t { PCF8574_PIN_LEVEL_LOW = 0x00 , PCF8574_PIN_LEVEL_HIGH = 0x01 }
 pcf8574 pin enumeration definition More...

Functions

uint8_t pcf8574_info (pcf8574_info_t *info)
 get chip's information
uint8_t pcf8574_set_addr_pin (pcf8574_handle_t *handle, pcf8574_address_t addr_pin)
 set the address pin
uint8_t pcf8574_get_addr_pin (pcf8574_handle_t *handle, pcf8574_address_t *addr_pin)
 get the address pin
uint8_t pcf8574_init (pcf8574_handle_t *handle)
 initialize the chip
uint8_t pcf8574_deinit (pcf8574_handle_t *handle)
 close the chip
uint8_t pcf8574_read (pcf8574_handle_t *handle, pcf8574_pin_t pin, pcf8574_pin_level_t *level)
 read the pin
uint8_t pcf8574_write (pcf8574_handle_t *handle, pcf8574_pin_t pin, pcf8574_pin_level_t level)
 write the pin

Detailed Description

pcf8574 base driver modules

Typedef Documentation

◆ pcf8574_handle_t

pcf8574 handle structure definition

◆ pcf8574_info_t

pcf8574 information structure definition

Enumeration Type Documentation

◆ pcf8574_address_t

pcf8574 address enumeration definition

Enumerator
PCF8574_ADDRESS_A000 

A2A1A0 000

PCF8574_ADDRESS_A001 

A2A1A0 001

PCF8574_ADDRESS_A010 

A2A1A0 010

PCF8574_ADDRESS_A011 

A2A1A0 011

PCF8574_ADDRESS_A100 

A2A1A0 100

PCF8574_ADDRESS_A101 

A2A1A0 101

PCF8574_ADDRESS_A110 

A2A1A0 110

PCF8574_ADDRESS_A111 

A2A1A0 111

Definition at line 62 of file driver_pcf8574.h.

◆ pcf8574_pin_level_t

pcf8574 pin enumeration definition

Enumerator
PCF8574_PIN_LEVEL_LOW 

low level

PCF8574_PIN_LEVEL_HIGH 

high level

Definition at line 92 of file driver_pcf8574.h.

◆ pcf8574_pin_t

pcf8574 pin enumeration definition

Enumerator
PCF8574_PIN_0 

pin 0

PCF8574_PIN_1 

pin 1

PCF8574_PIN_2 

pin 2

PCF8574_PIN_3 

pin 3

PCF8574_PIN_4 

pin 4

PCF8574_PIN_5 

pin 5

PCF8574_PIN_6 

pin 6

PCF8574_PIN_7 

pin 7

Definition at line 77 of file driver_pcf8574.h.

Function Documentation

◆ pcf8574_deinit()

uint8_t pcf8574_deinit ( pcf8574_handle_t * handle)

close the chip

Parameters
[in]*handlepointer to a pcf8574 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 178 of file driver_pcf8574.c.

◆ pcf8574_get_addr_pin()

uint8_t pcf8574_get_addr_pin ( pcf8574_handle_t * handle,
pcf8574_address_t * addr_pin )

get the address pin

Parameters
[in]*handlepointer to a pcf8574 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_pcf8574.c.

◆ pcf8574_info()

uint8_t pcf8574_info ( pcf8574_info_t * info)

get chip's information

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

Definition at line 361 of file driver_pcf8574.c.

◆ pcf8574_init()

uint8_t pcf8574_init ( pcf8574_handle_t * handle)

initialize the chip

Parameters
[in]*handlepointer to a pcf8574 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_pcf8574.c.

◆ pcf8574_read()

uint8_t pcf8574_read ( pcf8574_handle_t * handle,
pcf8574_pin_t pin,
pcf8574_pin_level_t * level )

read the pin

Parameters
[in]*handlepointer to a pcf8574 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 215 of file driver_pcf8574.c.

◆ pcf8574_set_addr_pin()

uint8_t pcf8574_set_addr_pin ( pcf8574_handle_t * handle,
pcf8574_address_t addr_pin )

set the address pin

Parameters
[in]*handlepointer to a pcf8574 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_pcf8574.c.

◆ pcf8574_write()

uint8_t pcf8574_write ( pcf8574_handle_t * handle,
pcf8574_pin_t pin,
pcf8574_pin_level_t level )

write the pin

Parameters
[in]*handlepointer to a pcf8574 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 253 of file driver_pcf8574.c.