ads1115 only

Fork of mbed by mbed official

Committer:
kaoshen
Date:
Tue Jan 17 23:27:32 2017 +0000
Revision:
135:fce8a9387ed1
Parent:
125:2e9cc70d1897
333 ADS1115 ADC1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AnnaBridge 125:2e9cc70d1897 1 /*******************************************************************************
AnnaBridge 125:2e9cc70d1897 2 * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.
AnnaBridge 125:2e9cc70d1897 3 *
AnnaBridge 125:2e9cc70d1897 4 * Permission is hereby granted, free of charge, to any person obtaining a
AnnaBridge 125:2e9cc70d1897 5 * copy of this software and associated documentation files (the "Software"),
AnnaBridge 125:2e9cc70d1897 6 * to deal in the Software without restriction, including without limitation
AnnaBridge 125:2e9cc70d1897 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
AnnaBridge 125:2e9cc70d1897 8 * and/or sell copies of the Software, and to permit persons to whom the
AnnaBridge 125:2e9cc70d1897 9 * Software is furnished to do so, subject to the following conditions:
AnnaBridge 125:2e9cc70d1897 10 *
AnnaBridge 125:2e9cc70d1897 11 * The above copyright notice and this permission notice shall be included
AnnaBridge 125:2e9cc70d1897 12 * in all copies or substantial portions of the Software.
AnnaBridge 125:2e9cc70d1897 13 *
AnnaBridge 125:2e9cc70d1897 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
AnnaBridge 125:2e9cc70d1897 15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
AnnaBridge 125:2e9cc70d1897 16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
AnnaBridge 125:2e9cc70d1897 17 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
AnnaBridge 125:2e9cc70d1897 18 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
AnnaBridge 125:2e9cc70d1897 19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
AnnaBridge 125:2e9cc70d1897 20 * OTHER DEALINGS IN THE SOFTWARE.
AnnaBridge 125:2e9cc70d1897 21 *
AnnaBridge 125:2e9cc70d1897 22 * Except as contained in this notice, the name of Maxim Integrated
AnnaBridge 125:2e9cc70d1897 23 * Products, Inc. shall not be used except as stated in the Maxim Integrated
AnnaBridge 125:2e9cc70d1897 24 * Products, Inc. Branding Policy.
AnnaBridge 125:2e9cc70d1897 25 *
AnnaBridge 125:2e9cc70d1897 26 * The mere transfer of this software does not imply any licenses
AnnaBridge 125:2e9cc70d1897 27 * of trade secrets, proprietary technology, copyrights, patents,
AnnaBridge 125:2e9cc70d1897 28 * trademarks, maskwork rights, or any other form of intellectual
AnnaBridge 125:2e9cc70d1897 29 * property whatsoever. Maxim Integrated Products, Inc. retains all
AnnaBridge 125:2e9cc70d1897 30 * ownership rights.
AnnaBridge 125:2e9cc70d1897 31 *******************************************************************************
AnnaBridge 125:2e9cc70d1897 32 */
AnnaBridge 125:2e9cc70d1897 33
AnnaBridge 125:2e9cc70d1897 34 MEMORY
AnnaBridge 125:2e9cc70d1897 35 {
AnnaBridge 125:2e9cc70d1897 36 FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 2M
AnnaBridge 125:2e9cc70d1897 37 RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 256K
AnnaBridge 125:2e9cc70d1897 38 }
AnnaBridge 125:2e9cc70d1897 39
AnnaBridge 125:2e9cc70d1897 40 /* Linker script to place sections and symbol values. Should be used together
AnnaBridge 125:2e9cc70d1897 41 * with other linker script that defines memory regions FLASH and RAM.
AnnaBridge 125:2e9cc70d1897 42 * It references following symbols, which must be defined in code:
AnnaBridge 125:2e9cc70d1897 43 * Reset_Handler : Entry of reset handler
AnnaBridge 125:2e9cc70d1897 44 *
AnnaBridge 125:2e9cc70d1897 45 * It defines following symbols, which code can use without definition:
AnnaBridge 125:2e9cc70d1897 46 * __exidx_start
AnnaBridge 125:2e9cc70d1897 47 * __exidx_end
AnnaBridge 125:2e9cc70d1897 48 * __etext
AnnaBridge 125:2e9cc70d1897 49 * __data_start__
AnnaBridge 125:2e9cc70d1897 50 * __preinit_array_start
AnnaBridge 125:2e9cc70d1897 51 * __preinit_array_end
AnnaBridge 125:2e9cc70d1897 52 * __init_array_start
AnnaBridge 125:2e9cc70d1897 53 * __init_array_end
AnnaBridge 125:2e9cc70d1897 54 * __fini_array_start
AnnaBridge 125:2e9cc70d1897 55 * __fini_array_end
AnnaBridge 125:2e9cc70d1897 56 * __data_end__
AnnaBridge 125:2e9cc70d1897 57 * __bss_start__
AnnaBridge 125:2e9cc70d1897 58 * __bss_end__
AnnaBridge 125:2e9cc70d1897 59 * __end__
AnnaBridge 125:2e9cc70d1897 60 * end
AnnaBridge 125:2e9cc70d1897 61 * __HeapLimit
AnnaBridge 125:2e9cc70d1897 62 * __StackLimit
AnnaBridge 125:2e9cc70d1897 63 * __StackTop
AnnaBridge 125:2e9cc70d1897 64 * __stack
AnnaBridge 125:2e9cc70d1897 65 */
AnnaBridge 125:2e9cc70d1897 66 ENTRY(Reset_Handler)
AnnaBridge 125:2e9cc70d1897 67
AnnaBridge 125:2e9cc70d1897 68 SECTIONS
AnnaBridge 125:2e9cc70d1897 69 {
AnnaBridge 125:2e9cc70d1897 70 .text :
AnnaBridge 125:2e9cc70d1897 71 {
AnnaBridge 125:2e9cc70d1897 72 KEEP(*(.isr_vector))
AnnaBridge 125:2e9cc70d1897 73 *(.text*)
AnnaBridge 125:2e9cc70d1897 74
AnnaBridge 125:2e9cc70d1897 75 KEEP(*(.init))
AnnaBridge 125:2e9cc70d1897 76 KEEP(*(.fini))
AnnaBridge 125:2e9cc70d1897 77
AnnaBridge 125:2e9cc70d1897 78 /* .ctors */
AnnaBridge 125:2e9cc70d1897 79 *crtbegin.o(.ctors)
AnnaBridge 125:2e9cc70d1897 80 *crtbegin?.o(.ctors)
AnnaBridge 125:2e9cc70d1897 81 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
AnnaBridge 125:2e9cc70d1897 82 *(SORT(.ctors.*))
AnnaBridge 125:2e9cc70d1897 83 *(.ctors)
AnnaBridge 125:2e9cc70d1897 84
AnnaBridge 125:2e9cc70d1897 85 /* .dtors */
AnnaBridge 125:2e9cc70d1897 86 *crtbegin.o(.dtors)
AnnaBridge 125:2e9cc70d1897 87 *crtbegin?.o(.dtors)
AnnaBridge 125:2e9cc70d1897 88 *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
AnnaBridge 125:2e9cc70d1897 89 *(SORT(.dtors.*))
AnnaBridge 125:2e9cc70d1897 90 *(.dtors)
AnnaBridge 125:2e9cc70d1897 91
AnnaBridge 125:2e9cc70d1897 92 *(.rodata*)
AnnaBridge 125:2e9cc70d1897 93
AnnaBridge 125:2e9cc70d1897 94 KEEP(*(.eh_frame*))
AnnaBridge 125:2e9cc70d1897 95 } > FLASH
AnnaBridge 125:2e9cc70d1897 96
AnnaBridge 125:2e9cc70d1897 97 .ARM.extab :
AnnaBridge 125:2e9cc70d1897 98 {
AnnaBridge 125:2e9cc70d1897 99 *(.ARM.extab* .gnu.linkonce.armextab.*)
AnnaBridge 125:2e9cc70d1897 100 } > FLASH
AnnaBridge 125:2e9cc70d1897 101
AnnaBridge 125:2e9cc70d1897 102 __exidx_start = .;
AnnaBridge 125:2e9cc70d1897 103 .ARM.exidx :
AnnaBridge 125:2e9cc70d1897 104 {
AnnaBridge 125:2e9cc70d1897 105 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
AnnaBridge 125:2e9cc70d1897 106 } > FLASH
AnnaBridge 125:2e9cc70d1897 107 __exidx_end = .;
AnnaBridge 125:2e9cc70d1897 108
AnnaBridge 125:2e9cc70d1897 109 __etext = .;
AnnaBridge 125:2e9cc70d1897 110
AnnaBridge 125:2e9cc70d1897 111 .data : AT (__etext)
AnnaBridge 125:2e9cc70d1897 112 {
AnnaBridge 125:2e9cc70d1897 113 __data_start__ = .;
AnnaBridge 125:2e9cc70d1897 114 *(vtable)
AnnaBridge 125:2e9cc70d1897 115 *(.data*)
AnnaBridge 125:2e9cc70d1897 116
AnnaBridge 125:2e9cc70d1897 117 . = ALIGN(4);
AnnaBridge 125:2e9cc70d1897 118 /* preinit data */
AnnaBridge 125:2e9cc70d1897 119 PROVIDE_HIDDEN (__preinit_array_start = .);
AnnaBridge 125:2e9cc70d1897 120 KEEP(*(.preinit_array))
AnnaBridge 125:2e9cc70d1897 121 PROVIDE_HIDDEN (__preinit_array_end = .);
AnnaBridge 125:2e9cc70d1897 122
AnnaBridge 125:2e9cc70d1897 123 . = ALIGN(4);
AnnaBridge 125:2e9cc70d1897 124 /* init data */
AnnaBridge 125:2e9cc70d1897 125 PROVIDE_HIDDEN (__init_array_start = .);
AnnaBridge 125:2e9cc70d1897 126 KEEP(*(SORT(.init_array.*)))
AnnaBridge 125:2e9cc70d1897 127 KEEP(*(.init_array))
AnnaBridge 125:2e9cc70d1897 128 PROVIDE_HIDDEN (__init_array_end = .);
AnnaBridge 125:2e9cc70d1897 129
AnnaBridge 125:2e9cc70d1897 130
AnnaBridge 125:2e9cc70d1897 131 . = ALIGN(4);
AnnaBridge 125:2e9cc70d1897 132 /* finit data */
AnnaBridge 125:2e9cc70d1897 133 PROVIDE_HIDDEN (__fini_array_start = .);
AnnaBridge 125:2e9cc70d1897 134 KEEP(*(SORT(.fini_array.*)))
AnnaBridge 125:2e9cc70d1897 135 KEEP(*(.fini_array))
AnnaBridge 125:2e9cc70d1897 136 PROVIDE_HIDDEN (__fini_array_end = .);
AnnaBridge 125:2e9cc70d1897 137
AnnaBridge 125:2e9cc70d1897 138 . = ALIGN(4);
AnnaBridge 125:2e9cc70d1897 139 /* All data end */
AnnaBridge 125:2e9cc70d1897 140 __data_end__ = .;
AnnaBridge 125:2e9cc70d1897 141
AnnaBridge 125:2e9cc70d1897 142 } > RAM
AnnaBridge 125:2e9cc70d1897 143
AnnaBridge 125:2e9cc70d1897 144 .bss :
AnnaBridge 125:2e9cc70d1897 145 {
AnnaBridge 125:2e9cc70d1897 146 __bss_start__ = .;
AnnaBridge 125:2e9cc70d1897 147 *(.bss*)
AnnaBridge 125:2e9cc70d1897 148 *(COMMON)
AnnaBridge 125:2e9cc70d1897 149 __bss_end__ = .;
AnnaBridge 125:2e9cc70d1897 150 } > RAM
AnnaBridge 125:2e9cc70d1897 151
AnnaBridge 125:2e9cc70d1897 152 .heap :
AnnaBridge 125:2e9cc70d1897 153 {
AnnaBridge 125:2e9cc70d1897 154 __end__ = .;
AnnaBridge 125:2e9cc70d1897 155 end = __end__;
AnnaBridge 125:2e9cc70d1897 156 *(.heap*)
AnnaBridge 125:2e9cc70d1897 157 __HeapLimit = .;
AnnaBridge 125:2e9cc70d1897 158 } > RAM
AnnaBridge 125:2e9cc70d1897 159
AnnaBridge 125:2e9cc70d1897 160 /* .stack_dummy section doesn't contains any symbols. It is only
AnnaBridge 125:2e9cc70d1897 161 * used for linker to calculate size of stack sections, and assign
AnnaBridge 125:2e9cc70d1897 162 * values to stack symbols later */
AnnaBridge 125:2e9cc70d1897 163 .stack_dummy :
AnnaBridge 125:2e9cc70d1897 164 {
AnnaBridge 125:2e9cc70d1897 165 *(.stack)
AnnaBridge 125:2e9cc70d1897 166 } > RAM
AnnaBridge 125:2e9cc70d1897 167
AnnaBridge 125:2e9cc70d1897 168 /* Set stack top to end of RAM, and stack limit move down by
AnnaBridge 125:2e9cc70d1897 169 * size of stack_dummy section */
AnnaBridge 125:2e9cc70d1897 170 __StackTop = ORIGIN(RAM) + LENGTH(RAM);
AnnaBridge 125:2e9cc70d1897 171 __StackLimit = __StackTop - SIZEOF(.stack_dummy);
AnnaBridge 125:2e9cc70d1897 172 PROVIDE(__stack = __StackTop);
AnnaBridge 125:2e9cc70d1897 173
AnnaBridge 125:2e9cc70d1897 174 /* Check if data + heap + stack exceeds RAM limit */
AnnaBridge 125:2e9cc70d1897 175 ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
AnnaBridge 125:2e9cc70d1897 176 }