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.
60 lines
1.4 KiB
60 lines
1.4 KiB
2 years ago
|
/**
|
||
|
* @file OV2640.hpp
|
||
|
* @author Petr Malaník (TheColonelYoung(at)gmail(dot)com)
|
||
|
* @brief
|
||
|
* @version 0.1
|
||
|
* @date 11.09.2022
|
||
|
*/
|
||
|
|
||
|
#pragma once
|
||
|
|
||
|
#include "stm32l4xx_hal.h"
|
||
|
#include "main.h"
|
||
|
|
||
|
#include <vector>
|
||
|
|
||
|
using namespace std;
|
||
|
typedef unsigned int uint;
|
||
|
|
||
2 years ago
|
/**
|
||
|
* @brief Captures image data from camera, control power to camera and transmit data on selected interfaces
|
||
|
* Currently is only UART interface supported
|
||
|
*/
|
||
2 years ago
|
class ButCube_imager
|
||
|
{
|
||
|
private:
|
||
2 years ago
|
/**
|
||
|
* @brief UART interfaces to which data will be exported, interfaces muse be configured in advance
|
||
|
*/
|
||
2 years ago
|
vector<UART_HandleTypeDef> uart_output_interfaces;
|
||
|
|
||
|
public:
|
||
2 years ago
|
/**
|
||
|
* @brief Construct a new ButCube_imager object
|
||
|
*/
|
||
2 years ago
|
ButCube_imager() = default;
|
||
|
|
||
2 years ago
|
/**
|
||
|
* @brief Add UART output to list on which data are exported
|
||
|
*
|
||
|
* @param uart_output UART output to which export data from camera
|
||
|
* @return int
|
||
|
*/
|
||
2 years ago
|
int Add_output(UART_HandleTypeDef uart_output);
|
||
|
|
||
2 years ago
|
/**
|
||
|
* @brief Transmit data from source to selected interfaces
|
||
|
*
|
||
|
* @param source Source of image data
|
||
|
* @return int Count of bytes exported
|
||
|
*/
|
||
2 years ago
|
int Transmit(vector<uint8_t> source);
|
||
|
|
||
2 years ago
|
/**
|
||
|
* @brief Enable or power to camera, controls load switch on camera power rail
|
||
|
*
|
||
|
* @param state true = Enabled, false = Disabled
|
||
|
*/
|
||
2 years ago
|
void Camera_power(bool state);
|
||
|
};
|