1 /* 2 * Copyright (c) 2006-2022, RT-Thread Development Team 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 * 6 * Change Logs: 7 * Date Author Notes 8 * 2022-11-26 GuEe-GUI first version 9 */ 10 11 #ifndef __RESET_SIMPLE_H__ 12 #define __RESET_SIMPLE_H__ 13 14 #include <rtthread.h> 15 #include <rtdevice.h> 16 17 struct reset_simple 18 { 19 struct rt_reset_controller parent; 20 21 void *mmio_base; 22 23 /* 24 * If true, bits are cleared to assert the reset. 25 * Otherwise, bits are set to assert the reset. 26 */ 27 rt_bool_t active_low; 28 /* 29 * If true, bits read back as cleared while the reset is asserted. 30 * Otherwise, bits read back as set while the reset is asserted. 31 */ 32 rt_bool_t status_active_low; 33 34 /* 35 * Minimum delay in microseconds needed that needs to be 36 * waited for between an assert and a deassert to reset the device. 37 * If multiple consumers with different delay 38 * requirements are connected to this controller, it must 39 * be the largest minimum delay. 0 means that such a delay is 40 * unknown and the reset operation is unsupported. 41 */ 42 rt_uint32_t reset_us; 43 44 /* protect registers during read-modify-write cycles */ 45 struct rt_spinlock lock; 46 }; 47 48 extern const struct rt_reset_control_ops reset_simple_ops; 49 50 #endif /* __RESET_SIMPLE_H__ */ 51