romapi_8xx.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. * @brief LPC8xx ROM API declarations and functions
  3. *
  4. * @note
  5. * Copyright(C) NXP Semiconductors, 2012
  6. * All rights reserved.
  7. *
  8. * @par
  9. * Software that is described herein is for illustrative purposes only
  10. * which provides customers with programming information regarding the
  11. * LPC products. This software is supplied "AS IS" without any warranties of
  12. * any kind, and NXP Semiconductors and its licensor disclaim any and
  13. * all warranties, express or implied, including all implied warranties of
  14. * merchantability, fitness for a particular purpose and non-infringement of
  15. * intellectual property rights. NXP Semiconductors assumes no responsibility
  16. * or liability for the use of the software, conveys no license or rights under any
  17. * patent, copyright, mask work right, or any other intellectual property rights in
  18. * or to any products. NXP Semiconductors reserves the right to make changes
  19. * in the software without notification. NXP Semiconductors also makes no
  20. * representation or warranty that such application will be suitable for the
  21. * specified use without further testing or modification.
  22. *
  23. * @par
  24. * Permission to use, copy, modify, and distribute this software and its
  25. * documentation is hereby granted, under NXP Semiconductors' and its
  26. * licensor's relevant copyrights in the software, without fee, provided that it
  27. * is used in conjunction with NXP Semiconductors microcontrollers. This
  28. * copyright, permission, and disclaimer notice must appear in all copies of
  29. * this code.
  30. */
  31. #ifndef __ROMAPI_8XX_H_
  32. #define __ROMAPI_8XX_H_
  33. #include "../iap/iap.h"
  34. #include "../../common/chip/error_8xx.h"
  35. #include "rom_i2c_8xx.h"
  36. #include "rom_pwr_8xx.h"
  37. #include "rom_uart_8xx.h"
  38. #ifdef __cplusplus
  39. extern "C" {
  40. #endif
  41. /** @defgroup ROMAPI_8XX CHIP: LPC8xx ROM API declarations and functions
  42. * @ingroup CHIP_8XX_Drivers
  43. * @{
  44. */
  45. /**
  46. * @brief LPC8XX High level ROM API structure
  47. */
  48. typedef struct ROM_API {
  49. const uint32_t unused[3];
  50. const PWRD_API_T *pPWRD; /*!< Power profiles API function table */
  51. const uint32_t p_dev1;
  52. const I2CD_API_T *pI2CD; /*!< I2C driver routines functions table */
  53. const uint32_t p_dev3;
  54. const uint32_t p_dev4;
  55. const uint32_t p_dev5;
  56. const UARTD_API_T *pUARTD; /*!< UART driver routines function table */
  57. } LPC_ROM_API_T;
  58. /* Pointer to ROM API function address */
  59. #define LPC_ROM_API_BASE_LOC 0x1FFF1FF8UL
  60. #define LPC_ROM_API (*(LPC_ROM_API_T * *) LPC_ROM_API_BASE_LOC)
  61. /* Pointer to @ref PWRD_API_T functions in ROM */
  62. #define LPC_PWRD_API ((LPC_ROM_API)->pPWRD)
  63. /* Pointer to @ref I2CD_API_T functions in ROM */
  64. #define LPC_I2CD_API ((LPC_ROM_API)->pI2CD)
  65. /* Pointer to @ref UARTD_API_T functions in ROM */
  66. #define LPC_UARTD_API ((LPC_ROM_API)->pUARTD)
  67. /* Pointer to ROM IAP entry functions */
  68. #define IAP_ENTRY_LOCATION 0X1FFF1FF1UL
  69. /**
  70. * @brief LPC8XX IAP_ENTRY API function type
  71. */
  72. static INLINE void iap_entry(unsigned int cmd_param[], unsigned int status_result[])
  73. {
  74. ((IAP_ENTRY_T) IAP_ENTRY_LOCATION)(cmd_param, status_result);
  75. }
  76. /**
  77. * @}
  78. */
  79. #ifdef __cplusplus
  80. }
  81. #endif
  82. #endif /* __ROMAPI_8XX_H_ */