board.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /****************************************************************************
  2. * configs/misoc/include/board.h
  3. *
  4. * Copyright (C) 2016 Gregory Nutt. All rights reserved.
  5. * Author: Gregory Nutt <gnutt@nuttx.org>
  6. * Ramtin Amin <keytwo@gmail.com>
  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
  16. * the documentation and/or other materials provided with the
  17. * distribution.
  18. * 3. Neither the name NuttX nor the names of its contributors may be
  19. * used to endorse or promote products derived from this software
  20. * without specific prior written permission.
  21. *
  22. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  23. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  24. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  25. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  26. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  27. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  28. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  29. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  30. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  31. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  32. * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  33. * POSSIBILITY OF SUCH DAMAGE.
  34. *
  35. ****************************************************************************/
  36. #ifndef __CONFIGS_AMBER_INCLUDE_BOARD_H
  37. #define __CONFIGS_AMBER_INCLUDE_BOARD_H
  38. /****************************************************************************
  39. * Included Files
  40. ****************************************************************************/
  41. #include <nuttx/config.h>
  42. /****************************************************************************
  43. * Pre-processor Definitions
  44. ****************************************************************************/
  45. /* Clocking *****************************************************************/
  46. /* Assume default CLKDIV8 fuse setting is overridden to CLKDIV1 */
  47. #define BOARD_XTAL_FREQ 14745600 /* 14.7456MHz crystal */
  48. #define BOARD_CPU_CLOCK BOARD_XTAL_FREQ /* F_CPU = 14.7456MHz */
  49. #define BOARD_TOSCK_CLOCK 32768 /* TOSC = 32.768KHz */
  50. /* LED definitions **********************************************************/
  51. /* The Amber Web Server has a reset switch and four LEDs. The LEDs indicate
  52. * the status of power, programming state, Ethernet link status and reset
  53. * status (Active). None are available for software use.
  54. */
  55. #define LED_STARTED 0
  56. #define LED_HEAPALLOCATE 1
  57. #define LED_IRQSENABLED 2
  58. #define LED_STACKCREATED 3
  59. #define LED_INIRQ 4
  60. #define LED_SIGNAL 5
  61. #define LED_ASSERTION 6
  62. #define LED_PANIC 7
  63. /****************************************************************************
  64. * Public Types
  65. ****************************************************************************/
  66. #ifndef __ASSEMBLY__
  67. /****************************************************************************
  68. * Inline Functions
  69. ****************************************************************************/
  70. /****************************************************************************
  71. * Public Function Prototypes
  72. ****************************************************************************/
  73. #ifdef __cplusplus
  74. #define EXTERN extern "C"
  75. extern "C"
  76. {
  77. #else
  78. #define EXTERN extern
  79. #endif
  80. #undef EXTERN
  81. #ifdef __cplusplus
  82. }
  83. #endif
  84. #endif /* __ASSEMBLY__ */
  85. #endif /* __CONFIGS_AMBER_INCLUDE_BOARD_H */