ADP service implementation.
Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
Macros | |
#define | TIMEOUT 1000 |
#define | TWI_EDBG_SLAVE_ADDR 0x28 |
Embedded debugger TWI interface definitions | |
#define | EDBG_TWI_MODULE TWI0 |
Functions | |
enum status_code | adp_interface_init (void) |
Initialize EDBG TWI interface for SAM4S. More... | |
enum status_code | adp_interface_read_response (uint8_t *data, uint16_t length) |
Read data on TWI. More... | |
static enum status_code | adp_interface_send (uint8_t *tx_buf, uint16_t length) |
Send data on TWI. More... | |
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... | |
#define EDBG_TWI_MODULE TWI0 |
Referenced by adp_interface_init(), adp_interface_read_response(), and adp_interface_send().
#define TIMEOUT 1000 |
#define TWI_EDBG_SLAVE_ADDR 0x28 |
Referenced by adp_interface_init(), adp_interface_read_response(), and adp_interface_send().
enum status_code adp_interface_init | ( | void | ) |
Initialize EDBG TWI interface for SAM4S.
References EDBG_TWI_MODULE, twi_options::speed, sysclk_init(), TWI_EDBG_SLAVE_ADDR, and twi_master_setup().
enum status_code adp_interface_read_response | ( | uint8_t * | data, |
uint16_t | length | ||
) |
Read data on TWI.
[out] | data | Pointer to place received data |
[in] | length | Number of bytes to receive |
References twi_packet::buffer, twi_packet::chip, data, EDBG_TWI_MODULE, ERR_IO_ERROR, twi_packet::length, status, TWI_EDBG_SLAVE_ADDR, and twi_master_read().
|
static |
Send data on TWI.
[in] | data | Pointer to data to send |
[in] | length | Number of bytes to send |
References twi_packet::chip, EDBG_TWI_MODULE, TWI_EDBG_SLAVE_ADDR, twi_master_write(), 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().