cryptocell_310_util.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2021 HAW Hamburg
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 #ifdef CPU_NRF52
24 #define CHECK_POINTER_DMA_ACCESS(p) ((unsigned int)p >= 0x20000000 ? (unsigned int)p < 0x40000000 : 0)
25 #endif
26 
34 
42 
49 static inline bool cryptocell_310_data_within_ram(const uint8_t* data)
50 {
51  return ((int)data >= CPU_RAM_BASE && (int)data < CPU_RAM_BASE + CPU_RAM_SIZE);
52 }
53 
60 
67 
68 #ifdef __cplusplus
69 }
70 #endif
71 
void cryptocell_310_enable(void)
Enable CryptoCell module and IRQs.
void cryptocell_310_disable(void)
Disable CryptoCell module and IRQs.
void driver_cryptocell_310_setup(void)
Enables CryptoCell module, IRQs and crypto libraries on nrf52840.
static bool cryptocell_310_data_within_ram(const uint8_t *data)
Check whether the given data resides in RAM.
void driver_cryptocell_310_terminate(void)
Finishes the use of the CryptoCell library.
#define CPU_RAM_SIZE
Size of the RAM in Bytes.