2 * Unicens Integration Helper Component
4 * Copyright (C) 2017 Microchip Technology Germany II GmbH & Co. KG
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 * You may also obtain this software under a propriety license from Microchip.
20 * Please contact Microchip for further information.
24 #include "ucs_interface.h"
25 #include "libmostvolume.h"
29 static UCSI_channelsT ucsiChannels[] = {
30 {.name= "FRONT_LEFT" , .numid= (int)LIB_MOST_VOLUME_CH_FRONT_LEFT},
31 {.name= "FRONT_RIGHT", .numid= (int)LIB_MOST_VOLUME_CH_FRONT_RIGHT},
32 {.name= "REAR_LEFT" , .numid= (int)LIB_MOST_VOLUME_CH_REAR_LEFT},
33 {.name= "REAR_LEFT" , .numid= (int)LIB_MOST_VOLUME_CH_REAR_RIGHT},
34 {.name= "CENTER" , .numid= (int)LIB_MOST_VOLUME_CH_CENTER},
35 {.name= "SUB" , .numid= (int)LIB_MOST_VOLUME_CH_SUB},
36 {.name= "MASTER" , .numid= (int)LIB_MOST_VOLUME_MASTER},
41 // Small wrapper as UCSI and UCSVOL do not use the same handle
42 void UCSI_Vol_Service (UCSI_Data_t *pPriv) {
43 (void)lib_most_volume_service();
47 UCSI_channelsT *UCSI_Vol_Init (UCSI_Data_t *pPriv, UCSI_VolumeServiceCB_t serviceCB) {
49 err = lib_most_volume_init(pPriv->UNICENS, (lib_most_volume_service_cb_t) serviceCB);
50 if (err) return (NULL);
51 else return (ucsiChannels);
54 uint8_t UCSI_Vol_Set(UCSI_Data_t *pPriv, int numid, uint8_t volume) {
56 return (lib_most_volume_set((enum lib_most_volume_channel_t)numid, volume));