Asynchronous UART JPEG camera with timer-driven command handling. Call begin() before commands and keep the driver/UART alive during callbacks. Commands share a state machine; do not overlap capture and command sequences.
More...
#include <VC0706.hpp>
|
|
| VC0706 (SerialPort &, uint8_t compRatio=0xFF) |
| | Bind the UART and initial compression byte (default 0xFF).
|
|
void | begin () |
| | Start the UART at 38400 baud and install the asynchronous receive handler.
|
|
void | getVer () |
| | Request the version; the response is printed by the receive handler.
|
| void | takePicture (void(*func)(void *, const char *buf, uint32_t size), void *arg) |
| | Begin an asynchronous JPEG capture when idle.
|
|
void | stopFrame () |
| | Freeze the frame and start the internal length/image retrieval sequence.
|
|
void | getLen () |
| | Request frozen-frame length as part of the capture state machine.
|
|
void | getImage () |
| | Allocate a JPEG buffer and request image bytes after length retrieval.
|
|
void | reset () |
| | Discard pending UART bytes and send an asynchronous reset command.
|
| void | startCapture (uint16_t cycle, void(*func)(void *, bool)=nullptr, void *arg=nullptr) |
| | Enter motion-status capture mode with optional periodic polling.
|
|
void | endCapture () |
| | Stop periodic capture polling and reset the parser to idle.
|
| void | setMotionCtrl (uint8_t len, uint8_t motionAttribute, uint8_t ctrlItme, uint8_t secondBit, uint8_t thirdBit=0) |
| | Send raw motion-control settings.
|
|
void | sendData (char *args, uint8_t Len) |
| | Write Len raw command bytes from args to the UART.
|
| void | recoverFrame (void(*func)(void *, bool)=nullptr, void *arg=nullptr) |
| | Resume frame acquisition asynchronously.
|
|
void | checkMotionStatus () |
| | Send a motion-status query, normally used while startCapture() is active.
|
|
void | restart () |
| | Reset the local parser to idle and resend the current compression ratio.
|
|
|
uint8_t | ratio |
| | Desired compression byte applied by the next capture or restart().
|
Asynchronous UART JPEG camera with timer-driven command handling. Call begin() before commands and keep the driver/UART alive during callbacks. Commands share a state machine; do not overlap capture and command sequences.
◆ recoverFrame()
| void VC0706::recoverFrame |
( |
void(* | func )(void *, bool) = nullptr, |
|
|
void * | arg = nullptr ) |
Resume frame acquisition asynchronously.
- Parameters
-
| func | Optional callback receiving arg and success; timeout reports false. |
| arg | User context passed to the callback. |
◆ setMotionCtrl()
| void VC0706::setMotionCtrl |
( |
uint8_t | len, |
|
|
uint8_t | motionAttribute, |
|
|
uint8_t | ctrlItme, |
|
|
uint8_t | secondBit, |
|
|
uint8_t | thirdBit = 0 ) |
Send raw motion-control settings.
- Parameters
-
| len | Command argument length byte. |
| motionAttribute | Camera motion attribute selector. |
| ctrlItme | Camera control-item selector; 1 sends both payload bytes. |
| secondBit | First motion-control payload byte. |
| thirdBit | Second payload byte, used for control item 1. |
◆ startCapture()
| void VC0706::startCapture |
( |
uint16_t | cycle, |
|
|
void(* | func )(void *, bool) = nullptr, |
|
|
void * | arg = nullptr ) |
Enter motion-status capture mode with optional periodic polling.
- Parameters
-
| cycle | Poll interval in milliseconds; zero disables automatic polling. |
| func | Optional callback receiving arg and true on a detected capture event. |
| arg | User callback context. The stored callback is consumed on notification. |
◆ takePicture()
| void VC0706::takePicture |
( |
void(* | func )(void *, const char *buf, uint32_t size), |
|
|
void * | arg ) |
Begin an asynchronous JPEG capture when idle.
- Parameters
-
| func | Receives arg, JPEG bytes, and byte count; failure paths can report nullptr and zero. The image buffer is valid only during the callback. |
| arg | User context passed to func. A request while busy resets the camera instead of queuing another capture. |
The documentation for this class was generated from the following file: