AM263x MCU+ SDK  09.02.00
sent_decoder.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2023 Texas Instruments Incorporated
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * distribution.
15  *
16  * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #include <stdio.h>
34 #include <string.h>
35 #include <kernel/dpl/DebugP.h>
36 #include "ti_drivers_config.h"
37 #include "ti_drivers_open_close.h"
38 #include "ti_board_open_close.h"
39 #include <drivers/pruicss.h>
41 #include <icss_intc_defines.h>
42 
51 #define MSS_CTRL_ICSSM_PRU_GPIO_OUT_CTRL_VALUE (0x17F)
52 
53 /*CRC4 LUT offset*/
54 #define CRC4_LUT_OFFSET (0x00U)
55 
56 /*Data ready flag offset located in SRAM*/
57 #define CH0_DATA_READY_FLAG_OFFSET (0x00U)
58 #define CH1_DATA_READY_FLAG_OFFSET (0x01U)
59 #define CH2_DATA_READY_FLAG_OFFSET (0x02U)
60 #define CH3_DATA_READY_FLAG_OFFSET (0x03U)
61 #define CH4_DATA_READY_FLAG_OFFSET (0x04U)
62 #define CH5_DATA_READY_FLAG_OFFSET (0x05U)
63 #define CH6_DATA_READY_FLAG_OFFSET (0x06U)
64 #define CH7_DATA_READY_FLAG_OFFSET (0x07U)
65 
66 /*Offset for Data buffer of channels located in SRAM*/
67 #define CH0_DATA_OFFSET (0x40U)
68 #define CH1_DATA_OFFSET (0x4CU)
69 #define CH2_DATA_OFFSET (0x58U)
70 #define CH3_DATA_OFFSET (0x64U)
71 #define CH4_DATA_OFFSET (0x70U)
72 #define CH5_DATA_OFFSET (0x7CU)
73 #define CH6_DATA_OFFSET (0x88U)
74 #define CH7_DATA_OFFSET (0x94U)
75 
76 /*Flag Mask for individual channels*/
77 #define CH0_FLAG_MASK (0xFFU)
78 #define CH1_FLAG_MASK (0xFF00U)
79 #define CH2_FLAG_MASK (0xFF0000U)
80 #define CH3_FLAG_MASK (0xFF000000U)
81 #define CH4_FLAG_MASK (0xFFU)
82 #define CH5_FLAG_MASK (0xFF00U)
83 #define CH6_FLAG_MASK (0xFF0000U)
84 #define CH7_FLAG_MASK (0xFF000000U)
85 
86 /*Mask for data nibbles*/
87 #define CONFIG_TICK_TIME_OFFSET (0x0U)
88 #define STATUS_COM_BIT_OFFSET (0x2U)
89 #define DATA0_OFFSET (0x3U)
90 #define DATA1_OFFSET (0x4U)
91 #define DATA2_OFFSET (0x5U)
92 #define DATA3_OFFSET (0x6U)
93 #define DATA4_OFFSET (0x7U)
94 #define DATA5_OFFSET (0x8U)
95 #define CRC_OFFSET (0x9U)
96 #define ERROR_STATUS_OFFSET (0xAU)
97 
100 
114 typedef struct Sent_Obj_s
115 {
116  /*Tick Period Config*/
117  uint16_t ConfigTickTime;
118  /*Status & Comm Data 0*/
119  uint8_t StatusComBit;
120  /*Data 0*/
121  uint8_t Data0;
122  /*Data 1*/
123  uint8_t Data1;
124  /*Data 2*/
125  uint8_t Data2;
126  /*Data 3*/
127  uint8_t Data3;
128  /*Data 4*/
129  uint8_t Data4;
130  /*Data 5*/
131  uint8_t Data5;
132  /*CRC*/
133  uint8_t CRC;
134  /*Channel Status Code*/
135  uint16_t error_status;
136 } Sent_Obj;
137 
143 typedef struct Sent_Obj_s *Sent_Handle;
Sent_Obj
SENT Wave Struct Sync Pulse: 56 ticks 4 bit Status and Message Pulse: 17-32 tick 4 bit (9:12) Data0 F...
Definition: sent_decoder.h:115
pruicss.h
gPruIcss0Handle
PRUICSS_Handle gPruIcss0Handle
Global Structure pointer holding PRUSS1 memory Map.
Definition: sent_decoder.h:99
Sent_Obj::Data5
uint8_t Data5
Definition: sent_decoder.h:131
Sent_Obj::Data0
uint8_t Data0
Definition: sent_decoder.h:121
Sent_Obj::Data2
uint8_t Data2
Definition: sent_decoder.h:125
Sent_Obj::Data3
uint8_t Data3
Definition: sent_decoder.h:127
Sent_Obj::ConfigTickTime
uint16_t ConfigTickTime
Definition: sent_decoder.h:117
Sent_Obj::CRC
uint8_t CRC
Definition: sent_decoder.h:133
Sent_Obj::Data1
uint8_t Data1
Definition: sent_decoder.h:123
DebugP.h
pinmux.h
PINMUX Driver API/interface file.
Sent_Handle
struct Sent_Obj_s * Sent_Handle
SENT FRame handle.
Definition: sent_decoder.h:143
Sent_Obj::StatusComBit
uint8_t StatusComBit
Definition: sent_decoder.h:119
Sent_Obj::Data4
uint8_t Data4
Definition: sent_decoder.h:129
Sent_Obj::error_status
uint16_t error_status
Definition: sent_decoder.h:135
PRUICSS_Handle
struct PRUICSS_Config_s * PRUICSS_Handle
A handle that is returned from a PRUICSS_open() call. This handle is required for calling other APIs.
Definition: pruicss/m_v0/pruicss.h:226