demo/uart_blaster/nvm/nvm_settings.h

/*
* EVALUATION AND USE OF THIS SOFTWARE IS SUBJECT TO THE TERMS AND
* CONDITIONS OF THE CONTROLLING LICENSE AGREEMENT FOUND AT LICENSE.md
* IN THIS SDK. IF YOU DO NOT AGREE TO THE LICENSE TERMS AND CONDITIONS,
* PLEASE RETURN ALL SOURCE FILES TO SILICON LABORATORIES.
* (c) Copyright 2018, Silicon Laboratories Inc. All rights reserved.
*/
#pragma once
#include "gos_types.h"
#include "system/gos_nvm.h"
#include "peripherals/gos_uart.h"
#define SETTING_VERSION 0x01
typedef enum
{
UART_BLASTER_FLAG_NONE = 0,
UART_BLASTER_FLAG_VALIDATE_RX_DATA = (1 << 0),
UART_BLASTER_FLAG_RANDOM_RX_DELAY_ENABLED = (1 << 1),
UART_BLASTER_FLAG_RANDOM_TX_DELAY_ENABLED = (1 << 2),
UART_BLASTER_FLAG_RX_ENABLED = (1 << 3),
UART_BLASTER_FLAG_TX_ENABLED = (1 << 4),
UART_BLASTER_FLAG_CONFIG_UART_ENABLED = (1 << 5),
UART_BLASTER_FLAG_TX_WAIT_FOR_START = (1 << 6),
UART_BLASTER_FLAG_FORCE_16BIT = 0x7FFF
} uart_blaster_flag_t;
typedef enum
{
UART_BLASTER_LOG_LEVEL_NONE,
UART_BLASTER_LOG_LEVEL_ERROR,
UART_BLASTER_LOG_LEVEL_WARN,
UART_BLASTER_LOG_LEVEL_INFO,
UART_BLASTER_LOG_LEVEL_DEBUG
} uart_blaster_log_level_t;
typedef struct
{
uint16_t rx_length;
uint16_t rx_delay;
uint16_t rx_buffer_size;
uint16_t tx_length;
uint16_t tx_delay;
uart_blaster_log_level_t log_level;
uart_blaster_flag_t flags;
gos_uart_t uart_id;
} uart_blaster_settings_t;
// define list of NVM entries for this app
// NOTE: For backwards compatibility, it's important the values
// assigned to these entries do NOT change with new versions of your app.
// To change or modify NVM entries, add a new entry with a new value to the list.
GOS_NVM_DEFINES_START
//--------------------------------------------------------------------------
GOS_NVM_DEFINE_TYPE(BLASTER, 0),
GOS_NVM_DEFINE_ENTRY(BLASTER, SETTINGS, 0, sizeof(uart_blaster_settings_t)),
GOS_NVM_DEFINES_END