vivid-rds-gen.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * vivid-rds-gen.h - rds (radio data system) generator support functions.
  3. *
  4. * Copyright 2014 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  5. *
  6. * This program is free software; you may redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; version 2 of the License.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  11. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  12. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  13. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  14. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  15. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  16. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  17. * SOFTWARE.
  18. */
  19. #ifndef _VIVID_RDS_GEN_H_
  20. #define _VIVID_RDS_GEN_H_
  21. /*
  22. * It takes almost exactly 5 seconds to transmit 57 RDS groups.
  23. * Each group has 4 blocks and each block has a payload of 16 bits + a
  24. * block identification. The driver will generate the contents of these
  25. * 57 groups only when necessary and it will just be played continuously.
  26. */
  27. #define VIVID_RDS_GEN_GROUPS 57
  28. #define VIVID_RDS_GEN_BLKS_PER_GRP 4
  29. #define VIVID_RDS_GEN_BLOCKS (VIVID_RDS_GEN_BLKS_PER_GRP * VIVID_RDS_GEN_GROUPS)
  30. struct vivid_rds_gen {
  31. struct v4l2_rds_data data[VIVID_RDS_GEN_BLOCKS];
  32. bool use_rbds;
  33. u16 picode;
  34. u8 pty;
  35. bool mono_stereo;
  36. bool art_head;
  37. bool compressed;
  38. bool dyn_pty;
  39. bool ta;
  40. bool tp;
  41. bool ms;
  42. char psname[8 + 1];
  43. char radiotext[64 + 1];
  44. };
  45. void vivid_rds_gen_fill(struct vivid_rds_gen *rds, unsigned freq,
  46. bool use_alternate);
  47. void vivid_rds_generate(struct vivid_rds_gen *rds);
  48. #endif