EasyManua.ls Logo

Renesas RX110 User Manual

Renesas RX110
88 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
RX Family ADC Module Using Firmware Integration Technology
R01AN1666EJ0220 Rev. 2.20 Page 8 of 74
Dec 01, 2016
ADC_TRIG_SYNC_TRG0EN = 4, // MTU0 TRGE
ADC_TRIG_SYNC_TRG0FN = 5, // MTU0 TRGF
ADC_TRIG_SOFTWARE = 16 // software trigger; not for Group modes
// nor double trigger modes
// This is not set to TRSA or TRSB
} adc_trig_t;
typedef enum e_adc_add
{
ADC_ADD_OFF = 0, // addition is turned off for chans/sensors
ADC_ADD_TWO_SAMPLES = 1,
ADC_ADD_THREE_SAMPLES = 2,
ADC_ADD_FOUR_SAMPLES = 3
} adc_add_t;
typedef enum e_adc_align
{
ADC_ALIGN_RIGHT = 0x0000,
ADC_ALIGN_LEFT = 0x8000
} adc_align_t;
typedef enum e_adc_clear
{
ADC_CLEAR_AFTER_READ_OFF = 0x0000,
ADC_CLEAR_AFTER_READ_ON = 0x0020
} adc_clear_t;
typedef enum e_adc_speed
{
ADC_CONVERT_SPEED_NORM = 0x0000,
ADC_CONVERT_SPEED_HIGH = 0x0400
} adc_speed_t;
typedef struct st_adc_cfg
{
adc_add_t add_cnt;
adc_align_t alignment; // ignored if addition used
adc_clear_t clearing;
adc_speed_t conv_speed;
adc_trig_t trigger; // default and Group A trigger source
adc_trig_t trigger_groupb; // valid only for group modes
uint8_t priority; // for S12ADIO int; 1=lo 15=hi 0=off/polled
uint8_t priority_groupb; // GBADI interrupt priority; 0-15
} adc_cfg_t;
/* ADC_CONTROL() ARGUMENT DEFINITIONS */
typedef enum e_adc_cmd
{
// Commands for special hardware configurations
ADC_CMD_SET_SAMPLE_STATE_CNT,
// Commands to enable channels or sensors
ADC_CMD_ENABLE_CHANS, // enables chans and A & B INT if pri != 0
ADC_CMD_ENABLE_TEMP_SENSOR, // enables sensor and INT if priority != 0
ADC_CMD_ENABLE_VOLT_SENSOR, // enables sensor and INT if priority != 0
// Commands to enable hardware triggers or cause software trigger
ADC_CMD_ENABLE_TRIG, // ADCSR.TRGE=1 for sync/async triggers
ADC_CMD_SCAN_NOW, // software trigger start scan
Question and Answer IconNeed help?

Do you have a question about the Renesas RX110 and is the answer not in the manual?

Renesas RX110 Specifications

General IconGeneral
CPU CoreRXv1
Maximum Operating Frequency32 MHz
Operating Voltage1.8V to 5.5V
Operating Temperature-40°C to +85°C
PackageLQFP, QFN
ADC12-bit
Communication InterfacesUART, I2C, SPI

Summary

Overview

API Information

2.1 Hardware Requirements

MCU peripheral and feature requirements for the ADC driver.

2.2 Hardware Resource Requirements

Details required hardware peripherals like S12ADa/b/c/e/f and GPIO.

2.3 Software Requirements

Lists dependencies like the Renesas Board Support Package (r_bsp).

2.4 Limitations

Notes on variations in A/D converter modes and usage guidelines.

2.5 Supported Toolchains

Lists tested toolchains, e.g., Renesas RX Toolchain v2.05.00.

2.6 Header Files

Specifies required header files for configuration and API definitions.

2.7 Integer Types

Mentions ANSI C99 "Exact width integer types" for portability.

2.8 Configuration Overview

Explains build-time configuration options in r_s12ad_rx_config.h.

2.9 Code Size

Details ROM and RAM code sizes based on optimization and configuration.

2.10 API Data Structures

Details data structures used in API functions for strong type checking.

2.10.1 MCU Common Interface Types

Defines callback event types and arguments for MCU-specific interfaces.

2.10.2 RX110 Interface Types

Specifies ADC OPEN() argument definitions and trigger sources for RX110.

2.10.4 RX113 Interface Types

Specifies ADC OPEN() argument definitions and trigger sources for RX113.

2.10.5 RX130 Interface Types

Specifies ADC OPEN() argument definitions and trigger sources for RX130.

2.10.6 RX210 Interface Types

Specifies ADC OPEN() argument definitions and trigger sources for RX210.

2.10.7 RX231 Interface Types

Specifies ADC OPEN() argument definitions and trigger sources for RX231.

2.10.9 RX63x Interface Types

Specifies ADC OPEN() argument definitions and trigger sources for RX63x.

2.10.10 RX64M, RX71M Interface Types

Specifies ADC OPEN() argument definitions and resolution types for RX64M/RX71M.

2.10.11 RX65x Interface Types

Specifies ADC OPEN() argument definitions and modes for RX65x.

2.11 Return Values

Lists and explains ADC API error codes returned by functions.

2.12 Adding a FIT Module to Your Project

Describes methods for adding the FIT module to projects using the FIT plugin.

API Functions

3.1 Summary

Provides an overview of the functions included in the ADC driver design.

3.2 R_ADC_Open()

Initializes the ADC peripheral, sets mode, triggers, and priority.

3.3 R_ADC_Control()

Manages channels, sensors, triggers, interrupts, and scan operations.

3.4 R_ADC_Read()

Reads conversion results from a single channel, sensor, or register.

3.5 R_ADC_ReadAll()

Reads all potential channel sources for a snapshot of all values.

3.6 R_ADC_Close()

Ends scans, disables interrupts, and removes power from the A/D peripheral.

3.7 R_ADC_GetVersion()

Returns the driver version number at runtime.

Pin Setting

Demo Projects

5.1 s12ad_int_demo_rskrx113

Demo using periodic interrupts from MTU0 to trigger ADC scans.

5.2 s12ad_poll_demo_rskrx113

Demo scanning potentiometer via software trigger in an endless loop.

5.3 s12ad_poll_demo_rskrx130

Demo scanning potentiometer via software trigger in an endless loop.

5.4 s12ad_demo_rskrx64m

Demo using MTU3a to trigger ADC for potentiometer conversion on RX64M.

5.5 s12ad_demo_rskrx71m

Demo using MTU3a to trigger ADC for potentiometer conversion on RX71M.

5.6 s12ad_demo_rskrx231

Demo using MTU2a to trigger ADC for potentiometer conversion on RX231.

5.7 Adding a Demo to a Workspace

Instructions on how to add a demo project to an e² studio workspace.

Related Technical Updates

Website and Support

Provides links to Renesas Electronics website and inquiry contact.

Related product manuals