You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trezor-firmware/core/embed/trezorhal/dma2d.h

54 lines
1.9 KiB

/*
* This file is part of the Trezor project, https://trezor.io/
*
* Copyright (c) SatoshiLabs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TREZORHAL_DMA2D_H
#define TREZORHAL_DMA2D_H
#include "../gdc/gdc_core.h"
#include "common.h"
void dma2d_init(void);
void dma2d_setup_const(void);
void dma2d_setup_4bpp(uint16_t fg_color, uint16_t bg_color);
void dma2d_setup_16bpp(void);
void dma2d_setup_4bpp_over_4bpp(uint16_t fg_color, uint16_t bg_color,
uint16_t overlay_color);
void dma2d_setup_4bpp_over_16bpp(uint16_t overlay_color);
void dma2d_start(uint8_t* in_addr, uint8_t* out_addr, int32_t pixels);
void dma2d_start_const(uint16_t color, uint8_t* out_addr, int32_t pixels);
void dma2d_start_const_multiline(uint16_t color, uint8_t* out_addr,
int32_t width, int32_t height);
void dma2d_start_blend(uint8_t* overlay_addr, uint8_t* bg_addr,
uint8_t* out_addr, int32_t pixels);
void dma2d_wait_for_transfer(void);
void dma2d_wait(void);
bool dma2d_rgb565_fill(const dma2d_params_t* dp);
bool dma2d_rgb565_copy_mono4(const dma2d_params_t* dp);
bool dma2d_rgb565_copy_rgb565(const dma2d_params_t* dp);
bool dma2d_rgb565_blend_mono4(const dma2d_params_t* dp);
bool dma2d_accessible(const void* ptr);
#endif // TREZORHAL_DMA2D_H