Paparazzi UAS  v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Directly log values to memory for flash chips

Module XML file: direct_memory_logger.xml

Example for airframe file

This example contains all possible configuration options, not all of them are mandatory!

1 <modules>
2  <load name="direct_memory_logger.xml">
3  <configure name="DM_LOG_UART" value="UART1|UART2|UART3|UART4|UART5|UART6" />
4  <configure name="DM_LOG_SPI_DEV" value="SPI1|SPI2|SPI3|SPI4|SPI5|SPI6" />
5  <configure name="DM_LOG_SPI_SLAVE_IDX" value="SPI_SLAVE1|SPI_SLAVE2|SPI_SLAVE3|SPI_SLAVE4|SPI_SLAVE5|SPI_SLAVE6" />
6  </load>
7 </modules>

Module configuration options

Configure Options

  • name: DM_LOG_UART value: UART1|UART2|UART3|UART4|UART5|UART6
    Description: Port to read back the memory
  • name: DM_LOG_SPI_DEV value: SPI1|SPI2|SPI3|SPI4|SPI5|SPI6
    Description: SPI bus which the memory is connected to
  • name: DM_LOG_SPI_SLAVE_IDX value: SPI_SLAVE1|SPI_SLAVE2|SPI_SLAVE3|SPI_SLAVE4|SPI_SLAVE5|SPI_SLAVE6
    Description: SPI slave which the memory is connected to

Module functions

Init Functions

These initialization functions are called once on startup.

Periodic Functions

These functions are called periodically at the specified frequency from the module periodic loop.

Files

Header Files

The following headers are automatically included in modules.h

Source Files

Raw direct_memory_logger.xml file:

<!DOCTYPE module SYSTEM "module.dtd">
<module name="loggers">
<doc>
<description>
Directly log values to memory for flash chips.
</description>
<configure name="DM_LOG_UART" value="UART1|UART2|UART3|UART4|UART5|UART6" description="Port to read back the memory"/>
<configure name="DM_LOG_SPI_DEV" value="SPI1|SPI2|SPI3|SPI4|SPI5|SPI6" description="SPI bus which the memory is connected to"/>
<configure name="DM_LOG_SPI_SLAVE_IDX" value="SPI_SLAVE1|SPI_SLAVE2|SPI_SLAVE3|SPI_SLAVE4|SPI_SLAVE5|SPI_SLAVE6" description="SPI slave which the memory is connected to"/>
</doc>
<settings>
<dl_settings name="direct_memory_logger">
<dl_settings name="direct_memory">
<dl_setting module="loggers/direct_memory_logger" var="dml.status" shortname="Status" min="0" step="1" max="2" values="INIT|IDLE|ERASE|START|RUNNING|STOP|READ|READING" handler="set"/>
<dl_setting module="loggers/direct_memory_logger" var="dml.sst.flash_addr" shortname="Flash ADDR" min="0" step="1" max="16777215"/>
<dl_setting module="loggers/direct_memory_logger" var="dml.write_addr" shortname="Write ADDR" min="0" step="1" max="16777215"/>
</dl_settings>
</dl_settings>
</settings>
<header>
<file name="direct_memory_logger.h"/>
</header>
<init fun="direct_memory_logger_init()"/>
<periodic fun="direct_memory_logger_periodic()" autorun="TRUE"/>
<makefile target="ap">
<raw>
DM_LOG_UART ?= uart1
DM_LOG_UART_LOWER=$(shell echo $(DM_LOG_UART) | tr A-Z a-z)
DM_LOG_UART_UPPER=$(shell echo $(DM_LOG_UART) | tr a-z A-Z)
DM_LOG_SPI_DEV ?= spi2
DM_LOG_SPI_DEV_LOWER=$(shell echo $(DM_LOG_SPI_DEV) | tr A-Z a-z)
DM_LOG_SPI_DEV_UPPER=$(shell echo $(DM_LOG_SPI_DEV) | tr a-z A-Z)
DM_LOG_SPI_SLAVE_IDX ?= spi_slave1
DM_LOG_SPI_SLAVE_IDX_LOWER=$(shell echo $(DM_LOG_SPI_SLAVE_IDX) | tr A-Z a-z)
DM_LOG_SPI_SLAVE_IDX_UPPER=$(shell echo $(DM_LOG_SPI_SLAVE_IDX) | tr a-z A-Z)
include $(CFG_SHARED)/spi_master.makefile
</raw>
<define name="USE_$(DM_LOG_SPI_DEV_UPPER)" value="1" />
<define name="USE_$(DM_LOG_SPI_SLAVE_IDX_UPPER)" value="1" />
<define name="DM_LOG_SPI_DEV" value="$(DM_LOG_SPI_DEV_LOWER)" />
<define name="DM_LOG_SPI_SLAVE_IDX" value="$(DM_LOG_SPI_SLAVE_IDX_UPPER)" />
<define name="DM_LOG_UART" value="$(DM_LOG_UART_LOWER)"/>
<define name="USE_$(DM_LOG_UART_UPPER)"/>
<define name="$(DM_LOG_UART_UPPER)_BAUD" value="B230400"/>
<file name="direct_memory_logger.c"/>
<file name="sst25vfxxxx.c" dir="peripherals"/>
</makefile>
</module>