ifx_i2c_config.c 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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 ifx_i2c_config.c
  26. *
  27. * \brief This file provides the ifx i2c platform specific context configurations.
  28. *
  29. * \addtogroup grIFXI2C
  30. * @{
  31. */
  32. /***********************************************************************************************************************
  33. * HEADER FILES
  34. **********************************************************************************************************************/
  35. // Protocol Stack Includes
  36. #include "optiga/pal/pal_ifx_i2c_config.h"
  37. #include "optiga/ifx_i2c/ifx_i2c_config.h"
  38. /***********************************************************************************************************************
  39. * MACROS
  40. **********************************************************************************************************************/
  41. /***********************************************************************************************************************
  42. * ENUMS
  43. **********************************************************************************************************************/
  44. /***********************************************************************************************************************
  45. * DATA STRUCTURES
  46. ***********************************************************************************************************************/
  47. /** @brief This is IFX I2C context. Only one context is supported per slave.*/
  48. //lint --e{785} suppress "Only required fields are initialized, the rest are handled by consumer of this structure"
  49. ifx_i2c_context_t ifx_i2c_context_0 =
  50. {
  51. /// Slave address
  52. 0x30,
  53. /// i2c-master frequency
  54. 400,
  55. /// IFX-I2C frame size
  56. #if (DL_MAX_FRAME_SIZE >= 0x0115)
  57. 0x0115,
  58. #else
  59. DL_MAX_FRAME_SIZE,
  60. #endif
  61. /// Vdd pin
  62. &optiga_vdd_0,
  63. /// Reset pin
  64. &optiga_reset_0,
  65. /// optiga pal i2c context
  66. &optiga_pal_i2c_context_0,
  67. };
  68. /***********************************************************************************************************************
  69. * GLOBAL
  70. ***********************************************************************************************************************/
  71. /***********************************************************************************************************************
  72. * LOCAL ROUTINES
  73. ***********************************************************************************************************************/
  74. /***********************************************************************************************************************
  75. * API PROTOTYPES
  76. **********************************************************************************************************************/
  77. /**
  78. * @}
  79. **/