11ca3442bSMatthias Ringwald /* 21ca3442bSMatthias Ringwald * Copyright (C) 2014 BlueKitchen GmbH 31ca3442bSMatthias Ringwald * 41ca3442bSMatthias Ringwald * Redistribution and use in source and binary forms, with or without 51ca3442bSMatthias Ringwald * modification, are permitted provided that the following conditions 61ca3442bSMatthias Ringwald * are met: 71ca3442bSMatthias Ringwald * 81ca3442bSMatthias Ringwald * 1. Redistributions of source code must retain the above copyright 91ca3442bSMatthias Ringwald * notice, this list of conditions and the following disclaimer. 101ca3442bSMatthias Ringwald * 2. Redistributions in binary form must reproduce the above copyright 111ca3442bSMatthias Ringwald * notice, this list of conditions and the following disclaimer in the 121ca3442bSMatthias Ringwald * documentation and/or other materials provided with the distribution. 131ca3442bSMatthias Ringwald * 3. Neither the name of the copyright holders nor the names of 141ca3442bSMatthias Ringwald * contributors may be used to endorse or promote products derived 151ca3442bSMatthias Ringwald * from this software without specific prior written permission. 161ca3442bSMatthias Ringwald * 4. Any redistribution, use, or modification is done solely for 171ca3442bSMatthias Ringwald * personal benefit and not for any commercial purpose or for 181ca3442bSMatthias Ringwald * monetary gain. 191ca3442bSMatthias Ringwald * 201ca3442bSMatthias Ringwald * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS 211ca3442bSMatthias Ringwald * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 221ca3442bSMatthias Ringwald * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23*2fca4dadSMilanka Ringwald * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BLUEKITCHEN 24*2fca4dadSMilanka Ringwald * GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 251ca3442bSMatthias Ringwald * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 261ca3442bSMatthias Ringwald * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 271ca3442bSMatthias Ringwald * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 281ca3442bSMatthias Ringwald * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 291ca3442bSMatthias Ringwald * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 301ca3442bSMatthias Ringwald * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 311ca3442bSMatthias Ringwald * SUCH DAMAGE. 321ca3442bSMatthias Ringwald * 331ca3442bSMatthias Ringwald * Please inquire about commercial licensing options at 341ca3442bSMatthias Ringwald * [email protected] 351ca3442bSMatthias Ringwald * 361ca3442bSMatthias Ringwald */ 371ca3442bSMatthias Ringwald 381ca3442bSMatthias Ringwald /** 391ca3442bSMatthias Ringwald * various functions to deal with flaws and portability issues 401ca3442bSMatthias Ringwald */ 411ca3442bSMatthias Ringwald 421ca3442bSMatthias Ringwald // mspgcc LTS doesn't support 20-bit pointer yet -> put const data into .fartext 431ca3442bSMatthias Ringwald 4480e33422SMatthias Ringwald #ifndef HAL_COMPAT_H 4580e33422SMatthias Ringwald #define HAL_COMPAT_H 461ca3442bSMatthias Ringwald 471ca3442bSMatthias Ringwald #include <stdint.h> 481ca3442bSMatthias Ringwald 491ca3442bSMatthias Ringwald void waitAboutOneSecond(void); 501ca3442bSMatthias Ringwald 511ca3442bSMatthias Ringwald // single byte read 521ca3442bSMatthias Ringwald uint8_t FlashReadByte (uint32_t addr); 531ca3442bSMatthias Ringwald 541ca3442bSMatthias Ringwald // argument order matches memcpy 551ca3442bSMatthias Ringwald void FlashReadBlock(uint8_t *buffer, uint32_t addr, uint16_t len); 561ca3442bSMatthias Ringwald 571ca3442bSMatthias Ringwald 581ca3442bSMatthias Ringwald 5980e33422SMatthias Ringwald #endif // HAL_COMPAT_H 60