Implement a secure ICS protocol targeting LoRa Node151 microcontroller for controlling irrigation.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

77 lines
1.9 KiB

  1. /*!
  2. * \file eeprom-board.h
  3. *
  4. * \brief Target board EEPROM driver implementation
  5. *
  6. * \copyright Revised BSD License, see section \ref LICENSE.
  7. *
  8. * \code
  9. * ______ _
  10. * / _____) _ | |
  11. * ( (____ _____ ____ _| |_ _____ ____| |__
  12. * \____ \| ___ | (_ _) ___ |/ ___) _ \
  13. * _____) ) ____| | | || |_| ____( (___| | | |
  14. * (______/|_____)_|_|_| \__)_____)\____)_| |_|
  15. * (C)2013-2017 Semtech
  16. *
  17. * \endcode
  18. *
  19. * \author Miguel Luis ( Semtech )
  20. *
  21. * \author Gregory Cristian ( Semtech )
  22. */
  23. #ifndef __EEPROM_BOARD_H__
  24. #define __EEPROM_BOARD_H__
  25. #ifdef __cplusplus
  26. extern "C"
  27. {
  28. #endif
  29. #include <stdint.h>
  30. #include "utilities.h"
  31. /*!
  32. * Writes the given buffer to the EEPROM at the specified address.
  33. *
  34. * \param[IN] addr EEPROM address to write to
  35. * \param[IN] buffer Pointer to the buffer to be written.
  36. * \param[IN] size Size of the buffer to be written.
  37. * \retval status [LMN_STATUS_OK, LMN_STATUS_ERROR]
  38. */
  39. LmnStatus_t EepromMcuWriteBuffer( uint16_t addr, uint8_t *buffer, uint16_t size );
  40. /*!
  41. * Reads the EEPROM at the specified address to the given buffer.
  42. *
  43. * \param[IN] addr EEPROM address to read from
  44. * \param[OUT] buffer Pointer to the buffer to be written with read data.
  45. * \param[IN] size Size of the buffer to be read.
  46. * \retval status [LMN_STATUS_OK, LMN_STATUS_ERROR]
  47. */
  48. LmnStatus_t EepromMcuReadBuffer( uint16_t addr, uint8_t *buffer, uint16_t size );
  49. /*!
  50. * Sets the device address.
  51. *
  52. * \remark Useful for I2C external EEPROMS
  53. *
  54. * \param[IN] addr External EEPROM address
  55. */
  56. void EepromMcuSetDeviceAddr( uint8_t addr );
  57. /*!
  58. * Gets the current device address.
  59. *
  60. * \remark Useful for I2C external EEPROMS
  61. *
  62. * \retval addr External EEPROM address
  63. */
  64. LmnStatus_t EepromMcuGetDeviceAddr( void );
  65. #ifdef __cplusplus
  66. }
  67. #endif
  68. #endif // __EEPROM_BOARD_H__