RA Flexible Software Package Documentation  Release v5.7.0

 
D/AVE 2D Port Interface (r_drw)

Driver for the DRW peripheral on RA MCUs. This module is a port of D/AVE 2D.

Overview

Note
The D/AVE 2D Port Interface (D1 layer) is a HAL layer for the D/AVE D2 layer API and does not provide any interfaces to the user. Consult the TES Dave2D Driver Documentation for further information on using the D2 API.
For cross-platform compatibility purposes the D1 and D2 APIs are not bound by FSP coding guidelines for function names and general module functionality.

Configuration

Build Time Configurations for r_drw

The following build time configurations are defined in fsp_cfg/r_drw_cfg.h:

ConfigurationOptionsDefaultDescription
Allow Indirect Mode
  • Enabled
  • Disabled
Enabled Enable indirect mode to allow no-copy mode for d2_adddlist (see the TES Dave2D Driver Documentation for details).
Memory Allocation
  • Default
  • Custom
Default Set Memory Allocation to Default to use built-in dynamic memory allocation for the D2 heap. This will use an RTOS heap if configured; otherwise, standard C malloc and free will be used.
Set to Custom to define your own allocation scheme for the D2 heap. In this case, the developer will need to define the following functions:

void * d1_malloc(size_t size)
void d1_free(void * ptr)

Configurations for Graphics > D/AVE 2D Port Interface (r_drw)

This module can be added to the Stacks tab via New Stack > Graphics > D/AVE 2D Port Interface (r_drw).

ConfigurationOptionsDefaultDescription
D2 Device Handle NameName must be a valid C symbold2_handle0 Set the name for the d2_device handle used when calling D2 layer functions.
DRW Interrupt PriorityMCU Specific OptionsSelect the DRW_INT (display list completion) interrupt priority.

Heap Size

The D1 port layer allows the D2 driver to allocate memory as needed. There are three ways the driver can accomplish this:

  1. Allocate memory using the main heap
  2. Allocate memory using a heap provided by an RTOS
  3. Allocate memory via user-provided functions

When the "Memory Allocation" configuration option is set to "Default" the driver will use an RTOS implementation if available and the main heap otherwise. Setting the option to "Custom" allows the user to define their own scheme using the following prototypes:

void * d1_malloc(size_t size);
void d1_free(void * ptr);
Warning
If there is no RTOS-based allocation scheme the main heap will be used. Be sure that it is enabled by setting the "Heap size (bytes)" property under RA Common on the BSP tab of the RA Configuration editor.
Note
It is recommended to add 32KB of additional heap space for the D2 driver until the actual usage can be determined in your application.

Interrupt

The D1 port includes one interrupt to handle various events like display list completion or bus error. This interrupt is managed internally by the D2 driver and no callback function is available.

Usage Notes

Limitations

Developers should be aware of the following limitations when using the DRW engine: