cortexM3.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #ifndef _ARCH_CM3_CORTEXM3_H_
  2. #define _ARCH_CM3_CORTEXM3_H_
  3. /*
  4. * Copyright (C) 2010 by Ulrich Prinz (uprinz2@netscape.net)
  5. *
  6. * All rights reserved.
  7. *
  8. * Redistribution and use in source and binary forms, with or without
  9. * modification, are permitted provided that the following conditions
  10. * are met:
  11. *
  12. * 1. Redistributions of source code must retain the above copyright
  13. * notice, this list of conditions and the following disclaimer.
  14. * 2. Redistributions in binary form must reproduce the above copyright
  15. * notice, this list of conditions and the following disclaimer in the
  16. * documentation and/or other materials provided with the distribution.
  17. * 3. Neither the name of the copyright holders nor the names of
  18. * contributors may be used to endorse or promote products derived
  19. * from this software without specific prior written permission.
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  24. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  25. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  26. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  27. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  28. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  29. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  30. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  31. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  32. * SUCH DAMAGE.
  33. *
  34. * For additional information see http://www.ethernut.de/
  35. */
  36. /*
  37. * \verbatim
  38. * $Id: cortexM3.h $
  39. * \endverbatim
  40. */
  41. #include <stdint.h>
  42. #include <cfg/arch.h>
  43. #include <cfg/os.h>
  44. #if defined(MCU_SAM3U)
  45. #include <arch/cm3/atmel/sam3u.h>
  46. #elif defined(MCU_STM32)
  47. #include <arch/cm3/stm/stm32xxxx.h>
  48. #elif defined(MCU_LPC176x)
  49. #include <arch/cm3/nxp/lpc176x.h>
  50. #elif defined(MCU_LPC177x_8x)
  51. #include <arch/cm3/nxp/lpc177x_8x.h>
  52. #elif defined(MCU_LPC407x_8x)
  53. #include <arch/cm3/nxp/lpc407x_8x.h>
  54. #else
  55. #warning "Unknown CM3 family"
  56. #endif
  57. #define NUM_INTERRUPTS (IRQn_MAX + 16)
  58. /* Export initial startup vectors */
  59. #if defined(NUTDEBUG_RAM)
  60. extern void (* g_pfnVectors[])(void *);
  61. #else
  62. extern void (* const g_pfnVectors[])(void *);
  63. #endif
  64. extern void Cortex_RegisterInt(IRQn_Type int_id, void (*pfnHandler)(void*));
  65. extern int Cortex_ResetCause(void);
  66. extern void Cortex_Reset(void);
  67. extern void Cortex_Start(void);
  68. /*! \addtogroup xgNutArchCm3 */
  69. /*@{*/
  70. #endif /* _ARCH_CM3_CORTEXM3_H_ */