|
ether2ser 0.1.0
Ethernet <-> synchronous V.24 bridge firmware for RP2040 + W5500
|
#include <stddef.h>#include <string.h>#include "hardware/flash.h"#include "hardware/sync.h"#include "drivers/gpio_driver.h"#include "drivers/pio_tx_rx_driver.h"#include "drivers/w5500_driver.h"#include "system/common.h"

Go to the source code of this file.
Data Structures | |
| struct | config_t |
| Persistent configuration blob stored in flash. More... | |
Functions | |
| bool | config_read (config_t *cfg) |
| Read configuration from flash. | |
| void | config_write (const config_t *cfg) |
| Write configuration to flash. | |
| bool | config_is_valid (void) |
| Check if flash configuration magic marker is valid. | |
| void | dump_config (void) |
| Print current configuration to console/log output. | |
| void | config_wipe (void) |
| Erase persistent configuration sector. | |
| void | print_memory_usage (void) |
| Print RAM usage statistics. | |
| void | print_flash_usage (void) |
| Print flash usage statistics. | |
| bool config_is_valid | ( | void | ) |
Check if flash configuration magic marker is valid.
Definition at line 123 of file persistent_config.c.
References CONFIG_MAGIC, config_t::magic, and nonsafe_config_read().
Referenced by main().


| bool config_read | ( | config_t * | cfg | ) |
Read configuration from flash.
| cfg | Destination object. |
Definition at line 103 of file persistent_config.c.
References CONFIG_MAGIC, config_t::magic, and nonsafe_config_read().
Referenced by main().


| void config_wipe | ( | void | ) |
Erase persistent configuration sector.
Definition at line 114 of file persistent_config.c.
References FLASH_TARGET_OFFSET.
Referenced by event_dispatch().

| void config_write | ( | const config_t * | cfg | ) |
Write configuration to flash.
| cfg | Source config object. |
Definition at line 177 of file persistent_config.c.
References CONFIG_MAGIC, FLASH_TARGET_OFFSET, and config_t::magic.
Referenced by event_dispatch().

| void dump_config | ( | void | ) |
Print current configuration to console/log output.
Definition at line 129 of file persistent_config.c.
References V24_CONFIG_T::baudrate, NETWORK_CONFIG_T::broadcast_address, CONFIG_MAGIC, V24_TX_POLARITIES_T::cts_inverted, V24_RX_POLARITIES_T::dcd_inverted, V24_TX_POLARITIES_T::dtr_inverted, UDP_CONFIG_T::ip_address, config_t::local_config, LOG_INFO, config_t::magic, config_t::net_config, NETWORK_CONFIG_T::net_info, nonsafe_config_read(), V24_CONFIG_T::polarities, UDP_CONFIG_T::port, PRIu32, PRIX32, config_t::remote_config, V24_TX_POLARITIES_T::rts_inverted, V24_POLARITIES_T::rx_polarities, V24_RX_POLARITIES_T::rxc_inverted, V24_RX_POLARITIES_T::rxd_inverted, V24_POLARITIES_T::tx_polarities, V24_TX_POLARITIES_T::txc_inverted, V24_TX_POLARITIES_T::txd_inverted, config_t::v24_config, and config_t::version.
Referenced by event_dispatch(), and main().


| void print_flash_usage | ( | void | ) |
Print flash usage statistics.
Definition at line 78 of file persistent_config.c.
References BYTES_PER_KIBIBYTE, LOG_PLAIN, PRIu32, and W55RP20_FLASH_TOTAL_BYTES.
Referenced by event_dispatch().

| void print_memory_usage | ( | void | ) |
Print RAM usage statistics.
Definition at line 44 of file persistent_config.c.
References BYTES_PER_KIBIBYTE, LOG_PLAIN, PRIu32, RAM_BASE_ADDRESS, and RAM_TOTAL_KIBIBYTES.
Referenced by event_dispatch().
