Example for TWIM driver implementation.
Functions | |
static void | init_sys_clocks (void) |
static void | twim_init (void) |
int | main (void) |
Variables | |
uint8_t | read_data [6] |
Array to store the received test data. More... | |
const uint8_t | write_data [] |
Array to store the test data for sending. More... | |
System Clock Frequencies | |
Information about Clock configuration and TWIM Module configuration | |
static scif_gclk_opt_t | gc_dfllif_ref_opt = { SCIF_GCCTRL_SLOWCLOCK, 0, false} |
static pcl_freq_param_t | pcl_freq_param |
|
static |
References cpu_relax, PASS, pcl_configure_clocks(), and pcl_freq_param.
int main | ( | void | ) |
References cpu_irq_enable, cpu_relax, FPBA_HZ, i, init_dbg_rs232(), init_sys_clocks(), irq_initialize_vectors, PATTERN_TEST_LENGTH, print_dbg(), read_data, status, STATUS_OK, twi_master_read(), twi_master_write(), twi_package_t, twim_init(), and write_data.
|
static |
For UC3L devices, TWI default pins are, TWIMS0 -> PB05,PA21 TWIMS1 -> PB04 To enable TWI clock/data in another pin, these have to be assigned to other peripherals or as GPIO.
PIN 1 & 2 in Header J44 can be used in UC3L_EK
For UC3D devices, TWI default pins are, TWIMS -> PB09 (TWCK),PA10 (TWD) To enable TWI clock/data in another pin, these have to be assigned to other peripherals or as GPIO.
TWCK can be found on header PORTB.PB1 of the STK600 with RCUC3D TWD can be found on header PORTB.PB2 of the STK600 with RCUC3D
PIN 2 & 3 in Header J24 can be used in EVK1104 PIN 1 & 2 in Header J44 can be used in UC3C_EK
References FPBA_HZ, gpio_enable_gpio_pin(), gpio_enable_module(), print_dbg(), status, STATUS_OK, twi_options_t, and twim_master_init().
Referenced by main().
|
static |
|
static |
uint8_t read_data[6] |
Array to store the received test data.
Referenced by main(), and sfh7770_calibrate().
const uint8_t write_data[] |
Array to store the test data for sending.
Referenced by flash_rw_example(), and main().