|
| 1 | +/**************************************************************************** |
| 2 | + * arch/arm/src/stm32h7/hardware/stm32_rng.h |
| 3 | + * |
| 4 | + * SPDX-License-Identifier: Apache-2.0 |
| 5 | + * |
| 6 | + * Licensed to the Apache Software Foundation (ASF) under one or more |
| 7 | + * contributor license agreements. See the NOTICE file distributed with |
| 8 | + * this work for additional information regarding copyright ownership. The |
| 9 | + * ASF licenses this file to you under the Apache License, Version 2.0 (the |
| 10 | + * "License"); you may not use this file except in compliance with the |
| 11 | + * License. You may obtain a copy of the License at |
| 12 | + * |
| 13 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 14 | + * |
| 15 | + * Unless required by applicable law or agreed to in writing, software |
| 16 | + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 17 | + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 18 | + * License for the specific language governing permissions and limitations |
| 19 | + * under the License. |
| 20 | + * |
| 21 | + ****************************************************************************/ |
| 22 | + |
| 23 | +#ifndef __ARCH_ARM_SRC_STM32H7_HARDWARE_STM32_RNG_H |
| 24 | +#define __ARCH_ARM_SRC_STM32H7_HARDWARE_STM32_RNG_H |
| 25 | + |
| 26 | +/**************************************************************************** |
| 27 | + * Included Files |
| 28 | + ****************************************************************************/ |
| 29 | + |
| 30 | +#include <nuttx/config.h> |
| 31 | +#include "chip.h" |
| 32 | + |
| 33 | +/**************************************************************************** |
| 34 | + * Pre-processor Definitions |
| 35 | + ****************************************************************************/ |
| 36 | + |
| 37 | +/* Register Offsets *********************************************************/ |
| 38 | + |
| 39 | +#define STM32_RNG_CR_OFFSET 0x0000 /* RNG Control Register */ |
| 40 | +#define STM32_RNG_SR_OFFSET 0x0004 /* RNG Status Register */ |
| 41 | +#define STM32_RNG_DR_OFFSET 0x0008 /* RNG Data Register */ |
| 42 | + |
| 43 | +/* Register Addresses *******************************************************/ |
| 44 | + |
| 45 | +#define STM32_RNG_CR (STM32_RNG_BASE+STM32_RNG_CR_OFFSET) |
| 46 | +#define STM32_RNG_SR (STM32_RNG_BASE+STM32_RNG_SR_OFFSET) |
| 47 | +#define STM32_RNG_DR (STM32_RNG_BASE+STM32_RNG_DR_OFFSET) |
| 48 | + |
| 49 | +/* Register Bitfield Definitions ********************************************/ |
| 50 | + |
| 51 | +/* RNG Control Register */ |
| 52 | + |
| 53 | +#define RNG_CR_RNGEN (1 << 2) /* Bit 2: RNG enable */ |
| 54 | +#define RNG_CR_IE (1 << 3) /* Bit 3: Interrupt enable */ |
| 55 | +#define RNG_CR_CE (1 << 5) /* Bit 5: Clock error detection */ |
| 56 | + |
| 57 | +/* RNG Status Register */ |
| 58 | + |
| 59 | +#define RNG_SR_DRDY (1 << 0) /* Bit 0: Data ready */ |
| 60 | +#define RNG_SR_CECS (1 << 1) /* Bit 1: Clock error current status */ |
| 61 | +#define RNG_SR_SECS (1 << 2) /* Bit 2: Seed error current status */ |
| 62 | +#define RNG_SR_CEIS (1 << 5) /* Bit 5: Clock error interrupt status */ |
| 63 | +#define RNG_SR_SEIS (1 << 6) /* Bit 6: Seed error interrupt status */ |
| 64 | + |
| 65 | +#endif /* __ARCH_ARM_SRC_STM32H7_HARDWARE_STM32_RNG_H */ |
0 commit comments