USB Serial application

Fork of USBSerial_HelloWorld by Samuel Mokrani

Committer:
Zaitsev
Date:
Tue Jan 10 20:42:26 2017 +0000
Revision:
10:41552d038a69
USB Serial bi-directional bridge

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Zaitsev 10:41552d038a69 1 /**
Zaitsev 10:41552d038a69 2 ******************************************************************************
Zaitsev 10:41552d038a69 3 * @file pad.h
Zaitsev 10:41552d038a69 4 * @brief PAD Power management support code
Zaitsev 10:41552d038a69 5 * @internal
Zaitsev 10:41552d038a69 6 * @author ON Semiconductor
Zaitsev 10:41552d038a69 7 * $Rev: 2848 $
Zaitsev 10:41552d038a69 8 * $Date: 2014-04-01 22:48:18 +0530 (Tue, 01 Apr 2014) $
Zaitsev 10:41552d038a69 9 ******************************************************************************
Zaitsev 10:41552d038a69 10 * Copyright 2016 Semiconductor Components Industries LLC (d/b/a “ON Semiconductor”).
Zaitsev 10:41552d038a69 11 * All rights reserved. This software and/or documentation is licensed by ON Semiconductor
Zaitsev 10:41552d038a69 12 * under limited terms and conditions. The terms and conditions pertaining to the software
Zaitsev 10:41552d038a69 13 * and/or documentation are available at http://www.onsemi.com/site/pdf/ONSEMI_T&C.pdf
Zaitsev 10:41552d038a69 14 * (“ON Semiconductor Standard Terms and Conditions of Sale, Section 8 Software”) and
Zaitsev 10:41552d038a69 15 * if applicable the software license agreement. Do not use this software and/or
Zaitsev 10:41552d038a69 16 * documentation unless you have carefully read and you agree to the limited terms and
Zaitsev 10:41552d038a69 17 * conditions. By using this software and/or documentation, you agree to the limited
Zaitsev 10:41552d038a69 18 * terms and conditions.
Zaitsev 10:41552d038a69 19 *
Zaitsev 10:41552d038a69 20 * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
Zaitsev 10:41552d038a69 21 * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
Zaitsev 10:41552d038a69 22 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
Zaitsev 10:41552d038a69 23 * ON SEMICONDUCTOR SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL,
Zaitsev 10:41552d038a69 24 * INCIDENTAL, OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
Zaitsev 10:41552d038a69 25 * @endinternal
Zaitsev 10:41552d038a69 26 *
Zaitsev 10:41552d038a69 27 * @ingroup pad
Zaitsev 10:41552d038a69 28 *
Zaitsev 10:41552d038a69 29 * @details
Zaitsev 10:41552d038a69 30 */
Zaitsev 10:41552d038a69 31
Zaitsev 10:41552d038a69 32 #ifndef _PAD_H_
Zaitsev 10:41552d038a69 33 #define _PAD_H_
Zaitsev 10:41552d038a69 34
Zaitsev 10:41552d038a69 35 /*************************************************************************************************
Zaitsev 10:41552d038a69 36 * *
Zaitsev 10:41552d038a69 37 * Header files *
Zaitsev 10:41552d038a69 38 * *
Zaitsev 10:41552d038a69 39 *************************************************************************************************/
Zaitsev 10:41552d038a69 40
Zaitsev 10:41552d038a69 41 #include "types.h"
Zaitsev 10:41552d038a69 42 #include "memory_map.h"
Zaitsev 10:41552d038a69 43 #include "gpio_map.h"
Zaitsev 10:41552d038a69 44 #include "pad_map.h"
Zaitsev 10:41552d038a69 45 #include "crossbar.h"
Zaitsev 10:41552d038a69 46 #include "clock.h"
Zaitsev 10:41552d038a69 47
Zaitsev 10:41552d038a69 48 /**************************************************************************************************
Zaitsev 10:41552d038a69 49 * *
Zaitsev 10:41552d038a69 50 * Type definitions *
Zaitsev 10:41552d038a69 51 * *
Zaitsev 10:41552d038a69 52 **************************************************************************************************/
Zaitsev 10:41552d038a69 53
Zaitsev 10:41552d038a69 54
Zaitsev 10:41552d038a69 55
Zaitsev 10:41552d038a69 56 #define CROSS_REG_ADRS_BYTE_SIZE 4
Zaitsev 10:41552d038a69 57
Zaitsev 10:41552d038a69 58 #define PAD_REG_ADRS_BYTE_SIZE 4
Zaitsev 10:41552d038a69 59
Zaitsev 10:41552d038a69 60
Zaitsev 10:41552d038a69 61 /*************************************************************************************************
Zaitsev 10:41552d038a69 62 * *
Zaitsev 10:41552d038a69 63 * Functions *
Zaitsev 10:41552d038a69 64 * *
Zaitsev 10:41552d038a69 65 *************************************************************************************************/
Zaitsev 10:41552d038a69 66
Zaitsev 10:41552d038a69 67 /**
Zaitsev 10:41552d038a69 68 * @brief
Zaitsev 10:41552d038a69 69 * Configures the PAD IO for desired behavior
Zaitsev 10:41552d038a69 70 */
Zaitsev 10:41552d038a69 71 extern void fPadInit();
Zaitsev 10:41552d038a69 72
Zaitsev 10:41552d038a69 73 /**
Zaitsev 10:41552d038a69 74 * @brief
Zaitsev 10:41552d038a69 75 * Set ouptput drive strength, output drive type & pull type for PAD IO
Zaitsev 10:41552d038a69 76 *
Zaitsev 10:41552d038a69 77 * @param PadNum Pad number
Zaitsev 10:41552d038a69 78 * @param OutputDriveStrength Ouput drive strength. Ref Table: O/p drive strength
Zaitsev 10:41552d038a69 79 * @param OutputDriveType Push/pull: 0; opern dran: 1
Zaitsev 10:41552d038a69 80 * @param PullType Pull down active: 0; no pull active:1 or 2; pull up active: 3
Zaitsev 10:41552d038a69 81 *
Zaitsev 10:41552d038a69 82 * @return true for success; false for invalid parameters
Zaitsev 10:41552d038a69 83 */
Zaitsev 10:41552d038a69 84 extern boolean fPadIOCtrl(uint8_t, uint8_t, uint8_t, uint8_t);
Zaitsev 10:41552d038a69 85
Zaitsev 10:41552d038a69 86 #endif //_PAD_H_