ADP service implementation.
Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
Functions | |
enum status_code | adp_interface_init (void) |
Initialize EDBG SPI communication for SAM0. More... | |
enum status_code | adp_interface_read_response (uint8_t *rx_buf, uint16_t length) |
Read response on SPI from PC. More... | |
static void | adp_interface_send_start (void) |
Send SPI start condition. More... | |
static void | adp_interface_send_stop (void) |
Send SPI stop condition. More... | |
static void | adp_interface_transceive (uint8_t *tx_data, uint8_t *rx_data, uint16_t length) |
Sends and reads data byte on SPI. 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 SPI. More... | |
Variables | |
struct spi_module | edbg_spi |
struct spi_slave_inst | slave |
enum status_code adp_interface_init | ( | void | ) |
Initialize EDBG SPI communication for SAM0.
References spi_master_config::baudrate, edbg_spi, spi_config::master, spi_config::mode_specific, spi_config::mux_setting, spi_config::pinmux_pad0, spi_config::pinmux_pad1, spi_config::pinmux_pad2, spi_config::pinmux_pad3, PINMUX_UNUSED, slave, spi_attach_slave(), spi_enable(), spi_get_config_defaults(), spi_init(), spi_slave_inst_get_config_defaults(), spi_slave_inst_config::ss_pin, and system_init().
enum status_code adp_interface_read_response | ( | uint8_t * | rx_buf, |
uint16_t | length | ||
) |
Read response on SPI 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 adp_interface_send_start(), adp_interface_send_stop(), edbg_spi, spi_read_buffer_wait(), and status.
|
static |
Send SPI start condition.
References edbg_spi, slave, and spi_select_slave().
Referenced by adp_interface_read_response(), and adp_interface_transceive_procotol().
|
static |
Send SPI stop condition.
References edbg_spi, slave, and spi_select_slave().
Referenced by adp_interface_read_response(), and adp_interface_transceive_procotol().
|
static |
Sends and reads data byte on SPI.
[in] | data | Data byte to send |
[in] | tx_data | SPI character to transmit |
[out] | rx_data | Pointer to store the received SPI character |
References edbg_spi, and spi_transceive_buffer_wait().
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 SPI.
[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 SPI character |
References adp_interface_send_start(), adp_interface_send_stop(), and adp_interface_transceive().
struct spi_module edbg_spi |
struct spi_slave_inst slave |