First Publish. Works fine.

Dependents:   unzen_sample_nucleo_f746 unzen_delay_sample_nucleo_f746 skeleton_unzen_nucleo_f746 ifmag_noise_canceller ... more

Nucleo F746ZG用のオーディオ・フレームワークです。フレームワーク地震の詳細は『雲仙』オーディオ・フレームワークを参照してください。

参考リンク

  • skeleton_unzen_nucleo_f746 Nucleo F746ZGおよびUI基板を使う場合のスケルトンプログラム。F746を使う方はここから読み始めると良いでしょう。

unzen_hal.h

Committer:
shorie
Date:
2016-04-12
Revision:
1:9710fb328a08
Parent:
0:5ac19c994288
Child:
2:6613e62da521

File content as of revision 1:9710fb328a08:

#ifndef _UNZEN_HAL_H_
#define _UNZEN_HAL_H_

#include "mbed.h"

namespace unzen 
{
        // Set up I2S peripheral to ready to start.
        // By this HAL, the I2S have to become : 
        // - slave mode
        // - clock must be ready
        // - Interrupt enable.
    void hal_i2s_setup();
    
        // configure the pins of I2S and then, wait for WS. 
        // This waiting is important to avoid the delay between TX and RX.
        // The HAL API will wait for the WS changes from left to right then return.
        // The procesure is : 
        // 1. configure all pin as GPIO
        // 2. wait the WS
        // 3. configure all pin as I2S
    void hal_i2s_pin_config_and_wait_ws();

    
        // Start I2S transfer. Interrupt starts  
    void hal_i2s_start();
 
    IRQn_Type hal_get_i2s_irq_id();
    IRQn_Type hal_get_process_irq_id();
    
        // The returned value must be compatible with CMSIS NVIC_SetPriority() API.
    unsigned int hal_get_lowest_priority_level();
 
        // reutun the intenger value which tells how much data have to be transfered for each
        // interrupt. For example, if the stereo 32bit data ( total 64 bit ) have to be sent, 
        // have to return 2. 
        // The special case is when the word needs to transmit by multiple interrupt, 
        // must return 0.
    unsigned int hal_data_per_sample();
 
        // return true when the sample parameter is ready to read.
        // return false when the sample is not ready to read.
    bool hal_get_i2s_rx_data( int & sample);
    
        // return true when the sample was completely stored to send.
        // return false when the same sample is required next time.
    bool hal_set_i2s_tx_data( int sample );
}


#endif