TWIHS Slave Example for SAM.
Copyright (c) 2013-2018 Microchip Technology Inc. and its subsidiaries.
#include "asf.h"
#include "conf_twihs_slave_example.h"
Data Structures | |
struct | _slave_device_t |
The slave device instance. More... | |
Macros | |
#define | MEMORY_SIZE 512 |
Memory size in bytes. More... | |
#define | SLAVE_ADDRESS 0x40 |
Device address of slave. More... | |
#define | STRING_EOL "\r" |
#define | STRING_HEADER |
Typedefs | |
typedef struct _slave_device_t | slave_device_t |
The slave device instance. More... | |
Functions | |
void | BOARD_TWIHS_Handler (void) |
static void | configure_console (void) |
Configure the Console UART. More... | |
int | main (void) |
Application entry point for TWIHS Slave example. More... | |
Variables | |
slave_device_t | emulate_driver |
#define MEMORY_SIZE 512 |
Memory size in bytes.
Referenced by main().
#define SLAVE_ADDRESS 0x40 |
Device address of slave.
Referenced by main().
#define STRING_EOL "\r" |
#define STRING_HEADER |
Referenced by main().
typedef struct _slave_device_t slave_device_t |
The slave device instance.
void BOARD_TWIHS_Handler | ( | void | ) |
|
static |
Configure the Console UART.
References uart_rs232_options::baudrate, stdio_serial_init(), and sysclk_enable_peripheral_clock().
Referenced by main().
int main | ( | void | ) |
Application entry point for TWIHS Slave example.
References board_init(), configure_console(), MEMORY_SIZE, pmc_enable_periph_clk(), SLAVE_ADDRESS, STRING_HEADER, sysclk_init(), twihs_enable_interrupt(), twihs_read_byte(), twihs_slave_init(), _slave_device_t::uc_acquire_address, _slave_device_t::uc_memory, _slave_device_t::us_offset_memory, and _slave_device_t::us_page_address.
slave_device_t emulate_driver |