Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
Loading...
Searching...
No Matches
cascoda_secure.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019, Cascoda Ltd.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * 3. Neither the name of the copyright holder nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#ifndef CASCODA_SECURE_H
30#define CASCODA_SECURE_H
31
33
35void CHILI_SetUseExternalClock(u8_t use_ext_clock);
36
39
41void CHILI_SetEnableCommsInterface(u8_t enable_coms_interface);
42
45
50void CHILI_SetSystemFrequency(fsys_mhz system_frequency);
51
57
62void CHILI_GetUID(uint32_t *uid_out);
63
66
69
71void CHILI_InitADC(u32_t reference);
72
74void CHILI_DeinitADC();
75
78
81
83void CHILI_PowerDownSelectClock(u8_t use_timer0);
84
86u32_t CHILI_PowerDownSecure(u32_t sleeptime_ms, u8_t use_timer0, dpd_flag dpd);
87
90
93
96
98void CHILI_SetAsleep(u8_t new_asleep);
99
102
104void CHILI_SetWakeup(u8_t new_wakeup);
105
108
110void CHILI_SetGPIOInt(u8_t new_gpioint);
111
114
116void CHILI_SetPowerDown(u8_t new_powerdown);
117
119void CHILI_SetLDROMBoot(void);
120
122void CHILI_SetAPROMBoot(void);
123
125void CHILI_EnableTRNGClk(void);
126
128void CHILI_DisableTRNGClk(void);
129
131void CHILI_SPIDMAIRQHandler(void);
132
134void CHILI_RegisterSPIComplete(void (*callback)(void));
135
136#endif
Declaration of platform abstraction functions.
void CHILI_GPIOInitClock()
Initialise GPIO peripheral clock.
Definition cascoda_chili_secure.c:149
void CHILI_EnableTRNGClk(void)
Enable the TRNG Module Clock.
Definition cascoda_chili_secure.c:1212
void CHILI_SetLDROMBoot(void)
Configure the chili to boot from LDROM next time.
Definition cascoda_dataflash_m2351_secure.c:210
void CHILI_SetUseExternalClock(u8_t use_ext_clock)
Set Use_external_clock flag.
Definition cascoda_bsp_secure.c:53
u8_t CHILI_GetGPIOInt()
Has gpio interrupt occured during power-down sequence?
Definition cascoda_chili_secure.c:1169
void CHILI_SetPowerDown(u8_t new_powerdown)
Set power-down flag.
Definition cascoda_chili_secure.c:1174
u8_t CHILI_GetAsleep()
Is chili currently asleep?
Definition cascoda_chili_secure.c:1159
u8_t CHILI_GetWakeup()
Should the Chili wake up?
Definition cascoda_chili_secure.c:1149
void CHILI_InitADC(u32_t reference)
Initialise ADC peripheral.
Definition cascoda_chili_secure.c:125
void CHILI_DisableTRNGClk(void)
Disable the TRNG Module Clock.
Definition cascoda_chili_secure.c:1219
void CHILI_PowerDownSelectClock(u8_t use_timer0)
Configure clock for power down.
Definition cascoda_chili_secure.c:968
u8_t CHILI_GetPowerDown()
Get power-down flag (device is powering down) ?
Definition cascoda_chili_secure.c:1179
void CHILI_EnableSpiModuleClock()
Enable SPI Clock.
Definition cascoda_bsp_secure.c:101
void CHILI_ReInitSetTimerPriority()
Initialise Timer IRQ priorities.
Definition cascoda_chili_secure.c:708
void CHILI_GetUID(uint32_t *uid_out)
Get the 96-bit hardware unique ID.
Definition cascoda_bsp_secure.c:83
fsys_mhz CHILI_GetSystemFrequency(void)
Get current system frequency.
Definition cascoda_bsp_secure.c:78
u8_t CHILI_GetEnableCommsInterface(void)
Get enable_comms_interface flag, used by CHILI_SystemReinit.
Definition cascoda_bsp_secure.c:68
void CHILI_SetGPIOInt(u8_t new_gpioint)
Set gpio interrrupt occured during power-down sequence flag.
Definition cascoda_chili_secure.c:1164
void CHILI_SetWakeup(u8_t new_wakeup)
Set wake up state.
Definition cascoda_chili_secure.c:1144
void CHILI_SPIDMAIRQHandler(void)
Interrupt Handler for SPI DMA.
Definition cascoda_spi_secure.c:160
void CHILI_SetEnableCommsInterface(u8_t enable_coms_interface)
Set enable_comms_interface flag, used by CHILI_SystemReinit.
Definition cascoda_bsp_secure.c:63
u32_t CHILI_PowerDownSecure(u32_t sleeptime_ms, u8_t use_timer0, dpd_flag dpd)
Process all of the secure-only power down routines.
Definition cascoda_chili_secure.c:986
void CHILI_RegisterSPIComplete(void(*callback)(void))
Register the SPIComplete callback on trustzone (Compiles to nothing on non-tz)
Definition cascoda_spi_secure.c:209
u8_t CHILI_GetUseExternalClock(void)
Get Use_external_clock flag.
Definition cascoda_bsp_secure.c:58
void CHILI_SetAPROMBoot(void)
Configure the chili to boot from APROM next time.
Definition cascoda_dataflash_m2351_secure.c:220
void CHILI_DisableTemperatureSensor()
Disable internal temperature sensor.
Definition cascoda_chili_secure.c:961
void CHILI_WaitForSystemStable()
Wait until system is stable after potential usb plug-in.
Definition cascoda_chili_secure.c:1185
void CHILI_SetSystemFrequency(fsys_mhz system_frequency)
Set current system frequency.
Definition cascoda_bsp_secure.c:73
void CHILI_DeinitADC()
Deinitialise ADC peripheral.
Definition cascoda_chili_secure.c:144
void CHILI_EnableTemperatureSensor()
Enable internal temperature sensor.
Definition cascoda_chili_secure.c:954
void CHILI_SetAsleep(u8_t new_asleep)
Set asleep state.
Definition cascoda_chili_secure.c:1154
unsigned long u32_t
Definition cascoda_types.h:50
unsigned char u8_t
Definition cascoda_types.h:46
fsys_mhz
Definition cascoda_interface.h:62
dpd_flag
Definition cascoda_interface.h:95