AT24MACXX Component Example for SAM.
Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
#include "asf.h"
Macros | |
#define | AT24MAC_MEM_ADDR 0x0 |
Memory Start Address of AT24MACXX chips. More... | |
#define | AT24MAC_TWIHS_CLK 400000 |
TWI Bus Clock 400kHz. More... | |
#define | MEMORY_PATTERN 0xFF |
#define | PAGE_ADDR 0 |
#define | PAGE_SIZE 16 |
#define | STRING_EOL "\r" |
#define | STRING_HEADER |
#define | TEST_DATA_LENGTH (sizeof(test_data_tx)/sizeof(uint8_t)) |
Data to be sent. More... | |
#define | WAIT_TIME 10 |
EEPROM Wait Time. More... | |
Functions | |
static void | configure_console (void) |
Configure the Console UART. More... | |
int | main (void) |
Application entry point for AT24MACXX Component Example. More... | |
static void | mdelay (uint32_t ul_dly_ticks) |
Wait for the given number of milliseconds (using the dwTimeStamp generated by the SAM microcontrollers' system tick). More... | |
void | SysTick_Handler (void) |
Handler for System Tick interrupt. More... | |
Variables | |
volatile uint32_t | g_ul_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 AT24MAC_MEM_ADDR 0x0 |
Memory Start Address of AT24MACXX chips.
Referenced by main().
#define AT24MAC_TWIHS_CLK 400000 |
TWI Bus Clock 400kHz.
Referenced by main().
#define MEMORY_PATTERN 0xFF |
Referenced by main().
#define PAGE_ADDR 0 |
Referenced by main().
#define PAGE_SIZE 16 |
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().
#define WAIT_TIME 10 |
EEPROM Wait Time.
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 AT24MACXX Component Example.
References AT24MAC_MEM_ADDR, AT24MAC_READ_SUCCESS, AT24MAC_TWIHS_CLK, AT24MAC_WRITE_SUCCESS, at24macxx_fill_pattern(), at24macxx_read_continuous(), at24macxx_read_page(), at24macxx_reset(), at24macxx_write_continuous(), at24macxx_write_page(), BOARD_AT24MAC_TWIHS_INSTANCE, board_init(), configure_console(), ioport_set_pin_level(), twihs_options::master_clk, mdelay(), MEMORY_PATTERN, PAGE_ADDR, PAGE_SIZE, twihs_options::speed, STRING_HEADER, sysclk_get_cpu_hz(), sysclk_init(), TEST_DATA_LENGTH, twihs_master_setup(), TWIHS_SUCCESS, and WAIT_TIME.
|
static |
Wait for the given number of milliseconds (using the dwTimeStamp generated by the SAM microcontrollers' system tick).
ul_dly_ticks | Delay to wait for, in milliseconds. |
References g_ul_ms_ticks.
Referenced by main().
void SysTick_Handler | ( | void | ) |
Handler for System Tick interrupt.
Process System Tick Event increments the timestamp counter.
volatile uint32_t g_ul_ms_ticks = 0 |
Global timestamp in milliseconds since the start of application.
uint8_t page_read_buf[PAGE_SIZE] |
uint8_t page_write_buf[PAGE_SIZE] |
|
static |
Reception buffer.
|
static |