1 // Copyright (C) 2022 Beken Corporation 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #pragma once 16 17 #ifdef __cplusplus 18 extern "C" { 19 #endif 20 21 //TODO add full comments according to reg spec 22 typedef volatile struct { 23 24 uint32_t box0_param0; 25 uint32_t box0_param1; 26 uint32_t box0_param2; 27 uint32_t box0_param3; 28 uint32_t box1_param0; 29 uint32_t box1_param1; 30 uint32_t box1_param2; 31 uint32_t box1_param3; 32 union { 33 struct { 34 uint32_t box0_ready: 1; /**< bit[0]*/ 35 uint32_t box1_ready: 1; /**< bit[0]*/ 36 uint32_t reserved: 30; /**< bit[2:31] */ 37 }; 38 uint32_t value; 39 } box_ready; 40 41 union { 42 struct { 43 uint32_t box0_clear: 1; /**< bit[0]*/ 44 uint32_t box1_clear: 1; /**< bit[0]*/ 45 uint32_t reserved: 30; /**< bit[2:31] */ 46 }; 47 uint32_t value; 48 } box_clear; 49 union { 50 struct { 51 uint32_t cpu0_sender: 1; /**< bit[0]*/ 52 uint32_t cpu1_sender: 1; /**< bit[0]*/ 53 uint32_t reserved: 30; /**< bit[2:31] */ 54 }; 55 uint32_t value; 56 } sender; 57 union { 58 struct { 59 uint32_t cpu0_receiver: 1; /**< bit[0]*/ 60 uint32_t cpu1_receiver: 1; /**< bit[0]*/ 61 uint32_t reserved: 30; /**< bit[2:31] */ 62 }; 63 uint32_t value; 64 } receiver; 65 66 } s_mailbox_t; 67 68 #ifdef __cplusplus 69 } 70 #endif 71