RZ/A1H CMSIS-RTOS RTX BSP for GR-PEACH.

Dependents:   GR-PEACH_Azure_Speech ImageZoomInout_Sample ImageRotaion_Sample ImageScroll_Sample ... more

Fork of R_BSP by Daiki Kato

SSIF

The SSIF driver implements transmission and reception functionality which uses the SSIF in the RZ/A Series.

Hello World!

Import program

00001 #include "mbed.h"
00002 #include "R_BSP_Ssif.h"
00003 #include "sine_data_tbl.h"
00004 
00005 //I2S send only, The upper limit of write buffer is 8.
00006 R_BSP_Ssif ssif(P4_4, P4_5, P4_7, P4_6, 0x80, 8, 0);
00007 
00008 static void callback_ssif_write_end(void * p_data, int32_t result, void * p_app_data) {
00009     if (result < 0) {
00010         printf("ssif write callback error %d\n", result);
00011     }
00012 }
00013 
00014 int main() {
00015     rbsp_data_conf_t   ssif_write_end_conf = {&callback_ssif_write_end, NULL};
00016     ssif_channel_cfg_t ssif_cfg;
00017     int32_t            result;
00018 
00019     //I2S Master, 44.1kHz, 16bit, 2ch
00020     ssif_cfg.enabled                = true;
00021     ssif_cfg.int_level              = 0x78;
00022     ssif_cfg.slave_mode             = false;
00023     ssif_cfg.sample_freq            = 44100u;
00024     ssif_cfg.clk_select             = SSIF_CFG_CKS_AUDIO_X1;
00025     ssif_cfg.multi_ch               = SSIF_CFG_MULTI_CH_1;
00026     ssif_cfg.data_word              = SSIF_CFG_DATA_WORD_16;
00027     ssif_cfg.system_word            = SSIF_CFG_SYSTEM_WORD_32;
00028     ssif_cfg.bclk_pol               = SSIF_CFG_FALLING;
00029     ssif_cfg.ws_pol                 = SSIF_CFG_WS_LOW;
00030     ssif_cfg.padding_pol            = SSIF_CFG_PADDING_LOW;
00031     ssif_cfg.serial_alignment       = SSIF_CFG_DATA_FIRST;
00032     ssif_cfg.parallel_alignment     = SSIF_CFG_LEFT;
00033     ssif_cfg.ws_delay               = SSIF_CFG_DELAY;
00034     ssif_cfg.noise_cancel           = SSIF_CFG_DISABLE_NOISE_CANCEL;
00035     ssif_cfg.tdm_mode               = SSIF_CFG_DISABLE_TDM;
00036     ssif_cfg.romdec_direct.mode     = SSIF_CFG_DISABLE_ROMDEC_DIRECT;
00037     ssif_cfg.romdec_direct.p_cbfunc = NULL;
00038     result = ssif.ConfigChannel(&ssif_cfg);
00039     if (result < 0) {
00040         printf("ssif config error %d\n", result);
00041     }
00042 
00043     while (1) {
00044         //The upper limit of write buffer is 8.
00045         result = ssif.write((void *)sin_data_44100Hz_16bit_2ch, 
00046                             sizeof(sin_data_44100Hz_16bit_2ch), &ssif_write_end_conf);
00047         if (result < 0) {
00048             printf("ssif write api error %d\n", result);
00049         }
00050     }
00051 }

API

Import library

Public Member Functions

R_BSP_Ssif (PinName sck, PinName ws, PinName tx, PinName rx, uint8_t int_level=0x80, int32_t max_write_num=16, int32_t max_read_num=16)
Constructor.
virtual ~R_BSP_Ssif ()
Destructor.
int32_t GetSsifChNo (void)
Get a value of SSIF channel number.
bool ConfigChannel (const ssif_channel_cfg_t *const p_ch_cfg)
Save configuration to the SSIF driver.
bool GetStatus (uint32_t *const p_status)
Get a value of SSISR register.
int32_t write (void *const p_data, uint32_t data_size, const rbsp_data_conf_t *const p_data_conf=NULL)
Write count bytes to the file associated.
int32_t read (void *const p_data, uint32_t data_size, const rbsp_data_conf_t *const p_data_conf=NULL)
Read count bytes to the file associated.

