📄 stfa_helper.c
字号:
/*************************************************************************** stfa_helper.c - Auxiliary functions for STFA ------------------- begin : 2003 authors : Linus Gasser emails : linus.gasser@epfl.ch ***************************************************************************//*************************************************************************** Changes ------- date - name - description 03/01/16 - ineiti - begin **************************************************************************//*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************//** * Some control-functions for the stfa */#include "spc.h"#include "stfa.h"/** * @short add a notice-function to a slot * * As there may be multiple stfa's, one has to give the ID. If * a notice-function already exists for this slot, it is * overwritten with the new one. * The notice-function receives SUBS_MSG_USER as msg, NULL as data and * the stfa's id as ret_id. * The message is sent slot_send_offset before the slot is actually * sent over the air. * * @param stfa the stfa to change * @param slot which slot the function is bound to * @param f the function that shall be called, of type @see func */void swr_stfa_notice_func( swr_sdb_id stfa, int slot, func *f ) { swr_usr_msg_t *msg; msg = swr_malloc( sizeof( swr_usr_msg_t ) ); msg->data = (void*)f; strcpy( msg->id, "Notice_func" ); msg->id[11] = slot; swr_sdb_send_msg( stfa, SUBS_MSG_USER, msg, -1 );}/** * @short add a sdb to a slot * * As there may be multiple stfa's, one has to give the ID. If * a sdb for this slot already exists, it is overwritten with the new one. * The sdb receives a SUBS_MSG_USER msg with NULL as data and * the stfa's id as ret_id. * The sdb usually isn't equal to the sdb connected to the input-port * of this slut, but rather the sdb that is responsible to create the * data for this port. * The message is sent slot_send_offset before the slot is actually * sent over the air. * * @param stfa the stfa to change * @param slot which slot the sdb is bound to * @param sdb_id the sdb that is called for the slot */void swr_stfa_notice_sdb( swr_sdb_id stfa, int slot, swr_sdb_id sdb_id ) { swr_usr_msg_t *msg; msg = swr_malloc( sizeof( swr_usr_msg_t ) ); msg->data = NULL; strcpy( msg->id, "Notice_sdb" ); msg->id[10] = slot; swr_sdb_send_msg( stfa, SUBS_MSG_USER, msg, sdb_id );}/** * Start the stfa, this also starts the DMA-transfer. */void swr_stfa_go( swr_sdb_id stfa ) { swr_usr_msg_t *msg; msg = swr_malloc( sizeof( swr_usr_msg_t ) ); msg->data = NULL; strcpy( msg->id, "Go" ); swr_sdb_send_msg( stfa, SUBS_MSG_USER, msg, -1 );}/** * Stop the stfa. This also stops the DMA-transfer. */void swr_stfa_stop( swr_sdb_id stfa ) { swr_usr_msg_t *msg; msg = swr_malloc( sizeof( swr_usr_msg_t ) ); msg->data = NULL; strcpy( msg->id, "Stop" ); swr_sdb_send_msg( stfa, SUBS_MSG_USER, msg, -1 );}EXPORT_SYMBOL(swr_stfa_notice_func);EXPORT_SYMBOL(swr_stfa_notice_sdb);EXPORT_SYMBOL(swr_stfa_go);EXPORT_SYMBOL(swr_stfa_stop);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -