hpm_ppi.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Copyright (c) 2024 HPMicro
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. *
  6. */
  7. #ifndef _HPM_PPI_H
  8. #define _HPM_PPI_H
  9. /*---------------------------------------------------------------------
  10. * Includes
  11. *---------------------------------------------------------------------
  12. */
  13. #include "hpm_ppi_drv.h"
  14. /**
  15. * @brief ppi async sram config structure
  16. *
  17. */
  18. typedef struct {
  19. uint32_t base_address; /**< external SRAM base address, should be 1MB aligned */
  20. uint32_t size_in_byte; /**< external SRAM size in byte */
  21. ppi_port_size_t port_size; /**< port size */
  22. bool ad_mux_mode; /**< addr and data mux mode */
  23. bool cs_valid_polarity; /**< cs valid polarity */
  24. bool dm_valid_polarity; /**< dm valid polarity */
  25. bool addr_valid_polarity; /**< addr valid polarity */
  26. uint8_t adv_ctrl_pin; /**< adv ctrl pin number, 0 - 7 */
  27. uint8_t rel_ctrl_pin; /**< rel ctrl pin number, 0 - 7 */
  28. uint8_t wel_ctrl_pin; /**< wel ctrl pin number, 0 - 7 */
  29. uint8_t as_in_ns; /**< address setup time */
  30. uint8_t ah_in_ns; /**< address hold time */
  31. uint8_t rel_in_ns; /**< RE low time */
  32. uint8_t reh_in_ns; /**< RE high time */
  33. uint8_t wel_in_ns; /**< WE low time */
  34. uint8_t weh_in_ns; /**< WE high time */
  35. } ppi_async_sram_config_t;
  36. #if defined(__cplusplus)
  37. extern "C" {
  38. #endif /* __cplusplus */
  39. /**
  40. * @brief config async sram
  41. *
  42. * @param[in] ppi PPI base address
  43. * @param[in] cs_index cs index, value: 0 - 3
  44. * @param[in] cmd_index cmd start index
  45. * @param[in] config async sram config structure pointer, @ref ppi_async_sram_config_t
  46. */
  47. void ppi_config_async_sram(PPI_Type *ppi, uint8_t cs_index, uint8_t cmd_start_index, ppi_async_sram_config_t *config);
  48. #if defined(__cplusplus)
  49. }
  50. #endif /* __cplusplus */
  51. #endif /* _HPM_PPI_H */