Microchip® Advanced Software Framework

at24macxx_example.c File Reference

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
Value:
"--AT24MACXX Example --\r\n" \
"-- "BOARD_NAME" --\r\n" \
"-- Compiled: "__DATE__" "__TIME__" --"STRING_EOL
#define BOARD_NAME
Name of the board.
Definition: same70_xplained.h:75
#define STRING_EOL
Definition: at24macxx_example.c:86

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 void configure_console ( void  )
static
static void mdelay ( uint32_t  ul_dly_ticks)
static

Wait for the given number of milliseconds (using the dwTimeStamp generated by the SAM microcontrollers' system tick).

Parameters
ul_dly_ticksDelay 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.

Referenced by mdelay().

uint8_t page_read_buf[PAGE_SIZE]
uint8_t page_write_buf[PAGE_SIZE]
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', 'M', 'A', 'C', 'X', 'X', ' ', 'E',
'X', 'A', 'M', 'P', 'L', 'E'
}