TWIM PDCA Example for SAM.
Copyright (c) 2013-2018 Microchip Technology Inc. and its subsidiaries.
#include <asf.h>
#include <string.h>
#include "conf_example.h"
Macros | |
#define | PATTERN_TEST "SAM4L TWIM PDCA Example" |
#define | PATTERN_TEST_LENGTH (sizeof(PATTERN_TEST)/sizeof(uint8_t)) |
#define | PDCA_PID_TWIM1_RX 6 |
#define | PDCA_PID_TWIM1_TX 24 |
#define | PDCA_RX_CHANNEL 1 |
#define | PDCA_TX_CHANNEL 0 |
Functions | |
static void | configure_console (void) |
Configure serial console. More... | |
static status_code_t | init_test (void) |
Initialize the TWIM module. More... | |
static void | read_test_pdca (void) |
static void | write_test_pdca (void) |
int | main (void) |
Variables | |
twi_package_t | packet_rx |
twi_package_t | packet_tx |
TWI data package. More... | |
static const pdca_channel_config_t | PDCA_RX_CONFIGS |
static const pdca_channel_config_t | PDCA_TX_CONFIGS |
uint8_t | read_data [PATTERN_TEST_LENGTH] |
Array to store the received test data. More... | |
uint8_t | write_data [PATTERN_TEST_LENGTH+TARGET_ADDR_LGT] |
Array to store the test data for sending. More... | |
#define PATTERN_TEST "SAM4L TWIM PDCA Example" |
Referenced by main(), and write_test_pdca().
#define PATTERN_TEST_LENGTH (sizeof(PATTERN_TEST)/sizeof(uint8_t)) |
Referenced by main(), read_test_pdca(), and write_test_pdca().
#define PDCA_PID_TWIM1_RX 6 |
#define PDCA_PID_TWIM1_TX 24 |
#define PDCA_RX_CHANNEL 1 |
Referenced by read_test_pdca().
#define PDCA_TX_CHANNEL 0 |
Referenced by write_test_pdca().
|
static |
Configure serial console.
References uart_rs232_options::baudrate, and stdio_serial_init().
Referenced by main().
|
static |
Initialize the TWIM module.
References cpu_speed, sysclk_get_peripheral_bus_hz(), twim_config::twim_clk, twim_default_callback(), twim_set_callback(), and twim_set_config().
Referenced by main().
int main | ( | void | ) |
References board_init(), BOARD_NAME, configure_console(), init_test(), PATTERN_TEST, PATTERN_TEST_LENGTH, pdca_enable(), read_data, read_test_pdca(), status, STATUS_OK, sysclk_init(), and write_test_pdca().
|
static |
|
static |
References packet_tx, PATTERN_TEST, PATTERN_TEST_LENGTH, PDCA_CH_TRANSFER_COMPLETED, pdca_channel_enable(), pdca_channel_set_config(), pdca_get_channel_status(), PDCA_TX_CHANNEL, twim_pdca_transfer_prepare(), and write_data.
Referenced by main().
twi_package_t packet_rx |
twi_package_t packet_tx |
TWI data package.
|
static |
Referenced by adc_pdca_set_config().
|
static |
Referenced by adc_pdca_set_config().
uint8_t read_data[PATTERN_TEST_LENGTH] |
Array to store the received test data.
uint8_t write_data[PATTERN_TEST_LENGTH+TARGET_ADDR_LGT] |
Array to store the test data for sending.