ADP service implementation.
Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
Macros | |
#define | EDBG_TWI EDBG_I2C_MODULE |
#define | TIMEOUT 1000 |
#define | TWI_EDBG_SLAVE_ADDR 0x28 |
Functions | |
enum status_code | adp_interface_init (void) |
Initialize EDBG I2C communication for SAM0. More... | |
enum status_code | adp_interface_read_response (uint8_t *rx_buf, uint16_t length) |
Read response on I2C from PC. More... | |
static enum status_code | adp_interface_send (uint8_t *tx_buf, uint16_t length) |
void | adp_interface_transceive_procotol (uint8_t *tx_buf, uint16_t length, uint8_t *rx_buf) |
Sends and reads protocol packet data byte on I2C. More... | |
Variables | |
struct i2c_master_module | i2c_master_instance |
#define EDBG_TWI EDBG_I2C_MODULE |
Referenced by adp_interface_init().
#define TIMEOUT 1000 |
#define TWI_EDBG_SLAVE_ADDR 0x28 |
Referenced by adp_interface_read_response(), and adp_interface_send().
enum status_code adp_interface_init | ( | void | ) |
Initialize EDBG I2C communication for SAM0.
References i2c_master_config::buffer_timeout, EDBG_TWI, i2c_master_enable(), i2c_master_get_config_defaults(), i2c_master_init(), i2c_master_instance, and system_init().
enum status_code adp_interface_read_response | ( | uint8_t * | rx_buf, |
uint16_t | length | ||
) |
Read response on I2C from PC.
return Status
[in] | rx_buf | Pointer to receive the data |
[in] | length | The length of the read data |
[out] | rx_buf | Pointer to store the received SPI character |
References i2c_master_packet::address, i2c_master_packet::data, i2c_master_packet::data_length, i2c_master_instance, i2c_master_read_packet_wait(), rx_buf, status, STATUS_ERR_IO, and TWI_EDBG_SLAVE_ADDR.
Referenced by adp_interface_transceive_procotol().
|
static |
References i2c_master_packet::address, i2c_master_instance, i2c_master_write_packet_wait(), length, status, TWI_EDBG_SLAVE_ADDR, and tx_buf.
Referenced by adp_interface_transceive_procotol().
void adp_interface_transceive_procotol | ( | uint8_t * | tx_buf, |
uint16_t | length, | ||
uint8_t * | rx_buf | ||
) |
Sends and reads protocol packet data byte on I2C.
[in] | tx_buf | Pointer to send the protocol packet data |
[in] | length | The length of the send protocol packet data |
[out] | rx_buf | Pointer to store the received I2C character |
References adp_interface_read_response(), and adp_interface_send().
struct i2c_master_module i2c_master_instance |
Referenced by adp_interface_init(), adp_interface_read_response(), adp_interface_send(), configure_i2c(), configure_i2c_callbacks(), configure_i2c_master(), edbg_eui_read_eui64(), i2c_write_complete_callback(), main(), main_cdc_disable(), nm_bus_deinit(), nm_bus_init(), run_i2c_full_speed_test(), run_i2c_init_test(), run_i2c_master_transfer_test(), setup_dma_descriptor(), and show_extension_boards_information().