Protected Member Functions

void write_init (void *handle, void *p_func_a, int32_t max_buff_num=16)
Write init.
void read_init (void *handle, void *p_func_a, int32_t max_buff_num=16)
Read init.

Interface

See the Pinout page for more details


SCUX

The SCUX module consists of a sampling rate converter, a digital volume unit, and a mixer.
The SCUX driver can perform asynchronous and synchronous sampling rate conversions using the sampling rate converter. The SCUX driver uses the DMA transfer mode to input and output audio data.

Hello World!

Import program

00001 #include "mbed.h"
00002 #include "R_BSP_Scux.h"
00003 #include "USBHostMSD.h"
00004 
00005 R_BSP_Scux scux(SCUX_CH_0);
00006 
00007 #define WRITE_SAMPLE_NUM (128)
00008 #define READ_SAMPLE_NUM  (2048)
00009 
00010 const short sin_data[WRITE_SAMPLE_NUM] = {
00011  0x0000,0x0000,0x0C8C,0x0C8C,0x18F9,0x18F9,0x2528,0x2528
00012 ,0x30FB,0x30FB,0x3C56,0x3C56,0x471C,0x471C,0x5133,0x5133
00013 ,0x5A82,0x5A82,0x62F1,0x62F1,0x6A6D,0x6A6D,0x70E2,0x70E2
00014 ,0x7641,0x7641,0x7A7C,0x7A7C,0x7D89,0x7D89,0x7F61,0x7F61
00015 ,0x7FFF,0x7FFF,0x7F61,0x7F61,0x7D89,0x7D89,0x7A7C,0x7A7C
00016 ,0x7641,0x7641,0x70E2,0x70E2,0x6A6D,0x6A6D,0x62F1,0x62F1
00017 ,0x5A82,0x5A82,0x5133,0x5133,0x471C,0x471C,0x3C56,0x3C56
00018 ,0x30FB,0x30FB,0x2528,0x2528,0x18F9,0x18F9,0x0C8C,0x0C8C
00019 ,0x0000,0x0000,0xF374,0xF374,0xE707,0xE707,0xDAD8,0xDAD8
00020 ,0xCF05,0xCF05,0xC3AA,0xC3AA,0xB8E4,0xB8E4,0xAECD,0xAECD
00021 ,0xA57E,0xA57E,0x9D0F,0x9D0F,0x9593,0x9593,0x8F1E,0x8F1E
00022 ,0x89BF,0x89BF,0x8584,0x8584,0x8277,0x8277,0x809F,0x809F
00023 ,0x8001,0x8001,0x809F,0x809F,0x8277,0x8277,0x8584,0x8584
00024 ,0x89BF,0x89BF,0x8F1E,0x8F1E,0x9593,0x9593,0x9D0F,0x9D0F
00025 ,0xA57E,0xA57E,0xAECD,0xAECD,0xB8E4,0xB8E4,0xC3AA,0xC3AA
00026 ,0xCF05,0xCF05,0xDAD8,0xDAD8,0xE707,0xE707,0xF374,0xF374
00027 };
00028 
00029 #if defined(__ICCARM__)
00030 #pragma data_alignment=4
00031 short write_buff[WRITE_SAMPLE_NUM]@ ".mirrorram";
00032 #pragma data_alignment=4
00033 short read_buff[READ_SAMPLE_NUM]@ ".mirrorram";
00034 #else
00035 short write_buff[WRITE_SAMPLE_NUM] __attribute((section("NC_BSS"),aligned(4)));
00036 short read_buff[READ_SAMPLE_NUM] __attribute((section("NC_BSS"),aligned(4)));
00037 #endif
00038 
00039 void scux_setup(void);
00040 void write_task(void const*);
00041 void file_output_to_usb(void);
00042 
00043 int main(void) {
00044     // set up SRC parameters.
00045     scux_setup();
00046 
00047     printf("Sampling rate conversion Start.\n");
00048     // start accepting transmit/receive requests.
00049     scux.TransStart();
00050 
00051     // create a new thread to write to SCUX.
00052     Thread writeTask(write_task, NULL, osPriorityNormal, 1024 * 4);
00053 
00054     // receive request to the SCUX driver.
00055     scux.read(read_buff, sizeof(read_buff));
00056     printf("Sampling rate conversion End.\n");
00057 
00058     // output binary file to USB port 0.
00059     file_output_to_usb();
00060 }
00061 
00062 void scux_setup(void) {
00063     scux_src_usr_cfg_t src_cfg;
00064 
00065     src_cfg.src_enable           = true;
00066     src_cfg.word_len             = SCUX_DATA_LEN_16;
00067     src_cfg.mode_sync            = true;
00068     src_cfg.input_rate           = SAMPLING_RATE_48000HZ;
00069     src_cfg.output_rate          = SAMPLING_RATE_96000HZ;
00070     src_cfg.select_in_data_ch[0] = SELECT_IN_DATA_CH_0;
00071     src_cfg.select_in_data_ch[1] = SELECT_IN_DATA_CH_1;
00072 
00073     scux.SetSrcCfg(&src_cfg);
00074 }
00075 
00076 void scux_flush_callback(int scux_ch) {
00077     // do nothing
00078 }
00079 
00080 void write_task(void const*) {
00081     memcpy(write_buff, sin_data, sizeof(write_buff));
00082     // send request to the SCUX driver.
00083     scux.write(write_buff, sizeof(write_buff));
00084 
00085     // stop the acceptance of transmit/receive requests.
00086     scux.FlushStop(&scux_flush_callback);
00087 }
00088 
00089 void file_output_to_usb(void) {
00090     FILE * fp = NULL;
00091     int i;
00092 
00093     USBHostMSD msd("usb");
00094 
00095     // try to connect a MSD device
00096     for(i = 0; i < 10; i++) {
00097         if (msd.connect()) {
00098             break;
00099         }
00100         wait(0.5);
00101     }
00102 
00103     if (msd.connected()) {
00104         fp = fopen("/usb/scux_input.dat", "rb");
00105         if (fp == NULL) {
00106             fp = fopen("/usb/scux_input.dat", "wb");
00107             if (fp != NULL) {
00108                 fwrite(write_buff, sizeof(short), WRITE_SAMPLE_NUM, fp);
00109                 fclose(fp);
00110                 printf("Output binary file(Input data) to USB.\n");
00111             } else {
00112                 printf("Failed to output binary file(Input data).\n");
00113             }
00114         } else {
00115             printf("Binary file(Input data) exists.\n");
00116             fclose(fp);
00117         }
00118 
00119         fp = fopen("/usb/scux_output.dat", "rb");
00120         if (fp == NULL) {
00121             fp = fopen("/usb/scux_output.dat", "wb");
00122             if (fp != NULL) {
00123                 fwrite(read_buff, sizeof(short), READ_SAMPLE_NUM, fp);
00124                 fclose(fp);
00125                 printf("Output binary file(Output data) to USB.\n");
00126             } else {
00127                 printf("Failed to output binary file(Output data).\n");
00128             }
00129         } else {
00130             printf("Binary file(Output data) exists.\n");
00131             fclose(fp);
00132         }
00133     } else {
00134         printf("Failed to connect to the USB device.\n");
00135     }
00136 } 

