Arduino-TWI
Two-Wire Interface (TWI) library for Arduino
AT24C32 Class Reference

#include <AT24CXX.h>

Inheritance diagram for AT24C32:
Inheritance graph
Collaboration diagram for AT24C32:
Collaboration graph

Public Member Functions

 AT24C32 (TWI &twi, uint8_t subaddr=0)
 
bool is_ready ()
 
int read (void *dest, uint16_t src, size_t count)
 
int write (uint16_t dest, const void *src, size_t count)
 

Public Attributes

const uint16_t PAGE_MAX
 
const uint16_t PAGE_MASK
 
const size_t SIZE
 

Protected Member Functions

int read (void *buf, size_t count)
 
int write (const void *buf, size_t count)
 
int write (iovec_t *vp)
 
bool acquire ()
 
bool release ()
 

Protected Attributes

TWIm_twi
 
uint8_t m_addr
 

Detailed Description

The AT24C32 provides 32,768 bits of serial electrically erasable and programmable read only memory (EEPROM) organized as 4096 words of 8 bits each. 32-Byte page write mode.

See Atmel Product description (Rev. 0336K-SEEPR-7/03), www.atmel.com/images/doc0336.pdf

Definition at line 174 of file AT24CXX.h.

Constructor & Destructor Documentation

AT24C32::AT24C32 ( TWI twi,
uint8_t  subaddr = 0 
)
inline

Definition at line 176 of file AT24CXX.h.

Member Function Documentation

bool TWI::Device::acquire ( )
inlineinherited

Start transaction. Return true(1) if successful otherwise false(0).

Returns
bool.

Definition at line 51 of file TWI.h.

bool AT24CXX::is_ready ( )
inlineinherited

Return true(1) if the device is ready, write cycle is completed, otherwise false(0).

Returns
bool.

Definition at line 82 of file AT24CXX.h.

int TWI::Device::read ( void *  buf,
size_t  count 
)
inlineinherited

Read data from device to given buffer.

Parameters
[in]bufbuffer pointer.
[in]countbuffer size in bytes.
Returns
number of bytes read or negative error code.

Definition at line 72 of file TWI.h.

int AT24CXX::read ( void *  dest,
uint16_t  src,
size_t  count 
)
inlineinherited

Read eeprom block with the given size into the buffer from the address. Return number of bytes read or negative error code.

Parameters
[in]destbuffer to read from eeprom.
[in]srcaddress in eeprom to read from.
[in]countnumber of bytes to read.
Returns
number of bytes or negative error code.

Definition at line 98 of file AT24CXX.h.

bool TWI::Device::release ( )
inlineinherited

Stop transaction. Return true(1) if successful otherwise false(0).

Returns
bool.

Definition at line 61 of file TWI.h.

int TWI::Device::write ( const void *  buf,
size_t  count 
)
inlineinherited

Write data from the given buffer to device.

Parameters
[in]bufbuffer pointer.
[in]countbuffer size in bytes.
Returns
number of bytes written or negative error code.

Definition at line 83 of file TWI.h.

int TWI::Device::write ( iovec_t vp)
inlineinherited

Write data to device with from given io vector.

Parameters
[in]vpio vector pointer.
Returns
number of bytes written or negative error code.

Definition at line 93 of file TWI.h.

int AT24CXX::write ( uint16_t  dest,
const void *  src,
size_t  count 
)
inlineinherited

Write eeprom block at given address with the contents from the buffer. Return number of bytes written or negative error code.

Parameters
[in]destaddress in eeprom to read write to.
[in]srcbuffer to write to eeprom.
[in]countnumber of bytes to write.
Returns
number of bytes or negative error code.

Definition at line 124 of file AT24CXX.h.

Member Data Documentation

uint8_t TWI::Device::m_addr
protectedinherited

Device address.

Definition at line 103 of file TWI.h.

TWI& TWI::Device::m_twi
protectedinherited

Two-Wire Interface Manager.

Definition at line 100 of file TWI.h.

const uint16_t AT24CXX::PAGE_MASK
inherited

Memory addres page mask.

Definition at line 54 of file AT24CXX.h.

const uint16_t AT24CXX::PAGE_MAX
inherited

Number of bytes in max write page size.

Definition at line 51 of file AT24CXX.h.

const size_t AT24CXX::SIZE
inherited

Number of bytes on device.

Definition at line 57 of file AT24CXX.h.


The documentation for this class was generated from the following file: