sdio.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* Copyright (c) 2009 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. #ifndef SDIO_H
  13. #define SDIO_H
  14. /*lint ++flb "Enter library region" */
  15. #include <stdbool.h>
  16. #include <stdint.h>
  17. /** @file
  18. * @brief 2-wire serial interface driver (compatible with ADNS2080 mouse sensor driver)
  19. *
  20. *
  21. * @defgroup nrf_drivers_sdio SDIO driver
  22. * @{
  23. * @ingroup nrf_drivers
  24. * @brief 2-wire serial interface driver.
  25. */
  26. /**
  27. * @brief Function for initializing 2-wire serial interface and trying to handle stuck slaves.
  28. *
  29. */
  30. void sdio_init(void);
  31. /**
  32. * @brief Function for reading a byte over 2-wire serial interface.
  33. *
  34. * Developer needs to implement this function in a way that suits the hardware.
  35. * @param address Register address to read from
  36. * @return Byte read
  37. */
  38. uint8_t sdio_read_byte(uint8_t address);
  39. /**
  40. * @brief Function for reading several bytes over 2-wire serial interface using burst mode.
  41. *
  42. * Developer needs to implement this function in a way that suits the hardware.
  43. * @param target_buffer Buffer location to store read bytes to
  44. * @param target_buffer_size Bytes allocated for target_buffer
  45. */
  46. void sdio_read_burst(uint8_t *target_buffer, uint8_t target_buffer_size);
  47. /**
  48. * @brief Function for writing a byte over 2-wire serial interface.
  49. *
  50. * Developer needs to implement this function in a way that suits the hardware.
  51. * @param address Register address to write to
  52. * @param data_byte Data byte to write
  53. */
  54. void sdio_write_byte(uint8_t address, uint8_t data_byte);
  55. /**
  56. *@}
  57. **/
  58. /*lint --flb "Leave library region" */
  59. #endif