test

Committer:
elijahsj
Date:
Mon Nov 09 00:02:47 2020 -0500
Revision:
1:8a094db1347f
test

Who changed what in which revision?

UserRevisionLine numberNew contents of line
elijahsj 1:8a094db1347f 1 /*******************************************************************************
elijahsj 1:8a094db1347f 2 * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.
elijahsj 1:8a094db1347f 3 *
elijahsj 1:8a094db1347f 4 * Permission is hereby granted, free of charge, to any person obtaining a
elijahsj 1:8a094db1347f 5 * copy of this software and associated documentation files (the "Software"),
elijahsj 1:8a094db1347f 6 * to deal in the Software without restriction, including without limitation
elijahsj 1:8a094db1347f 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
elijahsj 1:8a094db1347f 8 * and/or sell copies of the Software, and to permit persons to whom the
elijahsj 1:8a094db1347f 9 * Software is furnished to do so, subject to the following conditions:
elijahsj 1:8a094db1347f 10 *
elijahsj 1:8a094db1347f 11 * The above copyright notice and this permission notice shall be included
elijahsj 1:8a094db1347f 12 * in all copies or substantial portions of the Software.
elijahsj 1:8a094db1347f 13 *
elijahsj 1:8a094db1347f 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
elijahsj 1:8a094db1347f 15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
elijahsj 1:8a094db1347f 16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
elijahsj 1:8a094db1347f 17 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
elijahsj 1:8a094db1347f 18 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
elijahsj 1:8a094db1347f 19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
elijahsj 1:8a094db1347f 20 * OTHER DEALINGS IN THE SOFTWARE.
elijahsj 1:8a094db1347f 21 *
elijahsj 1:8a094db1347f 22 * Except as contained in this notice, the name of Maxim Integrated
elijahsj 1:8a094db1347f 23 * Products, Inc. shall not be used except as stated in the Maxim Integrated
elijahsj 1:8a094db1347f 24 * Products, Inc. Branding Policy.
elijahsj 1:8a094db1347f 25 *
elijahsj 1:8a094db1347f 26 * The mere transfer of this software does not imply any licenses
elijahsj 1:8a094db1347f 27 * of trade secrets, proprietary technology, copyrights, patents,
elijahsj 1:8a094db1347f 28 * trademarks, maskwork rights, or any other form of intellectual
elijahsj 1:8a094db1347f 29 * property whatsoever. Maxim Integrated Products, Inc. retains all
elijahsj 1:8a094db1347f 30 * ownership rights.
elijahsj 1:8a094db1347f 31 *
elijahsj 1:8a094db1347f 32 * $Date: 2016-04-27 15:26:08 -0500 (Wed, 27 Apr 2016) $
elijahsj 1:8a094db1347f 33 * $Revision: 22543 $
elijahsj 1:8a094db1347f 34 *
elijahsj 1:8a094db1347f 35 ******************************************************************************/
elijahsj 1:8a094db1347f 36
elijahsj 1:8a094db1347f 37 #include <stddef.h>
elijahsj 1:8a094db1347f 38 #include "mxc_config.h"
elijahsj 1:8a094db1347f 39 #include "ioman.h"
elijahsj 1:8a094db1347f 40
elijahsj 1:8a094db1347f 41 /******************************************************************************/
elijahsj 1:8a094db1347f 42 int IOMAN_Config(const ioman_cfg_t *cfg)
elijahsj 1:8a094db1347f 43 {
elijahsj 1:8a094db1347f 44 if(cfg == NULL) {
elijahsj 1:8a094db1347f 45 return E_NULL_PTR;
elijahsj 1:8a094db1347f 46 }
elijahsj 1:8a094db1347f 47
elijahsj 1:8a094db1347f 48 if (*cfg->ack_reg != cfg->req_val.value) {
elijahsj 1:8a094db1347f 49 /* Request pin mapping */
elijahsj 1:8a094db1347f 50 *cfg->req_reg = cfg->req_val.value;
elijahsj 1:8a094db1347f 51
elijahsj 1:8a094db1347f 52 /* Check for acknowledgment */
elijahsj 1:8a094db1347f 53 if (*cfg->ack_reg != cfg->req_val.value) {
elijahsj 1:8a094db1347f 54 return E_BUSY;
elijahsj 1:8a094db1347f 55 }
elijahsj 1:8a094db1347f 56 }
elijahsj 1:8a094db1347f 57
elijahsj 1:8a094db1347f 58 return E_NO_ERROR;
elijahsj 1:8a094db1347f 59 }