TWIM PDCA Example for SAM.
Copyright (c) 2013-2018 Microchip Technology Inc. and its subsidiaries.
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, CONF_UART, CONF_UART_BAUDRATE, CONF_UART_CHAR_LENGTH, CONF_UART_PARITY, CONF_UART_STOP_BITS, and stdio_serial_init().
Referenced by main().
|
static |
Initialize the TWIM module.
References EXAMPLE_TWIM, sysclk_get_peripheral_bus_hz(), twim_config::twim_clk, twim_default_callback(), TWIM_MASTER_SPEED, 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_OK, sysclk_init(), and write_test_pdca().
|
static |
References EXAMPLE_TWIM, packet_rx, PATTERN_TEST_LENGTH, PDCA_CH_TRANSFER_COMPLETED, pdca_channel_enable(), pdca_channel_set_config(), pdca_get_channel_status(), PDCA_RX_CHANNEL, read_data, TARGET_ADDR_LGT, TARGET_ADDRESS, twi_master_write(), twim_pdca_transfer_prepare(), and VIRTUALMEM_ADDR.
Referenced by main().
|
static |
References EXAMPLE_TWIM, 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, TARGET_ADDR_LGT, TARGET_ADDRESS, twim_pdca_transfer_prepare(), VIRTUALMEM_ADDR, and write_data.
Referenced by main().
twi_package_t packet_rx |
Referenced by read_test_pdca().
twi_package_t packet_tx |
TWI data package.
Referenced by write_test_pdca().
|
static |
|
static |
uint8_t read_data[PATTERN_TEST_LENGTH] |
Array to store the received test data.
Referenced by main(), and read_test_pdca().
uint8_t write_data[PATTERN_TEST_LENGTH+TARGET_ADDR_LGT] |
Array to store the test data for sending.
Referenced by write_test_pdca().