demo/uart_blaster/nvm/nvm_settings.h

/*******************************************************************************
* # License
* Copyright 2019 Silicon Laboratories Inc. www.silabs.com
*******************************************************************************
*
* The licensor of this software is Silicon Laboratories Inc. Your use of this
* software is governed by the terms of Silicon Labs Master Software License
* Agreement (MSLA) available at
* www.silabs.com/about-us/legal/master-software-license-agreement. This
* software is distributed to you in Source Code format and is governed by the
* sections of the MSLA applicable to Source Code.
*
******************************************************************************/
#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