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 |
Referenced by main().
#define TEST_DATA_LENGTH (sizeof(test_data_tx)/sizeof(uint8_t)) |
Data to be sent.
Referenced by main().
|
static |
Configure the Console UART.
References uart_rs232_options::baudrate, stdio_serial_init(), and sysclk_enable_peripheral_clock().
Referenced by main().
int main | ( | void | ) |
Application entry point for AT24CXX Component Example.
References AT24C_MEM_ADDR, AT24C_READ_SUCCESS, AT24C_TWI_CLK, AT24C_WRITE_SUCCESS, at24cxx_fill_pattern(), at24cxx_read_continuous(), at24cxx_read_page(), at24cxx_write_continuous(), at24cxx_write_page(), BOARD_AT24C_TWI_INSTANCE, board_init(), configure_console(), ioport_set_pin_level(), twi_options::master_clk, MEMORY_PATTERN, PAGE_ADDR, PAGE_SIZE, twi_options::speed, STRING_HEADER, sysclk_get_cpu_hz(), sysclk_init(), TEST_DATA_LENGTH, twi_master_setup(), and TWI_SUCCESS.
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().
|
static |
Reception buffer.
|
static |