ser_app_hal.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* Copyright (c) 2014 Nordic Semiconductor. All Rights Reserved.
  2. *
  3. * The information contained herein is property of Nordic Semiconductor ASA.
  4. * Terms and conditions of usage are described in detail in NORDIC
  5. * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
  6. *
  7. * Licensees are granted free, non-transferable use of the information. NO
  8. * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
  9. * the file.
  10. *
  11. */
  12. /**@file
  13. *
  14. * @defgroup ser_app_hal Serialization Application Hardware Abstraction Layer
  15. * @{
  16. * @ingroup ble_sdk_lib_serialization
  17. *
  18. * @brief Functions which set up hardware on Application board and perform the reset of the Connectivity Board.
  19. */
  20. #ifndef SER_APP_HAL_H_
  21. #define SER_APP_HAL_H_
  22. #include <stdint.h>
  23. typedef void (*ser_app_hal_flash_op_done_handler_t)(bool success);
  24. /**@brief Function for initializing hw modules.
  25. *
  26. * @details Function can initilize can hardware modules on application processor. It is optional to
  27. * implement. It is called one connectivity chip is initialized.
  28. *
  29. * @param handler Flash operation event handler
  30. *
  31. * @return @ref NRF_SUCCESS HAL initialized successfully.
  32. * @return @ref nrf_error "NRF_ERROR_..." HAL initialization failed.
  33. *
  34. */
  35. uint32_t ser_app_hal_hw_init(ser_app_hal_flash_op_done_handler_t handler);
  36. /**@brief Function for waiting for given amount of time.
  37. *
  38. * @param[in] ms Number of milliseconds to wait.
  39. *
  40. */
  41. void ser_app_hal_delay(uint32_t ms);
  42. /**@brief Function for clearing connectivity chip reset pin
  43. *
  44. */
  45. void ser_app_hal_nrf_reset_pin_clear(void);
  46. /**@brief Function for setting connectivity chip reset pin
  47. *
  48. */
  49. void ser_app_hal_nrf_reset_pin_set(void);
  50. /**@brief Function for setting softdevice event interrupt priority which is serving events incoming
  51. * from connectivity chip.
  52. *
  53. * @note Serialization solution on application side mimics SoC solution where events are handled in
  54. * the interrupt context in two ways: or directly in the interrupt context or message is posted to
  55. * the scheduler. However, it is possible that application processor is not using dedicated interrupt
  56. * for connectivity events. In that case this function can be left empty and
  57. * \ref ser_app_hal_nrf_evt_pending will directly call an interrupt handler function.
  58. */
  59. void ser_app_hal_nrf_evt_irq_priority_set(void);
  60. /**@brief Function for setting pending interrupt for serving events incoming from connectivity chip.
  61. *
  62. * @note The interrupt used for event from connectivity chip mimics behavior of SoC and it is not
  63. * intended to be triggered by any hardware event. This function should be the only source of
  64. * interrupt triggering.
  65. */
  66. void ser_app_hal_nrf_evt_pending(void);
  67. #endif /* SER_APP_HAL_H_ */
  68. /** @} */