Loading...
Searching...
No Matches
flash_utils.h File Reference

Utility functions, macros, and types for read-only memory. More...

Detailed Description

Utility functions, macros, and types for read-only memory.

Author
Marian Buschsieweke maria.nosp@m.n.bu.nosp@m.schsi.nosp@m.ewek.nosp@m.e@ovg.nosp@m.u.de

Definition in file flash_utils.h.

#include <stdio.h>
#include <string.h>
#include "cpu_conf.h"
#include "kernel_defines.h"
+ Include dependency graph for flash_utils.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define FLASH_ATTR   <IMPLEMTATION_DEFINED>
 C type qualifier required to place a variable in flash.
 
#define PRIsflash   <IMPLEMTATION_DEFINED>
 Format specifier for printing FLASH CONST char *
 
#define TO_FLASH(str_literal)   <IMPLEMTATION_DEFINED>
 Macro to allocate a string literal on flash and return a FLASH_ATTR const char * pointer to it Usage:
 
#define FLASH_PUTS(x)   flash_puts(TO_FLASH(x))
 A convenience wrapper for flash_puts(TO_FLASH("str literal"))
 

Functions

int flash_strcmp (const char *ram, FLASH_ATTR const char *flash)
 Like strcmp(), but the second string resides in flash.
 
int flash_strncmp (const char *ram, FLASH_ATTR const char *flash, size_t n)
 Like strncmp(), but the first string resides in flash.
 
size_t flash_strlen (FLASH_ATTR const char *flash)
 Like strlen(), but the string resides in flash.
 
char * flash_strcpy (char *ram, FLASH_ATTR const char *flash)
 Like strcpy(), but the source flash resides in flash.
 
char * flash_strncpy (char *ram, FLASH_ATTR const char *flash, size_t n)
 Like strncpy(), but the source flash resides in flash.
 
int flash_printf (FLASH_ATTR const char *flash,...)
 Like printf(), but the format string resides in flash.
 
int flash_vprintf (FLASH_ATTR const char *flash, va_list args)
 Like vprintf(), but the format string resides in flash.
 
int flash_fprintf (FILE *stream, FLASH_ATTR const char *flash,...)
 Like fprintf(), but the format string resides in flash.
 
int flash_vfprintf (FILE *stream, FLASH_ATTR const char *flash, va_list args)
 Like vfprintf(), but the format string resides in flash.
 
int flash_snprintf (char *buf, size_t buf_len, FLASH_ATTR const char *flash,...)
 Like snprintf(), but the format string resides in flash.
 
int flash_vsnprintf (char *buf, size_t buf_len, FLASH_ATTR const char *flash, va_list args)
 Like vsnprintf(), but the format string resides in flash.
 
void flash_puts (FLASH_ATTR const char *flash)
 Like puts(), but the string resides in flash.
 
void * flash_memcpy (void *dest, FLASH_ATTR const void *src, size_t n)
 Like memcpy(), but src resides in flash.
 
static void flash_print_str (FLASH_ATTR const char *flash)
 Like flash_puts but without line break.