API

Import library

Public Member Functions

R_BSP_Scux ( scux_ch_num_t channel, uint8_t int_level=0x80, int32_t max_write_num=16, int32_t max_read_num=16)
Constructor: Initializes and opens the channel designated by the SCUX driver.
virtual ~R_BSP_Scux (void)
Destructor: Closes the channel designated by the SCUX driver and exits.
bool TransStart (void)
Sets up the SCUX HW and starts operation, then starts accepting write/read requests.
bool FlushStop (void(*const callback)(int32_t))
Stops accepting write/read requests, flushes out all data in the SCUX that is requested for transfer, then stops the HW operation.
bool ClearStop (void)
Discards all data in the SCUX that is requested for transfer before stopping the hardware operation and stops accepting write/read requests.
bool SetSrcCfg (const scux_src_usr_cfg_t *const p_src_param)
Sets up SRC parameters.
bool GetWriteStat (uint32_t *const p_write_stat)
Obtains the state information of the write request.
bool GetReadStat (uint32_t *const p_read_stat)
Obtains the state information of the read request.
int32_t write (void *const p_data, uint32_t data_size, const rbsp_data_conf_t *const p_data_conf=NULL)
Write count bytes to the file associated.
int32_t read (void *const p_data, uint32_t data_size, const rbsp_data_conf_t *const p_data_conf=NULL)
Read count bytes to the file associated.

Protected Member Functions

void write_init (void *handle, void *p_func_a, int32_t max_buff_num=16)
Write init.
void read_init (void *handle, void *p_func_a, int32_t max_buff_num=16)
Read init.

Write request state transition diagram

/media/uploads/dkato/scux_write_state_transition.png

Read request state transition diagram

/media/uploads/dkato/scux_read_state_transition.png

Committer:
dkato
Date:
Tue May 31 01:45:35 2016 +0000
Revision:
11:fb9eda52224e
Parent:
7:30ebba78fff0
"inline" of the ssif_init function is removed.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dkato 6:aa1fc6a5cc2a 1 /*******************************************************************************
dkato 6:aa1fc6a5cc2a 2 * DISCLAIMER
dkato 6:aa1fc6a5cc2a 3 * This software is supplied by Renesas Electronics Corporation and is only
dkato 6:aa1fc6a5cc2a 4 * intended for use with Renesas products. No other uses are authorized. This
dkato 6:aa1fc6a5cc2a 5 * software is owned by Renesas Electronics Corporation and is protected under
dkato 6:aa1fc6a5cc2a 6 * all applicable laws, including copyright laws.
dkato 6:aa1fc6a5cc2a 7 * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
dkato 6:aa1fc6a5cc2a 8 * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
dkato 6:aa1fc6a5cc2a 9 * LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
dkato 6:aa1fc6a5cc2a 10 * AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
dkato 6:aa1fc6a5cc2a 11 * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
dkato 6:aa1fc6a5cc2a 12 * ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
dkato 6:aa1fc6a5cc2a 13 * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
dkato 6:aa1fc6a5cc2a 14 * ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
dkato 6:aa1fc6a5cc2a 15 * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
dkato 6:aa1fc6a5cc2a 16 * Renesas reserves the right, without notice, to make changes to this software
dkato 6:aa1fc6a5cc2a 17 * and to discontinue the availability of this software. By using this software,
dkato 6:aa1fc6a5cc2a 18 * you agree to the additional terms and conditions found by accessing the
dkato 6:aa1fc6a5cc2a 19 * following link:
dkato 6:aa1fc6a5cc2a 20 * http://www.renesas.com/disclaimer*
dkato 6:aa1fc6a5cc2a 21 * Copyright (C) 2015 Renesas Electronics Corporation. All rights reserved.
dkato 6:aa1fc6a5cc2a 22 *******************************************************************************/
dkato 6:aa1fc6a5cc2a 23 /**************************************************************************//**
dkato 6:aa1fc6a5cc2a 24 * @file R_BSP_Scux.h
dkato 6:aa1fc6a5cc2a 25 * @brief SCUX API
dkato 6:aa1fc6a5cc2a 26 ******************************************************************************/
dkato 6:aa1fc6a5cc2a 27
dkato 6:aa1fc6a5cc2a 28 #ifndef R_BSP_SCUX_H
dkato 6:aa1fc6a5cc2a 29 #define R_BSP_SCUX_H
dkato 6:aa1fc6a5cc2a 30
dkato 6:aa1fc6a5cc2a 31 #include "R_BSP_SerialFamily.h"
dkato 6:aa1fc6a5cc2a 32 #include "R_BSP_ScuxDef.h"
dkato 6:aa1fc6a5cc2a 33
dkato 6:aa1fc6a5cc2a 34 #define SAMPLING_RATE_8000HZ (8000U) /* Selects a sampling rate of 8 kHz. */
dkato 6:aa1fc6a5cc2a 35 #define SAMPLING_RATE_11025HZ (11025U) /* Selects a sampling rate of 11.025 kHz. */
dkato 6:aa1fc6a5cc2a 36 #define SAMPLING_RATE_12000HZ (12000U) /* Selects a sampling rate of 12 kHz. */
dkato 6:aa1fc6a5cc2a 37 #define SAMPLING_RATE_16000HZ (16000U) /* Selects a sampling rate of 16 kHz. */
dkato 6:aa1fc6a5cc2a 38 #define SAMPLING_RATE_22050HZ (22050U) /* Selects a sampling rate of 22.05 kHz. */
dkato 6:aa1fc6a5cc2a 39 #define SAMPLING_RATE_24000HZ (24000U) /* Selects a sampling rate of 24 kHz. */
dkato 6:aa1fc6a5cc2a 40 #define SAMPLING_RATE_32000HZ (32000U) /* Selects a sampling rate of 32 kHz. */
dkato 6:aa1fc6a5cc2a 41 #define SAMPLING_RATE_44100HZ (44100U) /* Selects a sampling rate of 44.1 kHz. */
dkato 6:aa1fc6a5cc2a 42 #define SAMPLING_RATE_48000HZ (48000U) /* Selects a sampling rate of 48 kHz. */
dkato 6:aa1fc6a5cc2a 43 #define SAMPLING_RATE_64000HZ (64000U) /* Selects a sampling rate of 64 kHz. */
dkato 6:aa1fc6a5cc2a 44 #define SAMPLING_RATE_88200HZ (88200U) /* Selects a sampling rate of 88.2 kHz. */
dkato 6:aa1fc6a5cc2a 45 #define SAMPLING_RATE_96000HZ (96000U) /* Selects a sampling rate of 96 kHz. */
dkato 6:aa1fc6a5cc2a 46 #define SELECT_IN_DATA_CH_0 (0U) /* Specifies audio channel 0ch. */
dkato 6:aa1fc6a5cc2a 47 #define SELECT_IN_DATA_CH_1 (1U) /* Specifies audio channel 1ch. */
dkato 6:aa1fc6a5cc2a 48
dkato 6:aa1fc6a5cc2a 49 /** SRC parameter information */
dkato 6:aa1fc6a5cc2a 50 typedef struct
dkato 6:aa1fc6a5cc2a 51 {
dkato 6:aa1fc6a5cc2a 52 bool src_enable; /**< SRC function enable setting */
dkato 6:aa1fc6a5cc2a 53 scux_data_word_len_t word_len; /**< Word length of the audio data to be used
dkato 6:aa1fc6a5cc2a 54 by the SRC. */
dkato 6:aa1fc6a5cc2a 55 bool mode_sync; /**< Synchronization mode */
dkato 6:aa1fc6a5cc2a 56 uint32_t input_rate; /**< Input sampling rate */
dkato 6:aa1fc6a5cc2a 57 uint32_t output_rate; /**< Output sampling rate */
dkato 6:aa1fc6a5cc2a 58 uint32_t select_in_data_ch[SCUX_USE_CH_2]; /**< For SRC's input data position swapping */
dkato 6:aa1fc6a5cc2a 59 } scux_src_usr_cfg_t;
dkato 6:aa1fc6a5cc2a 60
dkato 6:aa1fc6a5cc2a 61 /** The SCUX module is made up of a sampling rate converter, a digital volume unit, and a mixer.
dkato 6:aa1fc6a5cc2a 62 * The SCUX driver can perform asynchronous and synchronous sampling rate conversions using the sampling rate
dkato 6:aa1fc6a5cc2a 63 * converter.
dkato 6:aa1fc6a5cc2a 64 * The SCUX driver uses the DMA transfer mode to input and output audio data.
dkato 6:aa1fc6a5cc2a 65 */
dkato 6:aa1fc6a5cc2a 66 class R_BSP_Scux : public R_BSP_SerialFamily {
dkato 6:aa1fc6a5cc2a 67
dkato 6:aa1fc6a5cc2a 68 public:
dkato 6:aa1fc6a5cc2a 69 /** Constructor: Initializes and opens the channel designated by the SCUX driver.
dkato 6:aa1fc6a5cc2a 70 *
dkato 6:aa1fc6a5cc2a 71 * @param channel SCUX channel number
dkato 6:aa1fc6a5cc2a 72 * @param int_level Transfer interrupt priority level (0x00-0xF7; default = 0x80)
dkato 6:aa1fc6a5cc2a 73 * @param max_write_num Maximum number of writes (1 to 128; default = 16)
dkato 6:aa1fc6a5cc2a 74 * @param max_read_num Maximum number of reads (1 to 128; default = 16)
dkato 6:aa1fc6a5cc2a 75 */
dkato 6:aa1fc6a5cc2a 76 R_BSP_Scux(scux_ch_num_t channel, uint8_t int_level = 0x80, int32_t max_write_num = 16, int32_t max_read_num = 16);
dkato 6:aa1fc6a5cc2a 77
dkato 6:aa1fc6a5cc2a 78 /** Destructor: Closes the channel designated by the SCUX driver and exits.
dkato 6:aa1fc6a5cc2a 79 *
dkato 6:aa1fc6a5cc2a 80 */
dkato 6:aa1fc6a5cc2a 81 virtual ~R_BSP_Scux(void);
dkato 6:aa1fc6a5cc2a 82
dkato 6:aa1fc6a5cc2a 83 /** Sets up the SCUX HW and starts operation, then starts accepting write/read requests.
dkato 6:aa1fc6a5cc2a 84 * Allocates a DMA channel for read requests.
dkato 6:aa1fc6a5cc2a 85 * The function also initializes the SCUX HW error state.
dkato 6:aa1fc6a5cc2a 86 *
dkato 6:aa1fc6a5cc2a 87 * @return Returns true if the function is successful. Returns false if the function fails.
dkato 6:aa1fc6a5cc2a 88 */
dkato 6:aa1fc6a5cc2a 89 bool TransStart(void);
dkato 6:aa1fc6a5cc2a 90
dkato 6:aa1fc6a5cc2a 91 /** Stops accepting write/read requests, flushes out all data in the SCUX that is requested for transfer,
dkato 6:aa1fc6a5cc2a 92 * then stops the HW operation.
dkato 6:aa1fc6a5cc2a 93 * If a transfer request is being processed, the function stops accepting write/read requests,
dkato 6:aa1fc6a5cc2a 94 * then performs preprocessing to stop the HW operation after flushing out all data in the SCUX
dkato 6:aa1fc6a5cc2a 95 * that is requested for transfer.
dkato 6:aa1fc6a5cc2a 96 * If no transfer request is being processed, the function stops accepting write/read requests
dkato 6:aa1fc6a5cc2a 97 * before stopping the HW operation.
dkato 6:aa1fc6a5cc2a 98 * The function releases the DMA channel for read requests when the HW operation is stopped.
dkato 6:aa1fc6a5cc2a 99 * It also calls the user-own callback function at the end of the transfer.
dkato 6:aa1fc6a5cc2a 100 *
dkato 6:aa1fc6a5cc2a 101 * @param callback Pointer to the callback function
dkato 6:aa1fc6a5cc2a 102 * The SCUX driver places an error code indicating the execution result of FlushStop
dkato 6:aa1fc6a5cc2a 103 * in the argument of the callback function before calling the callback function.
dkato 6:aa1fc6a5cc2a 104 * The error code is set to 0 if FlushStop is successful. A negative number is set
dkato 6:aa1fc6a5cc2a 105 * if FlushStop fails.
dkato 6:aa1fc6a5cc2a 106 * @return Returns true if the function is successful. Returns false if the function fails.
dkato 6:aa1fc6a5cc2a 107 */
dkato 6:aa1fc6a5cc2a 108 bool FlushStop(void (* const callback)(int32_t));
dkato 6:aa1fc6a5cc2a 109
dkato 6:aa1fc6a5cc2a 110 /** Discards all data in the SCUX that is requested for transfer before stopping the hardware operation
dkato 6:aa1fc6a5cc2a 111 * and stops accepting write/read requests.
dkato 6:aa1fc6a5cc2a 112 * The function releases the DMA channel for read requests when the HW operation is stopped.
dkato 6:aa1fc6a5cc2a 113 *
dkato 6:aa1fc6a5cc2a 114 * @return Returns true if the function is successful. Returns false if the function fails.
dkato 6:aa1fc6a5cc2a 115 */
dkato 6:aa1fc6a5cc2a 116 bool ClearStop(void);
dkato 6:aa1fc6a5cc2a 117
dkato 6:aa1fc6a5cc2a 118 /** Sets up SRC parameters.
dkato 6:aa1fc6a5cc2a 119 *
dkato 6:aa1fc6a5cc2a 120 * @param p_src_param SRC parameter information
dkato 6:aa1fc6a5cc2a 121 * @return Returns true if the function is successful. Returns false if the function fails.
dkato 6:aa1fc6a5cc2a 122 */
dkato 6:aa1fc6a5cc2a 123 bool SetSrcCfg(const scux_src_usr_cfg_t * const p_src_param);
dkato 6:aa1fc6a5cc2a 124
dkato 6:aa1fc6a5cc2a 125 /** Obtains the state information of the write request.
dkato 6:aa1fc6a5cc2a 126 *
dkato 6:aa1fc6a5cc2a 127 * @param p_write_stat Status of the write request
dkato 6:aa1fc6a5cc2a 128 * SCUX_STAT_STOP (0) Acceptance of requests is stopped.
dkato 6:aa1fc6a5cc2a 129 * SCUX_STAT_IDLE (1) Processing of all requests is completed and waiting for a request.
dkato 6:aa1fc6a5cc2a 130 * SCUX_STAT_TRANS(2) Transfer in progress
dkato 6:aa1fc6a5cc2a 131 * @return Returns true if the function is successful. Returns false if the function fails.
dkato 6:aa1fc6a5cc2a 132 */
dkato 6:aa1fc6a5cc2a 133 bool GetWriteStat(uint32_t * const p_write_stat);
dkato 6:aa1fc6a5cc2a 134
dkato 6:aa1fc6a5cc2a 135 /** Obtains the state information of the read request.
dkato 6:aa1fc6a5cc2a 136 *
dkato 6:aa1fc6a5cc2a 137 * @param p_read_stat ead request state
dkato 6:aa1fc6a5cc2a 138 * SCUX_STAT_STOP (0) Acceptance of requests is stopped
dkato 6:aa1fc6a5cc2a 139 * SCUX_STAT_IDLE (1) Processing of all requests is completed and waiting for a request.
dkato 6:aa1fc6a5cc2a 140 * SCUX_STAT_TRANS(2) Transfer in progress
dkato 6:aa1fc6a5cc2a 141 * @return Returns true if the function is successful. Returns false if the function fails.
dkato 6:aa1fc6a5cc2a 142 */
dkato 6:aa1fc6a5cc2a 143 bool GetReadStat(uint32_t * const p_read_stat);
dkato 6:aa1fc6a5cc2a 144
dkato 6:aa1fc6a5cc2a 145 private:
dkato 6:aa1fc6a5cc2a 146 int32_t scux_ch;
dkato 6:aa1fc6a5cc2a 147 };
dkato 6:aa1fc6a5cc2a 148 #endif /* R_BSP_SCUX_H */