px-fwlib 0.10.0
Cross-platform embedded library and documentation for 8/16/32-bit microcontrollers generated with Doxygen 1.9.2
px_c1098.h
1#ifndef __PX_C1098_H__
2#define __PX_C1098_H__
3/* =============================================================================
4 ____ ___ ____ ___ _ _ ___ __ __ ___ __ __ TM
5 | _ \ |_ _| / ___| / _ \ | \ | | / _ \ | \/ | |_ _| \ \/ /
6 | |_) | | | | | | | | | | \| | | | | | | |\/| | | | \ /
7 | __/ | | | |___ | |_| | | |\ | | |_| | | | | | | | / \
8 |_| |___| \____| \___/ |_| \_| \___/ |_| |_| |___| /_/\_\
9
10 Copyright (c) 2013 Pieter Conradie <https://piconomix.com>
11
12 License: MIT
13 https://github.com/piconomix/px-fwlib/blob/master/LICENSE.md
14
15 Title: COMedia C1098 CMOS Camera Module driver
16 Author(s): Pieter Conradie
17 Creation Date: 2013-03-30
18
19============================================================================= */
20
21/**
22 * @ingroup DEVICES_SENSOR
23 * @defgroup PX_C1098 px_c1098.h : COMedia C1098 CMOS Camera Module driver
24 *
25 * File(s):
26 * - devices/sensor/inc/px_c1098.h
27 * - devices/sensor/src/px_c1098.c
28 *
29 * Reference:
30 * - [COMedia C1098](http://www.comedia.com.hk/FP13/Spec_PDF/PX_C1098_UM.pdf) CMOS Camera module
31 *
32 * @{
33 */
34
35/* _____STANDARD INCLUDES____________________________________________________ */
36
37/* _____PROJECT INCLUDES_____________________________________________________ */
38#include "px_defs.h"
39#include "px_uart.h"
40
41#ifdef __cplusplus
42extern "C" {
43#endif
44/* _____DEFINITIONS__________________________________________________________ */
45#define PX_C1098_UART_DEFAULT_BAUD 14400
46
47#define PX_C1098_IF_SPEED_14400_BPS 0x07
48#define PX_C1098_IF_SPEED_28800_BPS 0x06
49#define PX_C1098_IF_SPEED_57600_BPS 0x05
50#define PX_C1098_IF_SPEED_115200_BPS 0x04
51#define PX_C1098_IF_SPEED_230400_BPS 0x03
52#define PX_C1098_IF_SPEED_460800_BPS 0x02
53
54#define PX_C1098_JPEG_RES_QVGA 0x05
55#define PX_C1098_JPEG_RES_VGA 0x07
56
57#define PX_C1098_RST_PRIORITY_NORMAL 0x00
58#define PX_C1098_RST_PRIORITY_HIGH 0xFF
59
60#define PX_C1098_DATA_BLOCK_SIZE 128
61
62/* _____TYPE DEFINITIONS_____________________________________________________ */
63
64/* _____GLOBAL VARIABLES_____________________________________________________ */
65/**
66 * Definition for a pointer to a function that will be called once a block of
67 * data has been received.
68 *
69 * @param data Pointer to structure containing received data
70 * @param bytes_received Number of bytes in structure
71 */
72typedef void (*px_c1098_on_rx_data_t)(const uint8_t * data, uint16_t bytes_received);
73
74/* _____GLOBAL VARIABLES_____________________________________________________ */
75
76/* _____GLOBAL FUNCTION DECLARATIONS_________________________________________ */
77
78/* _____GLOBAL FUNCTION DECLARATIONS_________________________________________ */
79void px_c1098_init (px_uart_handle_t * handle);
80
81void px_c1098_task (void);
82bool px_c1098_busy (void);
83bool px_c1098_error (void);
84bool px_c1098_task_execute (void);
85
86void px_c1098_initial (uint8_t if_speed, uint8_t jpeg_res);
87void px_c1098_set_package_size(void);
88void px_c1098_reset (uint8_t rst_priority);
89void px_c1098_sync (void);
90void px_c1098_snapshot (void);
91uint32_t px_c1098_get_picture_size(void);
92void px_c1098_get_picture (px_c1098_on_rx_data_t on_rx_data);
93
94/* _____MACROS_______________________________________________________________ */
95
96#ifdef __cplusplus
97}
98#endif
99
100/// @}
101#endif
void(* px_c1098_on_rx_data_t)(const uint8_t *data, uint16_t bytes_received)
Definition for a pointer to a function that will be called once a block of data has been received.
Definition: px_c1098.h:72
Define UART handle.
Definition: px_uart.h:141