config.h 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #ifndef _CONFIG_H_
  2. #define _CONFIG_H_
  3. /*
  4. * Copyright (C) 2003 by egnite Software GmbH
  5. *
  6. * All rights reserved.
  7. *
  8. * Redistribution and use in source and binary forms, with or without
  9. * modification, are permitted provided that the following conditions
  10. * are met:
  11. *
  12. * 1. Redistributions of source code must retain the above copyright
  13. * notice, this list of conditions and the following disclaimer.
  14. * 2. Redistributions in binary form must reproduce the above copyright
  15. * notice, this list of conditions and the following disclaimer in the
  16. * documentation and/or other materials provided with the distribution.
  17. * 3. Neither the name of the copyright holders nor the names of
  18. * contributors may be used to endorse or promote products derived
  19. * from this software without specific prior written permission.
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  24. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  25. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  26. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  27. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  28. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  29. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  30. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  31. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  32. * SUCH DAMAGE.
  33. *
  34. * For additional information see http://www.ethernut.de/
  35. */
  36. /*!
  37. * $Id: config.h 4473 2012-08-20 15:12:45Z haraldkipp $
  38. */
  39. #define CONFAPP_EE_OFFSET 512
  40. #define CONFAPP_EE_NAME "NUTPIPER"
  41. #define MAXLEN_URL 32
  42. #define MAXNUM_STATIONS 128
  43. #define NEXT_STATION 255
  44. #define PREV_STATION 254
  45. typedef struct {
  46. uint16_t rs_port;
  47. uint32_t rs_ip;
  48. char *rs_url;
  49. char *rs_name;
  50. char *rs_genre;
  51. uint32_t rs_metaint;
  52. uint16_t rs_bitrate;
  53. uint8_t rs_scandead;
  54. char *rs_scantitle;
  55. } RADIOSTATION;
  56. extern RADIOSTATION *station;
  57. #define DIST_NONE 0
  58. #define DIST_WAIT 1
  59. #define DIST_CONNECTING 2
  60. #define DIST_CONNECTED 3
  61. #define DIST_BUFFER 4
  62. #define DIST_TITLE 5
  63. #define DIST_STATION 6
  64. #define DIST_VOLUME 7
  65. #define DIST_DEAD 8
  66. #define DIST_FORCE 9
  67. typedef struct {
  68. uint8_t rc_off; /*!< \brief Set when switched off. */
  69. uint8_t rc_cstatus; /*!< \brief Current status. */
  70. uint8_t rc_dstatus; /*!< \brief Displayed status. */
  71. uint8_t rc_cstation; /*!< \brief Current station. */
  72. uint8_t rc_rstation; /*!< \brief Requested station. */
  73. uint8_t rc_cvolume; /*!< \brief Current volume. */
  74. uint8_t rc_rvolume; /*!< \brief Requested station. */
  75. uint8_t rc_cmute; /*!< \brief Muted. */
  76. uint8_t rc_rmute; /*!< \brief Muted requested. */
  77. } RADIOCONTROL;
  78. extern RADIOCONTROL radio;
  79. extern size_t ConfigSize(void);
  80. extern int ConfigLoad(void);
  81. extern void ConfigResetFactory(void);
  82. extern void ConfigSave(void);
  83. extern void ConfigSaveControl(void);
  84. extern int ConfigStation(uint8_t idx, const char * url);
  85. #endif