EasyManua.ls Logo

Atmel SAM4 Series User Manual

Atmel SAM4 Series
26 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #8 background imageLoading...
Page #8 background image
AT07334: SAM4 TWI Master Mode Driver [APPLICATION NOTE]
42274A-MCU-05/2014
8
4. API Overview
4.1 Variable and Type Definitions
4.1.1 Type twim_transfer_status_t
typedef enum twim_transfer_status twim_transfer_status_t
See twim_transfer_status for enumeration definitions.
4.1.2 Type twim_callback_t
typedef void(* twim_callback_t )(Twim *)
4.2 Structure Definitions
4.2.1 Struct twim_config
This is the configuration structure for the TWI Master device. It is used as an argument for twim_set_config to
provide the desired configurations for the module.
Table 4-1. Members
Type Name Description
uint8_t clock_drive_strength_low Pull-down drive strength of the
TWCK output buffer
uint8_t clock_slew_limit Slew limit of the TWCK output
buffer
uint8_t data_drive_strength_low Pull-down drive strength of the
TWD output buffer
uint8_t data_setup_cycles Clock cycles for data setup count
uint8_t data_slew_limit Slew limit of the TWD output buffer
uint8_t hs_clock_drive_strength_high Pull-up drive strength of the TWCK
output buffer in high speed mode
uint8_t hs_clock_drive_strength_low Pull-down drive strength of the
TWCK output buffer in high speed
mode
uint8_t hs_clock_slew_limit Slew limit of the TWCK output
buffer in high speed mode
uint8_t hs_data_drive_strength_low Pull-down drive strength of the
TWD output buffer in high speed
mode
uint8_t hs_data_slew_limit Slew limit of the TWD output buffer
in high speed mode
uint8_t hsmode_data_setup_cycles Clock cycles for data setup count
in high speed mode
uint32_t hsmode_speed The baudrate of the TWI bus in
high speed mode

Table of Contents

Question and Answer IconNeed help?

Do you have a question about the Atmel SAM4 Series and is the answer not in the manual?

Atmel SAM4 Series Specifications

General IconGeneral
ArchitectureARM Cortex-M4
DAC12-bit, up to 2 channels
Communication InterfacesUSB, USART, SPI, I2C, CAN
Operating Voltage1.62V to 3.6V
Package TypesBGA, QFN
Operating Temperature-40°C to +85°C

Summary

Prerequisites

Module Overview

TWI Bus Topology

Describes the physical layout and components of the TWI bus, including pull-up resistors.

Examples

API Overview

Variable and Type Definitions

Details the variable and type definitions used within the TWIM driver API, including transfer status and callback types.

Structure Definitions

Describes the structure definitions for configuring the TWIM module, such as twim_config and twim_package.

Macro Definitions

Lists and explains the macro definitions used for TWI driver compatibility and configuration settings.

Function Definitions

Details the available functions for controlling the TWIM module, including read, write, and configuration operations.

Enumeration Definitions

Explains the enumerated type definitions, such as twim_transfer_status, for driver status reporting.

Special Considerations

Extra Information

Acronyms

Provides a list of acronyms and their definitions used throughout the TWIM driver documentation.

TWIM Master Example

Purpose

States the objective of the TWIM Master Example, which is to demonstrate driver usage for EEPROM access.

Requirements

Lists the necessary hardware and software requirements for running the TWIM Master Example.

Connections for Board: SAM4L Xplained Pro

Details the specific pin connections required for the SAM4L Xplained Pro board to interface with an EEPROM.

Connections for Board: SAM4L-EK

Details the specific pin connections required for the SAM4L-EK board to interface with an EEPROM.

Description

Outlines the steps involved in the TWIM Master Example: writing data, reading data, and comparing results.

Usage

Provides instructions on how to build, download, and run the TWIM Master Example on the evaluation board.

Quick Start Guide

Use Cases

Presents different use cases for the SAM4 TWI Master Mode Driver, highlighting TWIM Basic Usage.

TWIM Basic Usage

Demonstrates the basic steps required to initialize the TWIM module for fundamental operation.

Setup Steps

Guides the user through the essential setup steps, including prerequisites and workflow for configuring the TWIM module.

Usage Steps

Details the practical steps for sending and receiving data using the TWIM driver, including code examples.