2 * vivid-rds-gen.h - rds (radio data system) generator support functions.
4 * Copyright 2014 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
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.
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
20 #ifndef _VIVID_RDS_GEN_H_
21 #define _VIVID_RDS_GEN_H_
24 * It takes almost exactly 5 seconds to transmit 57 RDS groups.
25 * Each group has 4 blocks and each block has a payload of 16 bits + a
26 * block identification. The driver will generate the contents of these
27 * 57 groups only when necessary and it will just be played continuously.
29 #define VIVID_RDS_GEN_GROUPS 57
30 #define VIVID_RDS_GEN_BLKS_PER_GRP 4
31 #define VIVID_RDS_GEN_BLOCKS (VIVID_RDS_GEN_BLKS_PER_GRP * VIVID_RDS_GEN_GROUPS)
32 #define VIVID_RDS_NSEC_PER_BLK (u32)(5ull * NSEC_PER_SEC / VIVID_RDS_GEN_BLOCKS)
34 struct vivid_rds_gen
{
35 struct v4l2_rds_data data
[VIVID_RDS_GEN_BLOCKS
];
47 char radiotext
[64 + 1];
50 void vivid_rds_gen_fill(struct vivid_rds_gen
*rds
, unsigned freq
,
52 void vivid_rds_generate(struct vivid_rds_gen
*rds
);