Microchip® Advanced Software Framework

sam0/applications/edbg_twi_information_interface/main.c File Reference

SAM EDBG TWI Information Interface Example.

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

#include <asf.h>
#include <string.h>
#include "conf_uart_serial.h"

Macros

#define EDBG_ADDRESS   0x28;
 EDBG TWI interface address. More...
 
#define EDBG_EXTEN_BOARDS_TOKEN   0xE1;
 Request token of EDBG TWI information interface. More...
 
#define EDBG_KIT_DATA_TOKEN   0xD2;
 
#define STRING_EOL   "\r"
 
#define STRING_HEADER
 
#define TIMEOUT   1000
 

Functions

static void configure_console (void)
 Configure UART console. More...
 
static void configure_i2c_master (void)
 Function for configuring I2C master module. More...
 
static void decode_board_info (uint8_t *buffer)
 Function for show the extension boards information. More...
 
int main (void)
 Main application. More...
 
static void show_extension_boards_information (void)
 Function for show the extension boards information. More...
 

Variables

static struct usart_module cdc_uart_module
 
uint8_t extension_info [64]
 
uint8_t extension_map [2]
 Extension board info structure. More...
 
struct i2c_master_module i2c_master_instance
 I2C related structure. More...
 
struct i2c_master_packet master_packet
 
uint16_t maximum_voltage
 
uint16_t minimum_current
 
uint16_t minimum_voltage
 
uint8_t read_buffer [1024]
 Read buffer. More...
 

#define EDBG_ADDRESS   0x28;

EDBG TWI interface address.

Referenced by show_extension_boards_information().

#define EDBG_EXTEN_BOARDS_TOKEN   0xE1;

Request token of EDBG TWI information interface.

Referenced by show_extension_boards_information().

#define EDBG_KIT_DATA_TOKEN   0xD2;
#define STRING_EOL   "\r"
#define STRING_HEADER
Value:
"-- EDBG TWI Information Interface Example --\r\n" \
"-- "BOARD_NAME" --\r\n" \
"-- Compiled: "__DATE__" "__TIME__" --"STRING_EOL
#define BOARD_NAME
Definition: app_init.h:140
#define STRING_EOL
Definition: sam0/applications/edbg_twi_information_interface/main.c:82

Referenced by main().

#define TIMEOUT   1000

static void configure_i2c_master ( void  )
static

Function for configuring I2C master module.

This function will configure the I2C master module with the SERCOM module to be used and pinmux settings

References i2c_master_enable(), i2c_master_get_config_defaults(), i2c_master_init(), i2c_master_instance, i2c_master_config::pinmux_pad0, and i2c_master_config::pinmux_pad1.

static void decode_board_info ( uint8_t *  buffer)
static

Function for show the extension boards information.

show extension boards information

References extension_info, i, maximum_voltage, minimum_current, minimum_voltage, and printf.

Referenced by show_extension_boards_information().

static void show_extension_boards_information ( void  )
static

struct usart_module cdc_uart_module
static
uint8_t extension_info[64]
uint8_t extension_map[2]

Extension board info structure.

Referenced by io1_board_get_info(), and show_extension_boards_information().

struct i2c_master_module i2c_master_instance

I2C related structure.

struct i2c_master_packet master_packet
uint16_t maximum_voltage

Referenced by decode_board_info().

uint16_t minimum_current

Referenced by decode_board_info().

uint16_t minimum_voltage

Referenced by decode_board_info().

uint8_t read_buffer[1024]

Read buffer.