Microchip® Advanced Software Framework

at24cxx_example.c File Reference

AT24CXX Component Example for SAM.

Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries.

#include "asf.h"

Macros

#define AT24C_MEM_ADDR   0x0
 Memory Start Address of AT24CXX chips. More...
 
#define AT24C_TWI_CLK   400000
 TWI Bus Clock 400kHz. More...
 
#define MEMORY_PATTERN   0xFF
 
#define PAGE_ADDR   3
 
#define PAGE_SIZE   128
 
#define STRING_EOL   "\r"
 
#define STRING_HEADER
 
#define TEST_DATA_LENGTH   (sizeof(test_data_tx)/sizeof(uint8_t))
 Data to be sent. More...
 

Functions

static void configure_console (void)
 Configure the Console UART. More...
 
int main (void)
 Application entry point for AT24CXX Component Example. More...
 

Variables

volatile uint32_t dw_ms_ticks = 0
 Global timestamp in milliseconds since the start of application. More...
 
uint8_t page_read_buf [PAGE_SIZE]
 
uint8_t page_write_buf [PAGE_SIZE]
 
static uint8_t test_data_rx [TEST_DATA_LENGTH] = { 0 }
 Reception buffer. More...
 
static const uint8_t test_data_tx []
 

#define AT24C_MEM_ADDR   0x0

Memory Start Address of AT24CXX chips.

Referenced by main().

#define AT24C_TWI_CLK   400000

TWI Bus Clock 400kHz.

Referenced by main().

#define MEMORY_PATTERN   0xFF

Referenced by main().

#define PAGE_ADDR   3

Referenced by main().

#define PAGE_SIZE   128

Referenced by main().

#define STRING_EOL   "\r"
#define STRING_HEADER
Value:
"--AT24CXX Example --\r\n" \
"-- "BOARD_NAME" --\r\n" \
"-- Compiled: "__DATE__" "__TIME__" --"STRING_EOL
#define BOARD_NAME
Definition: fatfs_access_example.c:112
#define STRING_EOL
Definition: at24cxx_example.c:87

Referenced by main().

#define TEST_DATA_LENGTH   (sizeof(test_data_tx)/sizeof(uint8_t))

Data to be sent.

Referenced by main().

static void configure_console ( void  )
static

Configure the Console UART.

References uart_rs232_options::baudrate, stdio_serial_init(), and sysclk_enable_peripheral_clock().

Referenced by main().

volatile uint32_t dw_ms_ticks = 0

Global timestamp in milliseconds since the start of application.

uint8_t page_read_buf[PAGE_SIZE]

Referenced by run_test_page_access().

uint8_t page_write_buf[PAGE_SIZE]

Referenced by run_test_page_access().

uint8_t test_data_rx[TEST_DATA_LENGTH] = { 0 }
static

Reception buffer.

const uint8_t test_data_tx[]
static
Initial value:
= {
'S', 'A', 'M', ' ', 'A', 'T', '2', '4', 'C', 'X', 'X', ' ', 'E',
'X', 'A', 'M', 'P', 'L', 'E'
}