parent
3f0026912c
commit
935e9b2912
@ -1,42 +0,0 @@
|
||||
/*
|
||||
* This file is part of the Micro Python project, http://micropython.org/
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2013, 2014 Damien P. George
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef __BOOTLOADER_SDCARD_H__
|
||||
#define __BOOTLOADER_SDCARD_H__
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
// this is a fixed size and should not be changed
|
||||
#define SDCARD_BLOCK_SIZE (512)
|
||||
|
||||
void sdcard_init(void);
|
||||
bool sdcard_is_present(void);
|
||||
bool sdcard_power_on(void);
|
||||
void sdcard_power_off(void);
|
||||
uint64_t sdcard_get_capacity_in_bytes(void);
|
||||
uint32_t sdcard_read_blocks(uint8_t *dest, uint32_t block_num, uint32_t num_blocks);
|
||||
|
||||
#endif
|
@ -1,11 +1,11 @@
|
||||
#include STM32_HAL_H
|
||||
|
||||
void __fatal_error(const char *msg);
|
||||
|
||||
void flash_init(void) {
|
||||
int flash_init(void) {
|
||||
// Enable the flash IRQ, which is used to also call our storage IRQ handler
|
||||
// It needs to go at a higher priority than all those components that rely on
|
||||
// the flash storage (eg higher than USB MSC).
|
||||
HAL_NVIC_SetPriority(FLASH_IRQn, 2, 0);
|
||||
HAL_NVIC_EnableIRQ(FLASH_IRQn);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -0,0 +1,6 @@
|
||||
#ifndef __TREZORHAL_FLASH_H__
|
||||
#define __TREZORHAL_FLASH_H__
|
||||
|
||||
int flash_init(void);
|
||||
|
||||
#endif
|
@ -0,0 +1,7 @@
|
||||
#ifndef __TREZORHAL_RNG_H__
|
||||
#define __TREZORHAL_RNG_H__
|
||||
|
||||
int rng_init(void);
|
||||
uint32_t rng_get(void);
|
||||
|
||||
#endif
|
@ -0,0 +1,16 @@
|
||||
#ifndef __TREZORHAL_SDCARD_H__
|
||||
#define __TREZORHAL_SDCARD_H__
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
// this is a fixed size and should not be changed
|
||||
#define SDCARD_BLOCK_SIZE (512)
|
||||
|
||||
int sdcard_init(void);
|
||||
bool sdcard_is_present(void);
|
||||
bool sdcard_power_on(void);
|
||||
void sdcard_power_off(void);
|
||||
uint64_t sdcard_get_capacity_in_bytes(void);
|
||||
uint32_t sdcard_read_blocks(uint8_t *dest, uint32_t block_num, uint32_t num_blocks);
|
||||
|
||||
#endif
|
@ -0,0 +1,7 @@
|
||||
#ifndef __TREZORHAL_TOUCH_H__
|
||||
#define __TREZORHAL_TOUCH_H__
|
||||
|
||||
int touch_init(void);
|
||||
uint32_t touch_read(void);
|
||||
|
||||
#endif
|
@ -0,0 +1,6 @@
|
||||
#ifndef __TREZORHAL_USB_H__
|
||||
#define __TREZORHAL_USB_H__
|
||||
|
||||
int usb_init(void);
|
||||
|
||||
#endif
|
Loading…
Reference in new issue