no-OS
Functions | Variables
24xx32a.c File Reference

24AA32A/24LC32A EEPROM Interfaces More...

#include <stdbool.h>
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include "24xx32a.h"
#include "no_os_eeprom.h"
#include "no_os_i2c.h"
#include "no_os_error.h"
#include "no_os_delay.h"
#include "no_os_util.h"
#include "no_os_alloc.h"
Include dependency graph for 24xx32a.c:

Functions

int32_t eeprom_24xx32a_init (struct no_os_eeprom_desc **desc, const struct no_os_eeprom_init_param *param)
 Initialize the 24XX32A EEPROM. More...
 
int32_t eeprom_24xx32a_read (struct no_os_eeprom_desc *desc, uint32_t address, uint8_t *data, uint16_t bytes)
 Read the 24XX32A EEPROM data. More...
 
int32_t eeprom_24xx32a_write (struct no_os_eeprom_desc *desc, uint32_t address, uint8_t *data, uint16_t bytes)
 Write the 24XX32A EEPROM data. More...
 
int32_t eeprom_24xx32a_remove (struct no_os_eeprom_desc *desc)
 Free the resources allocated by eeprom_24xx32a_init() More...
 

Variables

const struct no_os_eeprom_platform_ops eeprom_24xx32a_ops
 24XX32A EEPROM specific ops structure More...
 

Detailed Description

24AA32A/24LC32A EEPROM Interfaces

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.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Function Documentation

◆ eeprom_24xx32a_init()

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

Initialize the 24XX32A EEPROM.

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

◆ eeprom_24xx32a_read()

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

Read the 24XX32A 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

◆ eeprom_24xx32a_remove()

int32_t eeprom_24xx32a_remove ( struct no_os_eeprom_desc desc)

Free the resources allocated by eeprom_24xx32a_init()

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

◆ eeprom_24xx32a_write()

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

Write the 24XX32A 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

Variable Documentation

◆ eeprom_24xx32a_ops

const struct no_os_eeprom_platform_ops eeprom_24xx32a_ops
Initial value:
= {
}

24XX32A EEPROM specific ops structure

24XX32A EEPROM specific platform ops structure

eeprom_24xx32a_remove
int32_t eeprom_24xx32a_remove(struct no_os_eeprom_desc *desc)
Free the resources allocated by eeprom_24xx32a_init()
Definition: 24xx32a.c:204
eeprom_24xx32a_read
int32_t eeprom_24xx32a_read(struct no_os_eeprom_desc *desc, uint32_t address, uint8_t *data, uint16_t bytes)
Read the 24XX32A EEPROM data.
Definition: 24xx32a.c:110
eeprom_24xx32a_init
int32_t eeprom_24xx32a_init(struct no_os_eeprom_desc **desc, const struct no_os_eeprom_init_param *param)
Initialize the 24XX32A EEPROM.
Definition: 24xx32a.c:61
eeprom_24xx32a_write
int32_t eeprom_24xx32a_write(struct no_os_eeprom_desc *desc, uint32_t address, uint8_t *data, uint16_t bytes)
Write the 24XX32A EEPROM data.
Definition: 24xx32a.c:150