GlobLib
HAL and API libraries for MCUs and hardware.
|
Functions for converting data types (float, uint16_t..) to byte streams for usage with EEPROM memory. More...
Files | |
file | flashWrite.h |
Header file for flashWrite library. | |
Macros | |
#define | flash_put(DATA, ADDRESS) |
Flash a given datatype to the output stream. | |
#define | flash_get(DATA, ADDRESS) |
Read a given datatype from the input stream. | |
#define | MAX_DEC 4 |
Maximum number of decimal places a float will contain. | |
Typedefs | |
typedef void(* | v_fp_u8_u16) (uint8_t, uint16_t) |
Function pointer typedef for void function with uint8_t parameter. | |
Functions | |
void | FLASHWRITE_setOutput (void(*out)(uint8_t, uint16_t)) |
Set the target output stream for flash_put functions. More... | |
void | FLASHWRITE_setInput (uint8_t(*in)(uint16_t)) |
Set the target input stream for flash_get functions. More... | |
v_fp_u8_u16 | FLASHWRITE_getOutput (void) |
Get the current target output stream. More... | |
u8_fp_u16 | FLASHWRITE_getInput (void) |
Get the current target input stream. More... | |
uint16_t | FLASHWRITE_write_u8 (uint8_t data, uint16_t address) |
Write a unsigned 8 bit integer to address given. More... | |
uint16_t | FLASHWRITE_read_u8 (uint8_t *data, uint16_t address) |
Read a unsigned 8 bit integer from address given. More... | |
uint16_t | FLASHWRITE_write_8 (int8_t data, uint16_t address) |
Write a signed 8 bit integer to address given. More... | |
uint16_t | FLASHWRITE_read_8 (int8_t *data, uint16_t address) |
Read a signed 8 bit integer from address given. More... | |
uint16_t | FLASHWRITE_write_c (char data, uint16_t address) |
Write a char to address given. More... | |
uint16_t | FLASHWRITE_read_c (char *data, uint16_t address) |
Read a char from address give. More... | |
uint16_t | FLASHWRITE_write_u16 (uint16_t data, uint16_t address) |
Write a unsigned 16 bit integer to address given. More... | |
uint16_t | FLASHWRITE_read_u16 (uint16_t *data, uint16_t address) |
Read a unsigned 16 bit integer from address give. More... | |
uint16_t | FLASHWRITE_write_16 (int16_t data, uint16_t address) |
Write a signed 16 bit integer to address give. More... | |
uint16_t | FLASHWRITE_read_16 (int16_t *data, uint16_t address) |
Read a signed 16 bit integer from address give. More... | |
uint16_t | FLASHWRITE_write_u32 (uint32_t data, uint16_t address) |
Write a unsigned 32 bit integer to address given. More... | |
uint16_t | FLASHWRITE_read_u32 (uint32_t *data, uint16_t address) |
Read a unsigned 32 bit integer from address given. More... | |
uint16_t | FLASHWRITE_write_32 (int32_t data, uint16_t address) |
Write a signed 32 bit integer to address given. More... | |
uint16_t | FLASHWRITE_read_32 (int32_t *data, uint16_t address) |
Read a signed 32 bit integer from address given. More... | |
uint16_t | FLASHWRITE_write_float (float data, uint16_t address) |
Write a float to address given. More... | |
uint16_t | FLASHWRITE_read_float (float *data, uint16_t address) |
Read a float from address given. More... | |
Functions for converting data types (float, uint16_t..) to byte streams for usage with EEPROM memory.
This module is compatable with version C11 of C standard. It implements the _Generic keyword so common flash_put() and flash_get() functions can be used to read and write flash data from multiple data types.
Two main functions exist for usage:
Current limitations
u8_fp_u16 FLASHWRITE_getInput | ( | void | ) |
Get the current target input stream.
Definition at line 43 of file flashWrite.c.
v_fp_u8_u16 FLASHWRITE_getOutput | ( | void | ) |
Get the current target output stream.
Definition at line 34 of file flashWrite.c.
uint16_t FLASHWRITE_read_16 | ( | int16_t * | data, |
uint16_t | address | ||
) |
Read a signed 16 bit integer from address give.
This function is invoked by macro definition flash_put
data | The container to store the read data |
address | The address to read from |
Definition at line 109 of file flashWrite.c.
uint16_t FLASHWRITE_read_32 | ( | int32_t * | data, |
uint16_t | address | ||
) |
Read a signed 32 bit integer from address given.
This function is invoked by macro definition flash_put
data | The container to store the read data |
address | The address to read from |
Definition at line 142 of file flashWrite.c.
uint16_t FLASHWRITE_read_8 | ( | int8_t * | data, |
uint16_t | address | ||
) |
Read a signed 8 bit integer from address given.
This function is invoked by macro definition flash_put
data | The container to store the read data |
address | The address to read from |
Definition at line 70 of file flashWrite.c.
uint16_t FLASHWRITE_read_c | ( | char * | data, |
uint16_t | address | ||
) |
Read a char from address give.
This function is invoked by macro definition flash_put
data | The container to store the read data |
address | The address to read from |
Definition at line 82 of file flashWrite.c.
uint16_t FLASHWRITE_read_float | ( | float * | data, |
uint16_t | address | ||
) |
Read a float from address given.
This function is invoked by macro definition flash_put
data | The container to store the read data |
address | The address to read from |
Definition at line 168 of file flashWrite.c.
uint16_t FLASHWRITE_read_u16 | ( | uint16_t * | data, |
uint16_t | address | ||
) |
Read a unsigned 16 bit integer from address give.
This function is invoked by macro definition flash_put
data | The container to store the read data |
address | The address to read from |
Definition at line 95 of file flashWrite.c.
uint16_t FLASHWRITE_read_u32 | ( | uint32_t * | data, |
uint16_t | address | ||
) |
Read a unsigned 32 bit integer from address given.
This function is invoked by macro definition flash_put
data | The container to store the read data |
address | The address to read from |
Definition at line 124 of file flashWrite.c.
uint16_t FLASHWRITE_read_u8 | ( | uint8_t * | data, |
uint16_t | address | ||
) |
Read a unsigned 8 bit integer from address given.
This function is invoked by macro definition flash_put
data | The container to store the read data |
address | The address to read from |
Definition at line 58 of file flashWrite.c.
void FLASHWRITE_setInput | ( | uint8_t(*)(uint16_t) | in | ) |
Set the target input stream for flash_get functions.
This function must be called before flash_get() will work.
in | Pointer to the input stream function. |
Definition at line 28 of file flashWrite.c.
void FLASHWRITE_setOutput | ( | void(*)(uint8_t, uint16_t) | out | ) |
Set the target output stream for flash_put functions.
This function must be called before flash_put() will work
out | Pointer to the output stream function. |
Definition at line 22 of file flashWrite.c.
uint16_t FLASHWRITE_write_16 | ( | int16_t | data, |
uint16_t | address | ||
) |
Write a signed 16 bit integer to address give.
This function is invoked by macro definition flash_put
data | The data to be written |
address | The address to be written to |
Definition at line 102 of file flashWrite.c.
uint16_t FLASHWRITE_write_32 | ( | int32_t | data, |
uint16_t | address | ||
) |
Write a signed 32 bit integer to address given.
This function is invoked by macro definition flash_put
data | The data to be written |
address | The address to be written to |
Definition at line 133 of file flashWrite.c.
uint16_t FLASHWRITE_write_8 | ( | int8_t | data, |
uint16_t | address | ||
) |
Write a signed 8 bit integer to address given.
This function is invoked by macro definition flash_put
data | The data to be written |
address | The address to be written to |
Definition at line 64 of file flashWrite.c.
uint16_t FLASHWRITE_write_c | ( | char | data, |
uint16_t | address | ||
) |
Write a char to address given.
This function is invoked by macro definition flash_put
data | The data to be written |
address | The address to be written to |
Definition at line 76 of file flashWrite.c.
uint16_t FLASHWRITE_write_float | ( | float | data, |
uint16_t | address | ||
) |
Write a float to address given.
This function is invoked by macro definition flash_put
data | The data to be written |
address | The address to be written to |
Definition at line 151 of file flashWrite.c.
uint16_t FLASHWRITE_write_u16 | ( | uint16_t | data, |
uint16_t | address | ||
) |
Write a unsigned 16 bit integer to address given.
This function is invoked by macro definition flash_put
data | The data to be written |
address | The address to be written to |
Definition at line 88 of file flashWrite.c.
uint16_t FLASHWRITE_write_u32 | ( | uint32_t | data, |
uint16_t | address | ||
) |
Write a unsigned 32 bit integer to address given.
This function is invoked by macro definition flash_put
data | The data to be written |
address | The address to be written to |
Definition at line 115 of file flashWrite.c.
uint16_t FLASHWRITE_write_u8 | ( | uint8_t | data, |
uint16_t | address | ||
) |
Write a unsigned 8 bit integer to address given.
This function is invoked by macro definition flash_put()
data | The data to be written |
address | The address to be written to |
Definition at line 52 of file flashWrite.c.