Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
EEPROM AT30TSE75X Series

Low-level driver for the AT30TSE75X Series EEPROM controller.

This driver provides access to the main features of the AT30TSE75X Series EEPROM.

Macros

#define AT30TSE75X_DEVICE_TYPE_ID_EEPROM   0x50
 
#define AT30TSE75X_DEVICE_TYPE_ID_TEMP   0x48
 
#define AT30TSE_EEPROM_TWI_ADDR
 
#define AT30TSE_TEMPERATURE_TWI_ADDR
 
#define BOARD_AT30TSE_DEVICE_ADDR   0x07 /* 0b111 */
 
#define BOARD_AT30TSE_TWI   TWI0
 
#define BOARD_AT30TSE_TWI_ID   ID_TWI0
 
#define BOARD_TWI_SPEED   10000
 
#define BOARD_USING_AT30TSE   AT30TSE758
 

Functions

uint8_t at30tse_eeprom_read (uint8_t *data, uint8_t length, uint8_t word_addr, uint8_t page)
 Read EEPROM in AT30TSE75x. More...
 
uint8_t at30tse_eeprom_write (uint8_t *data, uint8_t length, uint8_t word_addr, uint8_t page)
 Write EEPROM in AT30TSE75x. More...
 
void at30tse_init (void)
 Initialize the TWI instance used for AT30TSE75x. More...
 
uint8_t at30tse_read_register (uint8_t reg, uint8_t reg_type, uint8_t reg_size, uint8_t *buffer)
 Read register in AT30TSE75x. More...
 
uint8_t at30tse_read_temperature (double *temperature)
 Read temperature. More...
 
uint8_t at30tse_write_config_register (uint16_t value)
 Write nonvolatile configuration register in AT30TSE75x. More...
 
uint8_t at30tse_write_register (uint8_t reg, uint8_t reg_type, uint8_t reg_size, uint16_t reg_value)
 Write register in AT30TSE75x. More...
 

Variables

volatile uint8_t resolution = AT30TSE_CONFIG_RES_9_bit
 

#define AT30TSE75X_DEVICE_TYPE_ID_EEPROM   0x50
#define AT30TSE75X_DEVICE_TYPE_ID_TEMP   0x48
#define AT30TSE_EEPROM_TWI_ADDR
Value:
#define AT30TSE75X_DEVICE_TYPE_ID_EEPROM
Definition: at30tse75x.c:56
#define BOARD_AT30TSE_DEVICE_ADDR
Definition: at30tse75x.c:60

Referenced by at30tse_eeprom_read(), and at30tse_eeprom_write().

#define AT30TSE_TEMPERATURE_TWI_ADDR
Value:
#define BOARD_AT30TSE_DEVICE_ADDR
Definition: at30tse75x.c:60
#define AT30TSE75X_DEVICE_TYPE_ID_TEMP
Definition: at30tse75x.c:54

Referenced by at30tse_read_register(), and at30tse_write_register().

#define BOARD_AT30TSE_DEVICE_ADDR   0x07 /* 0b111 */
#define BOARD_AT30TSE_TWI_ID   ID_TWI0

Referenced by at30tse_init().

#define BOARD_TWI_SPEED   10000

Referenced by at30tse_init().

#define BOARD_USING_AT30TSE   AT30TSE758

uint8_t at30tse_eeprom_read ( uint8_t *  data,
uint8_t  length,
uint8_t  word_addr,
uint8_t  page 
)

Read EEPROM in AT30TSE75x.

Parameters
dataPointer to the data to be read
lengthLength of the data to be read
word_addrStart EEPROM address to be read
pageSpecify the page to be read
Returns
TWI_SUCCESS if success, otherwise false

References twi_packet::addr, AT30TSE_EEPROM_TWI_ADDR, BOARD_AT30TSE_TWI, buffer, and twi_master_read().

uint8_t at30tse_eeprom_write ( uint8_t *  data,
uint8_t  length,
uint8_t  word_addr,
uint8_t  page 
)

Write EEPROM in AT30TSE75x.

Parameters
dataPointer to the data to be written
lengthLength of the data to be written
word_addrStart EEPROM address to be written
pageSpecify the page to be written
Returns
TWI_SUCCESS if success, otherwise false

References twi_packet::addr, AT30TSE_EEPROM_TWI_ADDR, BOARD_AT30TSE_TWI, buffer, and twi_master_write().

void at30tse_init ( void  )
uint8_t at30tse_read_register ( uint8_t  reg,
uint8_t  reg_type,
uint8_t  reg_size,
uint8_t *  buffer 
)

Read register in AT30TSE75x.

Parameters
regRegister in AT30TSE75x to be read
reg_typeSpecify the type of the register, nonvolatile or not
reg_sizeRead lenght
bufferPointer to the buffer where the read data will be stored
Returns
TWI_SUCCESS if success, otherwise false

References twi_packet::addr, AT30TSE_TEMPERATURE_TWI_ADDR, BOARD_AT30TSE_TWI, buffer, and twi_master_read().

Referenced by at30tse_read_temperature().

uint8_t at30tse_read_temperature ( double *  temperature)

Read temperature.

Parameters
temperaturePointer to the buffer where the temperature will be stored
Returns
TWI_SUCCESS if success, otherwise false

References AT30TSE_CONFIG_RES_10_bit, AT30TSE_CONFIG_RES_11_bit, AT30TSE_CONFIG_RES_12_bit, AT30TSE_CONFIG_RES_9_bit, AT30TSE_NON_VOLATILE_REG, at30tse_read_register(), AT30TSE_TEMPERATURE_REG, AT30TSE_TEMPERATURE_REG_SIZE, buffer, error_code, resolution, and TWI_SUCCESS.

Referenced by htp_temperature_send(), main(), and read_temperature_fix88().

uint8_t at30tse_write_config_register ( uint16_t  value)

Write nonvolatile configuration register in AT30TSE75x.

Parameters
valueValue to be written
Returns
TWI_SUCCESS if success, otherwise false

References AT30TSE_CONFIG_REG, AT30TSE_CONFIG_REG_SIZE, AT30TSE_CONFIG_RES_Msk, AT30TSE_CONFIG_RES_Pos, AT30TSE_NON_VOLATILE_REG, at30tse_write_register(), error_code, resolution, and TWI_SUCCESS.

Referenced by main().

uint8_t at30tse_write_register ( uint8_t  reg,
uint8_t  reg_type,
uint8_t  reg_size,
uint16_t  reg_value 
)

Write register in AT30TSE75x.

Parameters
regRegister in AT30TSE75x to be read
reg_typeSpecify the type of the register, nonvolatile or not
reg_sizeWrite lenght
reg_valueValue to be written
Returns
TWI_SUCCESS if success, otherwise false

References twi_packet::addr, AT30TSE_TEMPERATURE_TWI_ADDR, BOARD_AT30TSE_TWI, data, and twi_master_write().

Referenced by at30tse_write_config_register().