SAM EDBG TWI Information Interface Example.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
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 |
#define | TWI_CLK 400000 |
TWI Bus Clock 400kHz. More... | |
Functions | |
static void | configure_console (void) |
Configure the Console UART. 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 | |
uint8_t | extension_info [64] |
uint8_t | extension_map [2] |
Extension board info structure. More... | |
uint16_t | maximum_voltage |
uint16_t | minimum_current |
uint16_t | minimum_voltage |
twi_options_t | opt |
I2C related structure. More... | |
twi_packet_t | packet_rx |
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 |
Referenced by main().
#define TIMEOUT 1000 |
Referenced by show_extension_boards_information().
#define TWI_CLK 400000 |
TWI Bus Clock 400kHz.
Referenced by configure_i2c_master().
|
static |
Configure the Console UART.
References uart_rs232_options::baudrate, stdio_serial_init(), and sysclk_enable_peripheral_clock().
Referenced by main().
|
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 twi_options::master_clk, pmc_enable_periph_clk(), twi_options::speed, sysclk_get_cpu_hz(), TWI_CLK, twi_master_init(), and TWI_SUCCESS.
Referenced by main().
|
static |
Function for show the extension boards information.
show extension boards information
References extension_info, maximum_voltage, minimum_current, and minimum_voltage.
Referenced by show_extension_boards_information().
int main | ( | void | ) |
Main application.
References board_init(), configure_console(), configure_i2c_master(), show_extension_boards_information(), STRING_HEADER, and sysclk_init().
|
static |
Function for show the extension boards information.
Get the extension boards info
Check and show info
show extension board info
References twi_packet::addr, twi_packet::addr_length, twi_packet::buffer, twi_packet::chip, decode_board_info(), EDBG_ADDRESS, EDBG_EXTEN_BOARDS_TOKEN, extension_map, twi_packet::length, read_buffer, TIMEOUT, twi_master_read(), and TWI_SUCCESS.
Referenced by main().
uint8_t extension_info[64] |
Referenced by decode_board_info().
uint8_t extension_map[2] |
Extension board info structure.
Referenced by show_extension_boards_information().
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().
twi_options_t opt |
I2C related structure.
Referenced by usart_spi_setup_device().
twi_packet_t packet_rx |
uint8_t read_buffer[1024] |
Read buffer.