pal_ifx_i2c_config.c 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /**
  2. * MIT License
  3. *
  4. * Copyright (c) 2018 Infineon Technologies AG
  5. *
  6. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7. * of this software and associated documentation files (the "Software"), to deal
  8. * in the Software without restriction, including without limitation the rights
  9. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10. * copies of the Software, and to permit persons to whom the Software is
  11. * furnished to do so, subject to the following conditions:
  12. *
  13. * The above copyright notice and this permission notice shall be included in all
  14. * copies or substantial portions of the Software.
  15. *
  16. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  22. * SOFTWARE
  23. *
  24. *
  25. * \file
  26. *
  27. * \brief This file implements platform abstraction layer configurations for ifx i2c protocol.
  28. *
  29. * \addtogroup grPAL
  30. * @{
  31. */
  32. /**********************************************************************************************************************
  33. * HEADER FILES
  34. *********************************************************************************************************************/
  35. #include "stdlib.h"
  36. #include "stdio.h"
  37. #include "optiga/pal/pal_gpio.h"
  38. #include "optiga/pal/pal_i2c.h"
  39. #include "optiga/ifx_i2c/ifx_i2c_config.h"
  40. #include "pal_pin_config.h"
  41. /*********************************************************************************************************************
  42. * pal ifx i2c instance
  43. *********************************************************************************************************************/
  44. /**
  45. * \brief PAL I2C configuration for OPTIGA.
  46. */
  47. pal_i2c_t optiga_pal_i2c_context_0 =
  48. {
  49. /// Pointer to I2C master platform specific context
  50. NULL,
  51. /// Slave address
  52. IFX_I2C_BASE_ADDR,
  53. /// Upper layer context
  54. NULL,
  55. /// Callback event handler
  56. NULL
  57. };
  58. /*********************************************************************************************************************
  59. * PAL GPIO configurations defined for nrf52 development boards PCA10040 and PCA10056 with the Trust X Shield and
  60. * Trust M 2Go board plugged in.
  61. *********************************************************************************************************************/
  62. /**
  63. * \brief PAL vdd pin configuration for OPTIGA.
  64. */
  65. pal_gpio_t optiga_vdd_0 =
  66. {
  67. // Platform specific GPIO context for the pin used to toggle Vdd.
  68. // Casting the uint32_t to a void* is possible, because nrf52 is a 32Bit platform
  69. (void*) OPTIGA_PIN_VDD
  70. };
  71. /**
  72. * \brief PAL reset pin configuration for OPTIGA.
  73. */
  74. pal_gpio_t optiga_reset_0 =
  75. {
  76. // Platform specific GPIO context for the pin used to toggle Reset.
  77. // Casting the uint32_t to a void* is possible, because nrf52 is a 32Bit platform
  78. (void*) OPTIGA_PIN_RST
  79. };
  80. /**
  81. * @}
  82. */