openMMC
Open Source Modular MMC for AMCs
|
MCP23016 module interface functions implementations. More...
#include "FreeRTOS.h"
#include "port.h"
#include "mcp23016.h"
#include "i2c.h"
#include "i2c_mapping.h"
Functions | |
mmc_err | mcp23016_read_port (uint8_t port_num, uint8_t *readout) |
Read port pins status. | |
mmc_err | mcp23016_read_pin (uint8_t port_num, uint8_t pin, uint8_t *status) |
Read a pin status. | |
mmc_err | mcp23016_write_port (uint8_t port_num, uint8_t data) |
Write port output pins. | |
mmc_err | mcp23016_write_pin (uint8_t port_num, uint8_t pin, bool data) |
Write a output pin. | |
mmc_err | mcp23016_set_port_pol (uint8_t port_num, uint8_t pol) |
Set port pins polarity. | |
mmc_err | mcp23016_get_port_pol (uint8_t port_num, uint8_t *pol) |
Read port pins polarity. | |
mmc_err | mcp23016_set_port_dir (uint8_t port_num, uint8_t dir) |
Set port pins direction. | |
mmc_err | mcp23016_get_port_dir (uint8_t port_num, uint8_t *dir) |
Read port pins direction. | |
mmc_err | mcp23016_read_reg_pair (uint8_t reg, uint16_t *readout) |
mmc_err | mcp23016_write_reg_pair (uint8_t reg, uint16_t data) |
MCP23016 module interface functions implementations.
mmc_err mcp23016_get_port_dir | ( | uint8_t | port_num, |
uint8_t * | dir ) |
Read port pins direction.
[in] | port_num | Port number (0, 1) |
[out] | dir | Pin direction ( 0-Output 1-Input ) |
mmc_err mcp23016_get_port_pol | ( | uint8_t | port_num, |
uint8_t * | pol ) |
Read port pins polarity.
[in] | port_num | Port number (0, 1) |
[out] | pol | Pins polarity (active-high/low) |
mmc_err mcp23016_read_pin | ( | uint8_t | port_num, |
uint8_t | pin, | ||
uint8_t * | status ) |
Read a pin status.
[in] | port_num | Port number (0, 1) |
[in] | pin | Selected pin to read |
[out] | status | Pin logical status |
mmc_err mcp23016_read_port | ( | uint8_t | port_num, |
uint8_t * | readout ) |
Read port pins status.
[in] | port_num | Port number (0, 1) |
[out] | readout | 8-bit value with the status of port pins |
mmc_err mcp23016_read_reg_pair | ( | uint8_t | reg, |
uint16_t * | readout ) |
mmc_err mcp23016_set_port_dir | ( | uint8_t | port_num, |
uint8_t | dir ) |
Set port pins direction.
[in] | port_num | Port number (0, 1) |
[in] | dir | Pin direction ( 0-Output 1-Input ) |
mmc_err mcp23016_set_port_pol | ( | uint8_t | port_num, |
uint8_t | pol ) |
Set port pins polarity.
[in] | port_num | Port number (0, 1) |
[in] | pol | Polarity (active-high/low) |
mmc_err mcp23016_write_pin | ( | uint8_t | port_num, |
uint8_t | pin, | ||
bool | data ) |
Write a output pin.
[in] | port_num | Port number (0, 1) |
[in] | pin | Selected pin to write |
[in] | data | Logical status to be set |
mmc_err mcp23016_write_port | ( | uint8_t | port_num, |
uint8_t | data ) |
Write port output pins.
[in] | port_num | Port number (0, 1) |
[in] | data | 8-bit value with the pins status |
mmc_err mcp23016_write_reg_pair | ( | uint8_t | reg, |
uint16_t | data ) |