![]() |
MAXREFDES89#, MAX14871 MBED Shield
version: 0.0
MBED Shield for evaluating the MAX14871
|
#include <max7300.h>
Public Member Functions | |
| Max7300 (I2C *i2c_bus, max7300_i2c_adrs_t i2c_adrs) | |
| Constructor for Max7300 Class. More... | |
| Max7300 (PinName sda, PinName scl, max7300_i2c_adrs_t i2c_adrs) | |
| Constructor for Max7300 Class. More... | |
| ~Max7300 () | |
| Default destructor for Max7300 Class. More... | |
| int16_t | enable_ports (void) |
| Enables MAX7300 GPIO Ports. More... | |
| int16_t | disable_ports (void) |
| Disables MAX7300 GPIO Ports. More... | |
| int16_t | enable_transition_detection (void) |
| Enables Transition Detection. More... | |
| int16_t | disable_transition_detection (void) |
| Disables Transition Detection. More... | |
| int16_t | config_port (max7300_port_number_t port_num, max7300_port_type_t port_type) |
| Configures a single MAX7300 GPIO port. More... | |
| int16_t | config_4_ports (max7300_port_number_t low_port, uint8_t data) |
| Configure 4 MAX7300 GPIO ports. More... | |
| int16_t | config_all_ports (max7300_port_type_t port_type) |
| Configures all MAX7300 GPIO ports. More... | |
| int16_t | read_port (max7300_port_number_t port_num) |
| Read a single MAX7300 GPIO port. More... | |
| int16_t | write_port (max7300_port_number_t port_num, uint8_t data) |
| Write a single MAX7300 GPIO port. More... | |
| int16_t | read_8_ports (max7300_port_number_t low_port) |
| Read 8 MAX7300 GPIO ports. More... | |
| int16_t | write_8_ports (max7300_port_number_t low_port, uint8_t data) |
| Write 8 MAX7300 GPIO ports. More... | |
| int16_t | read_mask_register (bool enable_snapshot) |
| Read transition detection mask register. More... | |
| int16_t | write_mask_register (uint8_t data) |
| Write transition detection mask register. More... | |
| Max7300::Max7300 | ( | I2C * | i2c_bus, |
| max7300_i2c_adrs_t | i2c_adrs | ||
| ) |
Constructor for Max7300 Class.
Allows user to use existing I2C object
On Entry:
| [in] | i2c_bus | - pointer to existing I2C object |
| [in] | i2c_adrs | - 7-bit slave address of MAX7300 |
On Exit:
| Max7300::Max7300 | ( | PinName | sda, |
| PinName | scl, | ||
| max7300_i2c_adrs_t | i2c_adrs | ||
| ) |
Constructor for Max7300 Class.
Allows user to create a new I2C object if not already using one
On Entry:
| [in] | sda | - sda pin of I2C bus |
| [in] | scl | - scl pin of I2C bus |
| [in] | i2c_adrs | - 7-bit slave address of MAX7300 |
On Exit:
| Max7300::~Max7300 | ( | ) |
| int16_t Max7300::config_4_ports | ( | max7300_port_number_t | low_port, |
| uint8_t | data | ||
| ) |
Configure 4 MAX7300 GPIO ports.
Allows user to configure 4 ports at a time
On Entry:
| [in] | low_port | - lowest of 4 ports to configure, on 4 port boundaries as in datasheet |
| [in] | data | - Byte with each ports desired type with the following format - xx|xx|xx|xx |
On Exit:
| int16_t Max7300::config_all_ports | ( | max7300_port_type_t | port_type | ) |
Configures all MAX7300 GPIO ports.
Allows user to configure all ports to a single type
On Entry:
| [in] | port_type | - One of the following port types MAX7300_PORT_OUTPUT MAX7300_PORT_INPUT MAX7300_PORT_INPUT_PULLUP |
On Exit:
| int16_t Max7300::config_port | ( | max7300_port_number_t | port_num, |
| max7300_port_type_t | port_type | ||
| ) |
Configures a single MAX7300 GPIO port.
Configures MAX7300 GPIO port as either an output, input, or input with pullup.
On Entry:
| [in] | port_num | - GPIO port to configure |
| [in] | port_type | - One of the following port types MAX7300_PORT_OUTPUT MAX7300_PORT_INPUT MAX7300_PORT_INPUT_PULLUP |
On Exit:
| int16_t Max7300::disable_ports | ( | void | ) |
Disables MAX7300 GPIO Ports.
Clears 'S' bit of configuration register
On Entry:
On Exit:
| int16_t Max7300::disable_transition_detection | ( | void | ) |
Disables Transition Detection.
Clears 'M' bit of configuration register
On Entry:
On Exit:
| int16_t Max7300::enable_ports | ( | void | ) |
Enables MAX7300 GPIO Ports.
Sets 'S' bit of configuration register
On Entry:
On Exit:
| int16_t Max7300::enable_transition_detection | ( | void | ) |
Enables Transition Detection.
Sets 'M' bit of configuration register
On Entry:
On Exit:
| int16_t Max7300::read_8_ports | ( | max7300_port_number_t | low_port | ) |
Read 8 MAX7300 GPIO ports.
On Entry:
| [in] | low_port | - lowest port of 8 ports to read, on 8 port boundaries as in datasheet. Max is port 24 |
On Exit:
| int16_t Max7300::read_mask_register | ( | bool | enable_snapshot | ) |
Read transition detection mask register.
See page 11 of DS, right hand side column, paragraph 2 for details on one-shot event.
On Entry:
| [in] | enable_snapshot | - true to re-enable transition detection |
On Exit:
| int16_t Max7300::read_port | ( | max7300_port_number_t | port_num | ) |
Read a single MAX7300 GPIO port.
On Entry:
| [in] | port_num | - MAX7300 port number to read |
On Exit:
| int16_t Max7300::write_8_ports | ( | max7300_port_number_t | low_port, |
| uint8_t | data | ||
| ) |
Write 8 MAX7300 GPIO ports.
On Entry:
| [in] | low_port | - lowest port of 8 ports to write, on 8 port boundaries as in datasheet. Max is port 24 |
| [in] | data | - Data is written to ports |
On Exit:
| int16_t Max7300::write_mask_register | ( | uint8_t | data | ) |
Write transition detection mask register.
Enables transition detection on Ports 30-24
On Entry:
| [in] | data | - Bits to set |
On Exit:
| int16_t Max7300::write_port | ( | max7300_port_number_t | port_num, |
| uint8_t | data | ||
| ) |
Write a single MAX7300 GPIO port.
On Entry:
| [in] | port_num | - MAX7300 port to write |
| [in] | data | - lsb of byte is written to port |
On Exit: