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

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

Fork of R_BSP by Daiki Kato

Embed: (wiki syntax)

« Back to documentation index

R_BSP_Scux Class Reference

The SCUX module is made up of a sampling rate converter, a digital volume unit, and a mixer. More...

#include <R_BSP_Scux.h>

Inherits R_BSP_SerialFamily.

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.
bool ioctl (int request,...)
 Manipulates the underlying device parameters of special files.
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

bool init_channel (RBSP_MBED_FNS *function_list, int channel, void *const config_data, int32_t max_write_num=16, int32_t max_read_num=16)
 Channel init.
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.

Detailed Description

The SCUX module is made up 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.

Definition at line 66 of file R_BSP_Scux.h.


Constructor & Destructor Documentation

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.

Parameters:
channelSCUX channel number
int_levelTransfer interrupt priority level (0x00-0xF7; default = 0x80)
max_write_numMaximum number of writes (1 to 128; default = 16)
max_read_numMaximum number of reads (1 to 128; default = 16)

Definition at line 51 of file R_BSP_Scux.cpp.

~R_BSP_Scux ( void   ) [virtual]

Destructor: Closes the channel designated by the SCUX driver and exits.

Definition at line 108 of file R_BSP_Scux.cpp.


Member Function Documentation

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.

The function releases the DMA channel for read requests when the HW operation is stopped.

Returns:
Returns true if the function is successful. Returns false if the function fails.

Definition at line 119 of file R_BSP_Scux.cpp.

bool FlushStop ( void(*)(int32_t)  callback )

Stops accepting write/read requests, flushes out all data in the SCUX that is requested for transfer, then stops the HW operation.

If a transfer request is being processed, the function stops accepting write/read requests, then performs preprocessing to stop the HW operation after flushing out all data in the SCUX that is requested for transfer. If no transfer request is being processed, the function stops accepting write/read requests before stopping the HW operation. The function releases the DMA channel for read requests when the HW operation is stopped. It also calls the user-own callback function at the end of the transfer.

Parameters:
callbackPointer to the callback function The SCUX driver places an error code indicating the execution result of FlushStop in the argument of the callback function before calling the callback function. The error code is set to 0 if FlushStop is successful. A negative number is set if FlushStop fails.
Returns:
Returns true if the function is successful. Returns false if the function fails.

Definition at line 115 of file R_BSP_Scux.cpp.

bool GetReadStat ( uint32_t *const   p_read_stat )

Obtains the state information of the read request.

Parameters:
p_read_statead request state SCUX_STAT_STOP (0) Acceptance of requests is stopped SCUX_STAT_IDLE (1) Processing of all requests is completed and waiting for a request. SCUX_STAT_TRANS(2) Transfer in progress
Returns:
Returns true if the function is successful. Returns false if the function fails.

Definition at line 306 of file R_BSP_Scux.cpp.

bool GetWriteStat ( uint32_t *const   p_write_stat )

Obtains the state information of the write request.

Parameters:
p_write_statStatus of the write request SCUX_STAT_STOP (0) Acceptance of requests is stopped. SCUX_STAT_IDLE (1) Processing of all requests is completed and waiting for a request. SCUX_STAT_TRANS(2) Transfer in progress
Returns:
Returns true if the function is successful. Returns false if the function fails.

Definition at line 302 of file R_BSP_Scux.cpp.

bool init_channel ( RBSP_MBED_FNS *  function_list,
int  channel,
void *const   config_data,
int32_t  max_write_num = 16,
int32_t  max_read_num = 16 
) [protected, inherited]

Channel init.

Parameters:
function_listpointer of driver function callback table
channelchannel number
config_datapointer of several parameters for a channel
max_write_numThe upper limit of write buffer
max_read_numThe upper limit of read buffer

Definition at line 47 of file R_BSP_SerialFamily.cpp.

bool ioctl ( int  request,
  ... 
) [inherited]

Manipulates the underlying device parameters of special files.

Parameters:
requesthas encoded in it whether the argument is an "in" parameter or "out" parameter, and the size of the argument argp in bytes.
Returns:
true = success, false = failure

Definition at line 90 of file R_BSP_SerialFamily.cpp.

int32_t read ( void *const   p_data,
uint32_t  data_size,
const rbsp_data_conf_t *const   p_data_conf = NULL 
) [inherited]

Read count bytes to the file associated.

Parameters:
p_dataLocation of the data.
data_sizeNumber of bytes to read.
p_data_confAsynchronous control block structure.
Returns:
Number of bytes read on success. negative number on error.

Definition at line 72 of file R_BSP_Aio.cpp.

void read_init ( void *  handle,
void *  p_func_a,
int32_t  max_buff_num = 16 
) [protected, inherited]

Read init.

Parameters:
handlechannel handle.
p_func_aPointer of read function.
max_buff_numThe upper limit of read buffer.

Definition at line 101 of file R_BSP_Aio.h.

bool SetSrcCfg ( const scux_src_usr_cfg_t *const   p_src_param )

Sets up SRC parameters.

Parameters:
p_src_paramSRC parameter information
Returns:
Returns true if the function is successful. Returns false if the function fails.

Definition at line 123 of file R_BSP_Scux.cpp.

bool TransStart ( void   )

Sets up the SCUX HW and starts operation, then starts accepting write/read requests.

Allocates a DMA channel for read requests. The function also initializes the SCUX HW error state.

Returns:
Returns true if the function is successful. Returns false if the function fails.

Definition at line 111 of file R_BSP_Scux.cpp.

int32_t write ( void *const   p_data,
uint32_t  data_size,
const rbsp_data_conf_t *const   p_data_conf = NULL 
) [inherited]

Write count bytes to the file associated.

Parameters:
p_dataLocation of the data.
data_sizeNumber of bytes to write.
p_data_confAsynchronous control block structure.
Returns:
Number of bytes written on success. negative number on error.

Definition at line 64 of file R_BSP_Aio.cpp.

void write_init ( void *  handle,
void *  p_func_a,
int32_t  max_buff_num = 16 
) [protected, inherited]

Write init.

Parameters:
handlechannel handle.
p_func_aPointer of write function.
max_buff_numThe upper limit of write buffer.

Definition at line 91 of file R_BSP_Aio.h.