no-OS
Loading...
Searching...
No Matches
no_os_eeprom.c File Reference

Implementation of the EEPROM APIs. More...

#include <inttypes.h>
#include <stdlib.h>
#include "no_os_eeprom.h"
#include "no_os_error.h"
Include dependency graph for no_os_eeprom.c:

Functions

int32_t no_os_eeprom_init (struct no_os_eeprom_desc **desc, const struct no_os_eeprom_init_param *param)
 Initialize the EEPROM.
 
int32_t no_os_eeprom_remove (struct no_os_eeprom_desc *desc)
 Free the resources allocated by no_os_eeprom_init()
 
int32_t no_os_eeprom_write (struct no_os_eeprom_desc *desc, uint32_t address, uint8_t *data, uint16_t bytes)
 Write the EEPROM data.
 
int32_t no_os_eeprom_read (struct no_os_eeprom_desc *desc, uint32_t address, uint8_t *data, uint16_t bytes)
 Read the EEPROM data.
 

Detailed Description

Implementation of the EEPROM APIs.

Author
Mahesh Phalke (mahes.nosp@m.h.ph.nosp@m.alke@.nosp@m.anal.nosp@m.og.co.nosp@m.m)

Copyright 2022(c) Analog Devices, Inc.

SPDX-License-Identifier: BSD-3-Clause

Function Documentation

◆ no_os_eeprom_init()

int32_t no_os_eeprom_init ( struct no_os_eeprom_desc ** desc,
const struct no_os_eeprom_init_param * param )

Initialize the EEPROM.

Parameters
desc- EEPROM descriptor
param- EEPROM init parameters
Returns
0 in case of success, negative error code otherwise

◆ no_os_eeprom_read()

int32_t no_os_eeprom_read ( struct no_os_eeprom_desc * desc,
uint32_t address,
uint8_t * data,
uint16_t bytes )

Read the EEPROM data.

Parameters
desc- EEPROM descriptor
address- EEPROM address/location to read
data- EEPROM data (pointer)
bytes- Number of data bytes to read
Returns
0 in case of success, negative error code otherwise

◆ no_os_eeprom_remove()

int32_t no_os_eeprom_remove ( struct no_os_eeprom_desc * desc)

Free the resources allocated by no_os_eeprom_init()

Parameters
desc- EEPROM descriptor
Returns
0 in case of success, negative error code otherwise

◆ no_os_eeprom_write()

int32_t no_os_eeprom_write ( struct no_os_eeprom_desc * desc,
uint32_t address,
uint8_t * data,
uint16_t bytes )

Write the EEPROM data.

Parameters
desc- EEPROM descriptor
address- EEPROM address/location to write
data- EEPROM data (pointer)
bytes- Number of data bytes to write
Returns
0 in case of success, negative error code otherwise