// // Copyright 2012 Ettus Research LLC // // 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 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // #include "convert_common.hpp" #include #define __DECLARE_ITEM32_CONVERTER(cpu_type, wire_type, xe, htoxx, xxtoh) \ DECLARE_CONVERTER(cpu_type, 1, wire_type ## _item32_ ## xe, 1, PRIORITY_GENERAL){ \ const cpu_type ## _t *input = reinterpret_cast(inputs[0]); \ item32_t *output = reinterpret_cast(outputs[0]); \ xx_to_item32_ ## wire_type(input, output, nsamps, scale_factor); \ } \ DECLARE_CONVERTER(wire_type ## _item32_ ## xe, 1, cpu_type, 1, PRIORITY_GENERAL){ \ const item32_t *input = reinterpret_cast(inputs[0]); \ cpu_type ## _t *output = reinterpret_cast(outputs[0]); \ item32_ ## wire_type ## _to_xx(input, output, nsamps, scale_factor); \ } #define _DECLARE_ITEM32_CONVERTER(cpu_type, wire_type) \ __DECLARE_ITEM32_CONVERTER(cpu_type, wire_type, be, uhd::htonx, uhd::ntohx) \ __DECLARE_ITEM32_CONVERTER(cpu_type, wire_type, le, uhd::htowx, uhd::wtohx) #define DECLARE_ITEM32_CONVERTER(cpu_type) \ _DECLARE_ITEM32_CONVERTER(cpu_type, sc8) \ _DECLARE_ITEM32_CONVERTER(cpu_type, sc16) /* Create sc16<->sc16,sc8(otw) */ DECLARE_ITEM32_CONVERTER(sc16) /* Create fc32<->sc16,sc8(otw) */ DECLARE_ITEM32_CONVERTER(fc32) /* Create fc64<->sc16,sc8(otw) */ DECLARE_ITEM32_CONVERTER(fc64) _DECLARE_ITEM32_CONVERTER(sc8, sc8)