Noodle
Loading...
Searching...
No Matches
noodle_io.cpp File Reference

Noodle file/storage I/O helpers. More...

#include "noodle_internal.h"
Include dependency graph for noodle_io.cpp:

Functions

void noodle_read_top_line (const char *fn, char *line, size_t maxlen)
 Read the first line from a text file.
size_t noodle_read_bytes_until (NDL_File &file, char terminator, char *buffer, size_t length)
 Read bytes until a terminator or until the buffer is full.
bool noodle_fs_init (uint8_t clk_pin, uint8_t cmd_pin, uint8_t d0_pin)
 Initialize SD_MMC with explicit 1-bit pins, or default-init other backends.
bool noodle_fs_init (uint8_t clk_pin, uint8_t cmd_pin, uint8_t d0_pin, uint8_t d1_pin, uint8_t d2_pin, uint8_t d3_pin)
 Initialize SD_MMC with explicit 4-bit pins, or default-init other backends.
bool noodle_fs_init ()
 Initialize the selected filesystem backend with default settings.
bool noodle_fs_init (uint8_t cs_pin)
 Initialize the selected filesystem backend with an SPI chip-select pin.
bool noodle_fs_init (uint8_t cs_pin, SPIClass &spi, uint8_t sck_mhz)
 Initialize SdFat with an explicit SPI bus and clock speed.
size_t noodle_read_raw (NDL_File &f, void *dst, size_t n)
 Read raw bytes from a backend file handle.
size_t noodle_write_raw (NDL_File &f, const void *src, size_t n)
 Write raw bytes to a backend file handle.
size_t noodle_read_float_block (NDL_File &f, float *dst, size_t n_floats)
 Read a block of floats using the configured scalar file format.
float noodle_read_float (NDL_File &f)
 Read a float using NOODLE_FILE_FORMAT.
byte noodle_read_byte (NDL_File &f)
 Read a byte using NOODLE_FILE_FORMAT.
void noodle_write_float (NDL_File &f, float d)
 Write a float using NOODLE_FILE_FORMAT.
void noodle_write_byte (NDL_File &f, byte d)
 Write a byte using NOODLE_FILE_FORMAT.
void noodle_delete_file (const char *fn)
 Delete a file through the selected filesystem backend.
void noodle_array_to_file (float *array, const char *fn, uint16_t n)
 Write a float array to a file.
void noodle_array_to_file (float *array, NDL_File &fo, uint16_t n)
 Write a float array to an already-open file.
void noodle_grid_to_file (byte *grid, const char *fn, uint16_t n)
 Write an n x n byte grid to a file in row-major order.
void noodle_grid_to_file (byte *grid, NDL_File &fo, uint16_t n)
 Write a byte grid to an already-open file.
void noodle_grid_to_file (float *grid, const char *fn, uint16_t n)
 Write an n x n float grid to a file in row-major order.
void noodle_grid_to_file (float *grid, NDL_File &fo, uint16_t n)
 Write a float grid to an already-open file.
void noodle_array_from_file (const char *fn, float *buffer, uint16_t K)
 Read a float array from a file.
void noodle_array_from_file (NDL_File &fi, float *buffer, uint16_t K)
 Read a float array from an already-open file.
void noodle_grid_from_file (const char *fn, byte *buffer, uint16_t K)
 Read a K x K grid into a byte buffer.
void noodle_grid_from_file (NDL_File &fi, byte *buffer, uint16_t K)
 Read a byte grid from an already-open file.
void noodle_grid_from_file (const char *fn, int8_t *buffer, uint16_t K)
 Read a K x K grid into an int8 buffer.
void noodle_grid_from_file (NDL_File &fi, int8_t *buffer, uint16_t K)
 Read an int8 grid from an already-open file.
void noodle_grid_from_file (const char *fn, float *buffer, uint16_t K)
 Read a K x K grid into a float buffer.
void noodle_grid_from_file (NDL_File &fi, float *buffer, uint16_t K)
 Read a float grid from an already-open file.

Detailed Description

Noodle file/storage I/O helpers.