Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: unzen_sample_nucleo_f746 unzen_delay_sample_nucleo_f746 skeleton_unzen_nucleo_f746 ifmag_noise_canceller ... more
Diff: unzen_hal.h
- Revision:
- 2:6613e62da521
- Parent:
- 1:9710fb328a08
diff -r 9710fb328a08 -r 6613e62da521 unzen_hal.h
--- a/unzen_hal.h Tue Apr 12 05:51:45 2016 +0000
+++ b/unzen_hal.h Tue May 03 01:10:32 2016 +0000
@@ -9,42 +9,44 @@
// By this HAL, the I2S have to become :
// - slave mode
// - clock must be ready
- // - Interrupt enable.
- void hal_i2s_setup();
+ void hal_i2s_setup(void);
// 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();
+ // 1. configure WS pin as GPIO
+ // 2. wait the WS rising edge
+ // 3. configure all pins as I2S
+ void hal_i2s_pin_config_and_wait_ws(void);
// Start I2S transfer. Interrupt starts
- void hal_i2s_start();
-
- IRQn_Type hal_get_i2s_irq_id();
- IRQn_Type hal_get_process_irq_id();
+ void hal_i2s_start(void);
+
+ // returns the IRQ ID for I2S RX interrupt
+ IRQn_Type hal_get_i2s_irq_id(void);
- // The returned value must be compatible with CMSIS NVIC_SetPriority() API.
- unsigned int hal_get_lowest_priority_level();
+ // returns the IRQ ID for process IRQ. Typically, this is allocated to the reserved IRQ.
+ IRQn_Type hal_get_process_irq_id(void);
+
+ // The returned value must be compatible with CMSIS NVIC_SetPriority() API. That mean, it is integer like 0, 1, 2...
+ unsigned int hal_get_i2s_irq_priority_level(void);
+
+ // The returned value must be compatible with CMSIS NVIC_SetPriority() API. That mean, it is integer like 0, 1, 2...
+ unsigned int hal_get_process_irq_priority_level(void);
+
// 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);
+ unsigned int hal_data_per_sample(void);
+
+ // get data from I2S RX peripheral. Where sample is one audio data. Stereo data is constructed by 2 samples.
+ void 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 );
+ // put data into I2S TX peripheral. Where sample is one audio data. Stereo data is constructed by 2 samples.
+ void hal_put_i2s_tx_data( int sample );
}