Skip to content

Commit bf01572

Browse files
committed
rename xfer to transfer
1 parent 01597f1 commit bf01572

File tree

7 files changed

+20
-20
lines changed

7 files changed

+20
-20
lines changed

drivers/SAI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ SAI::SAI(PinName mclk, PinName bclk, PinName wclk, PinName sd,
4545

4646
bool SAI::xfer(uint32_t *value) {
4747
lock();
48-
bool ret = sai_xfer(&_sai, value);
48+
bool ret = sai_transfer(&_sai, value);
4949
unlock();
5050
return ret;
5151
}

hal/sai_api.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,17 @@ extern "C" {
4444
* - a device/block can be reinitialized via `sai_init()` after being `sai_free()`d.
4545
*
4646
* if the device is a *receiver* :
47-
* - `sai_xfer()` returns false if the `sai_t` object is NULL ;
48-
* - `sai_xfer()` returns false if there's no sample in the FiFo ;
49-
* - `sai_xfer()` if `psample` is NULL : it pops 1 sample from the FiFo and returns true ;
50-
* - `sai_xfer()` if `psample` is not NULL : it pops 1 sample from the FiFo, stores it to the address
47+
* - `sai_transfer()` returns false if the `sai_t` object is NULL ;
48+
* - `sai_transfer()` returns false if there's no sample in the FiFo ;
49+
* - `sai_transfer()` if `psample` is NULL : it pops 1 sample from the FiFo and returns true ;
50+
* - `sai_transfer()` if `psample` is not NULL : it pops 1 sample from the FiFo, stores it to the address
5151
* pointed by `psample`, and returns true.
5252
*
5353
* if the device is a *transmitter* :
54-
* - `sai_xfer()` returns false if the `sai_t` object is NULL ;
55-
* - `sai_xfer()` returns false if the fifo is full and `*psample` could not be pushed ;
56-
* - `sai_xfer()` if `psample` is NULL : it pushes one '0' sample to the FiFo and returns true ;
57-
* - `sai_xfer()` if `psample` is not NULL : it pushes the pointed sample to the FiFo and returns true.
54+
* - `sai_transfer()` returns false if the `sai_t` object is NULL ;
55+
* - `sai_transfer()` returns false if the fifo is full and `*psample` could not be pushed ;
56+
* - `sai_transfer()` if `psample` is NULL : it pushes one '0' sample to the FiFo and returns true ;
57+
* - `sai_transfer()` if `psample` is not NULL : it pushes the pointed sample to the FiFo and returns true.
5858
*
5959
* # Undefined behaviours
6060
* - Calling any function other than `sai_init()` before the initialization of the SAI ;
@@ -177,7 +177,7 @@ sai_result_t sai_init(sai_t *obj, sai_init_t *init);
177177
* - on reception : will read a sample from the fifo to the nether.
178178
* - on transmission : will send a '0'.
179179
*/
180-
bool sai_xfer(sai_t *obj, uint32_t *psample);
180+
bool sai_transfer(sai_t *obj, uint32_t *psample);
181181

182182
/**
183183
* Releases & de-initialize the referenced peripherals.

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/api/sai_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ sai_result_t sai_init(sai_t *obj, sai_init_t *init) {
148148
return SAI_RESULT_OK;
149149
}
150150

151-
bool sai_xfer(sai_t *obj, uint32_t *sample) {
151+
bool sai_transfer(sai_t *obj, uint32_t *sample) {
152152
if (obj == NULL) {
153153
return false;
154154
}

targets/TARGET_STM/TARGET_STM32F4/sai_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,12 @@ sai_result_t sai_init(sai_t *obj, sai_init_t *init) {
8484
}
8585

8686
/** Transfer a sample and return the sample received meanwhile. */
87-
bool sai_xfer(sai_t *obj, uint32_t *sample) {
87+
bool sai_transfer(sai_t *obj, uint32_t *sample) {
8888
if (obj == NULL) {
8989
return false;
9090
}
9191

92-
return sai_vtable[obj->base->type]->xfer(obj, sample);
92+
return sai_vtable[obj->base->type]->transfer(obj, sample);
9393
}
9494

9595
/** Releases & de-initialize the referenced peripherals. */

targets/TARGET_STM/TARGET_STM32F4/stm_i2s_driver.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
#include "PeripheralPins.h"
2424

2525
static sai_result_t stm_i2s_init(sai_t *obj, sai_init_t *init);
26-
static bool stm_i2s_xfer(sai_t *obj, uint32_t *sample);
26+
static bool stm_i2s_transfer(sai_t *obj, uint32_t *sample);
2727
static void stm_i2s_free(sai_t *obj);
2828

2929
const stm_sai_api_t stm_i2s_vtable = {
3030
.init = stm_i2s_init,
31-
.xfer = stm_i2s_xfer,
31+
.transfer = stm_i2s_transfer,
3232
.free = stm_i2s_free
3333
};
3434

@@ -113,7 +113,7 @@ static sai_result_t stm_i2s_init(sai_t *obj, sai_init_t *init) {
113113
return SAI_RESULT_OK;
114114
}
115115

116-
static bool stm_i2s_xfer(sai_t *obj, uint32_t *psample) {
116+
static bool stm_i2s_transfer(sai_t *obj, uint32_t *psample) {
117117
bool ret = false;
118118
if (obj->is_receiver) {
119119
if (LL_I2S_IsActiveFlag_FRE(obj->base->u.spi) && !LL_I2S_IsActiveFlag_CHSIDE(obj->base->u.spi)) {

targets/TARGET_STM/TARGET_STM32F4/stm_sai_api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
typedef struct stm_sai_api_s {
2828
sai_result_t (*init)(sai_t *obj, sai_init_t *init);
29-
bool (*xfer)(sai_t *obj, uint32_t *sample);
29+
bool (*transfer)(sai_t *obj, uint32_t *sample);
3030
void (*free)(sai_t *obj);
3131
} stm_sai_api_t;
3232

targets/TARGET_STM/TARGET_STM32F4/stm_sai_driver.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
#include "PeripheralPins.h"
2222

2323
static sai_result_t stm_sai_init(sai_t *obj, sai_init_t *init);
24-
static bool stm_sai_xfer(sai_t *obj, uint32_t *sample);
24+
static bool stm_sai_transfer(sai_t *obj, uint32_t *sample);
2525
static void stm_sai_free(sai_t *obj);
2626

2727
const stm_sai_api_t stm_sai_vtable = {
2828
.init = stm_sai_init,
29-
.xfer = stm_sai_xfer,
29+
.transfer = stm_sai_transfer,
3030
.free = stm_sai_free
3131
};
3232

@@ -202,7 +202,7 @@ static sai_result_t stm_sai_init(sai_t *obj, sai_init_t *init) {
202202
return SAI_RESULT_OK;
203203
}
204204

205-
static bool stm_sai_xfer(sai_t *obj, uint32_t *psample) {
205+
static bool stm_sai_transfer(sai_t *obj, uint32_t *psample) {
206206
bool ret = false;
207207
uint32_t sr = obj->base->u.sai_block->SR;
208208
uint32_t fifo_level = (sr & SAI_xSR_FLVL) >> SAI_xSR_FLVL_Pos;

0 commit comments

Comments
 (0)