|
libeasymcp2221 2.0.3
|
Runtime SRAM configuration for GPIO, analog references, clock, and IOC. More...
Go to the source code of this file.
Classes | |
| struct | mcp2221_sram_gp_config_t |
| SRAM configuration for one MCP2221 GP pin. More... | |
| struct | mcp2221_sram_int_config_t |
| Interrupt-on-change SRAM configuration. More... | |
| struct | mcp2221_sram_adc_config_t |
| ADC voltage-reference SRAM configuration. More... | |
| struct | mcp2221_sram_dac_ref_config_t |
| DAC voltage-reference SRAM configuration. More... | |
| struct | mcp2221_sram_dac_value_config_t |
| DAC output-code SRAM configuration. More... | |
| struct | mcp2221_sram_clock_config_t |
| Clock-output SRAM configuration. More... | |
| struct | mcp2221_sram_config_t |
| Aggregated runtime SRAM configuration. More... | |
Macros | |
| #define | MCP2221_CONFIG_KEEP (-1) |
| Preserve the current value of an SRAM configuration field. More... | |
Functions | |
| mcp2221_error_code_t | mcp2221_sram_config (mcp2221_t *dev, const mcp2221_sram_config_t *cfg) |
| Apply a runtime SRAM configuration. More... | |
Runtime SRAM configuration for GPIO, analog references, clock, and IOC.
Definition in file mcp2221_sram.h.
| #define MCP2221_CONFIG_KEEP (-1) |
Preserve the current value of an SRAM configuration field.
Use this sentinel for fields in mcp2221_sram_config_t that should remain unchanged.
Definition at line 24 of file mcp2221_sram.h.
| mcp2221_error_code_t mcp2221_sram_config | ( | mcp2221_t * | dev, |
| const mcp2221_sram_config_t * | cfg | ||
| ) |
Apply a runtime SRAM configuration.
The function validates all fields, reads the current device SRAM state, and applies the requested changes while preserving fields set to MCP2221_CONFIG_KEEP.
GPIO configuration is merged with the library's cached GPIO state when available so that output changes made through the GPIO API are preserved.
| [in] | dev | Open MCP2221 device handle. |
| [in] | cfg | SRAM configuration to apply. Must not be NULL. |