|
ENTS-tock
Environmental NeTworked Sensor firmware on Tock OS
|
Library for interfacing with the MB85RC1MT FRAM chip via TockOS. More...
Typedefs | |
| typedef uint32_t | fram_addr |
Enumerations | |
| enum | fram_status { FRAM_OK = 0 , FRAM_ERROR = -1 , FRAM_OUT_OF_RANGE = -2 , FRAM_BUFFER_FULL = -3 , FRAM_BUFFER_EMPTY = -4 } |
Functions | |
| fram_status | fram_write (fram_addr addr, const uint8_t *data, size_t len) |
| Write bytes at the given address. | |
| fram_status | fram_read (fram_addr addr, size_t len, uint8_t *data) |
| Read bytes at the given address. | |
| fram_addr | fram_size (void) |
| Get the total size of FRAM in bytes. | |
Library for interfacing with the MB85RC1MT FRAM chip via TockOS.
| enum fram_status |
| fram_status fram_read | ( | fram_addr | addr, |
| size_t | len, | ||
| uint8_t * | data | ||
| ) |
Read bytes at the given address.
| addr | Starting address in FRAM (0 to fram_size()-1) |
| len | Number of bytes to read |
| data | Buffer to read into (must be at least len bytes) |
Definition at line 28 of file fram.c.
References data, fram_interface, FRAM_OUT_OF_RANGE, fram_size(), and fram_interface_t::read_ptr.
Referenced by fifo_drop(), fifo_get(), fifo_load_buffer_state(), fifo_peek(), lorawan_join(), main(), main(), test_fifo_wraparound(), test_read_out_of_range(), test_read_status(), test_read_valid_data(), test_read_zero_length(), test_write_read_multiple_addresses(), and UserConfig_ReadFromFRAM().
| fram_addr fram_size | ( | void | ) |
Get the total size of FRAM in bytes.
Definition at line 36 of file fram.c.
References fram_interface, and fram_interface_t::size_ptr.
Referenced by fram_read(), fram_write(), test_fram_size(), test_read_out_of_range(), and test_write_out_of_range().
| fram_status fram_write | ( | fram_addr | addr, |
| const uint8_t * | data, | ||
| size_t | len | ||
| ) |
Write bytes at the given address.
| addr | Starting address in FRAM (0 to fram_size()-1) |
| data | Pointer to data to write |
| len | Number of bytes to write |
Definition at line 20 of file fram.c.
References data, fram_interface, FRAM_OUT_OF_RANGE, fram_size(), and fram_interface_t::write_ptr.
Referenced by fifo_put(), fifo_save_buffer_state(), lorawan_join(), main(), main(), test_fifo_wraparound(), test_read_valid_data(), test_write_out_of_range(), test_write_read_multiple_addresses(), test_write_valid_data(), test_write_zero_length(), UserConfig_WriteToFRAM(), and UserConfigClear().