X hits on this document

PDF document

A Prototype Optical Tracking System Investigation and Development - page 64 / 170

360 views

0 shares

0 downloads

0 comments

64 / 170

50

Black Spot Firmware

«interface» IFrameSliceProvider

(See Software UML for details)

BlackfinFrameSliceProvider

  • +

    Init()

    • +

      int GetFrameCount()

    • +

      void SetOnFrameProcessedEvent(void (*frameEvent)(int))

«interface» IImageSensor

  • +

    bool Open()

    • +

      bool StartCapture()

    • +

      void StopCapture()

    • +

      void Close()

    • +

      event OnBufferOverrunEvent()

    • +

      event OnBufferFilledEvent(char* buffer, int BufferWidth, int BufferHeight, int YOffset)

    • +

      event OnFrameCompletedEvent(int frameNum)

    • +

      int MaxX()

    • +

      int MaxY()

MT9V022

  • +

    Init()

    • +

      bool DetectDevice()

    • +

      uint8_t SetTestMode()

    • +

      void SetSize(int width, int height)

    • +

      uint8_t Service()

Figure 4.12 Blackfin specific portions of the firmware.

ber of repeats of the chain an entire image has been passed piecewise through the buffers.

Figure 4.13 illustrates this scheme.

fter the first buffer is initially filled, the DM

immediately begins filling the second

buffer. While the second buffer is filled, client code can process the first buffer. This is enabled by subscribing to the events in the IImageSensor interface. These events are

BufferFilledEvent, BufferOverrunEvent, and FrameCompletedEvent.

ll pro-

cessing of the image buffer data occurs in the BufferFilledEvent. The consumer of this event must process the buffer data before the next buffer is filled. Failing to do this will result in a buffer overrun and the BufferOverrunEvent will be called. In this case the driver ceases processing of image data.

The main loop of the client code calls a service function on each iteration and this enables

the IImageSensor events to be fired.

n alternative approach is to add the service func-

tion to a periodically triggered low priority Interrupt Subroutine (ISR) to remove the need for the service routine to be called during the main loop. This could also be achieved by us- ing a Real Time Operating System (RTOS) s the frame is available in strips, all algorithms must be able to operate with only the data available in the current buffer. This complicates

the implementation of the algorithms described above.

Document info
Document views360
Page views360
Page last viewedMon Dec 05 04:24:17 UTC 2016
Pages170
Paragraphs6307
Words54996

Comments