embeded/raspberry pi2015. 10. 1. 09:03





$ dmesg

[    6.294914] media: Linux media interface: v0.10

[    6.324668] Linux video capture interface: v2.00

[    6.381431] bcm2835-v4l2: scene mode selected 0, was 0

[    6.381912] bcm2835-v4l2: V4L2 device registered as video0 - stills mode > 1280x720

[    6.396970] bcm2835-v4l2: Broadcom 2835 MMAL video capture ver 0.0.2 loaded. 


$ v4l2-ctl


General/Common options:

  --all              display all information available

  -C, --get-ctrl=<ctrl>[,<ctrl>...]

                     get the value of the controls [VIDIOC_G_EXT_CTRLS]

  -c, --set-ctrl=<ctrl>=<val>[,<ctrl>=<val>...]

                     set the value of the controls [VIDIOC_S_EXT_CTRLS]

  -D, --info         show driver info [VIDIOC_QUERYCAP]

  -d, --device=<dev> use device <dev> instead of /dev/video0

                     if <dev> starts with a digit, then /dev/video<dev> is used

  -h, --help         display this help message

  --help-all         all options

  --help-io          input/output options

  --help-misc        miscellaneous options

  --help-overlay     overlay format options

  --help-selection   crop/selection options

  --help-stds        standards and other video timings options

  --help-streaming   streaming options

  --help-tuner       tuner/modulator options

  --help-vbi         VBI format options

  --help-vidcap      video capture format options

  --help-vidout      vidout output format options

  -k, --concise      be more concise if possible.

  -l, --list-ctrls   display all controls and their values [VIDIOC_QUERYCTRL]

  -L, --list-ctrls-menus

                     display all controls and their menus [VIDIOC_QUERYMENU]

  -w, --wrapper      use the libv4l2 wrapper library.

  --list-devices     list all v4l devices

  --log-status       log the board status in the kernel log [VIDIOC_LOG_STATUS]

  --get-priority     query the current access priority [VIDIOC_G_PRIORITY]

  --set-priority=<prio>

                     set the new access priority [VIDIOC_S_PRIORITY]

                     <prio> is 1 (background), 2 (interactive) or 3 (record)

  --silent           only set the result code, do not print any messages

  --sleep=<secs>     sleep <secs>, call QUERYCAP and close the file handle

  --verbose          turn on verbose ioctl status reporting 


$ v4l2-ctl --help-all


General/Common options:

  --all              display all information available

  -C, --get-ctrl=<ctrl>[,<ctrl>...]

                     get the value of the controls [VIDIOC_G_EXT_CTRLS]

  -c, --set-ctrl=<ctrl>=<val>[,<ctrl>=<val>...]

                     set the value of the controls [VIDIOC_S_EXT_CTRLS]

  -D, --info         show driver info [VIDIOC_QUERYCAP]

  -d, --device=<dev> use device <dev> instead of /dev/video0

                     if <dev> starts with a digit, then /dev/video<dev> is used

  -h, --help         display this help message

  --help-all         all options

  --help-io          input/output options

  --help-misc        miscellaneous options

  --help-overlay     overlay format options

  --help-selection   crop/selection options

  --help-stds        standards and other video timings options

  --help-streaming   streaming options

  --help-tuner       tuner/modulator options

  --help-vbi         VBI format options

  --help-vidcap      video capture format options

  --help-vidout      vidout output format options

  -k, --concise      be more concise if possible.

  -l, --list-ctrls   display all controls and their values [VIDIOC_QUERYCTRL]

  -L, --list-ctrls-menus

                     display all controls and their menus [VIDIOC_QUERYMENU]

  -w, --wrapper      use the libv4l2 wrapper library.

  --list-devices     list all v4l devices

  --log-status       log the board status in the kernel log [VIDIOC_LOG_STATUS]

  --get-priority     query the current access priority [VIDIOC_G_PRIORITY]

  --set-priority=<prio>

                     set the new access priority [VIDIOC_S_PRIORITY]

                     <prio> is 1 (background), 2 (interactive) or 3 (record)

  --silent           only set the result code, do not print any messages

  --sleep=<secs>     sleep <secs>, call QUERYCAP and close the file handle

  --verbose          turn on verbose ioctl status reporting


Tuner/Modulator options:

  -F, --get-freq     query the frequency [VIDIOC_G_FREQUENCY]

  -f, --set-freq=<freq>

                     set the frequency to <freq> MHz [VIDIOC_S_FREQUENCY]

  -T, --get-tuner    query the tuner settings [VIDIOC_G_TUNER]

  -t, --set-tuner=<mode>

                     set the audio mode of the tuner [VIDIOC_S_TUNER]

                     Possible values: mono, stereo, lang2, lang1, bilingual

  --tuner-index=<idx> Use idx as tuner idx for tuner/modulator commands

  --list-freq-bands  display all frequency bands for the tuner/modulator

                     [VIDIOC_ENUM_FREQ_BANDS]

  --get-modulator    query the modulator settings [VIDIOC_G_MODULATOR]

  --set-modulator=<txsubchans>

                     set the sub-carrier modulation [VIDIOC_S_MODULATOR]

                     <txsubchans> is one of:

                     mono:       Modulate as mono

                     mono-rds:   Modulate as mono with RDS (radio only)

                     stereo:     Modulate as stereo

                     stereo-rds: Modulate as stereo with RDS (radio only)

                     bilingual:  Modulate as bilingual

                     mono-sap:   Modulate as mono with Second Audio Program

                     stereo-sap: Modulate as stereo with Second Audio Program

  --freq-seek=dir=<0/1>,wrap=<0/1>,spacing=<hz>,low=<freq>,high=<freq>

                     perform a hardware frequency seek [VIDIOC_S_HW_FREQ_SEEK]

                     dir is 0 (seek downward) or 1 (seek upward)

                     wrap is 0 (do not wrap around) or 1 (wrap around)

                     spacing sets the seek resolution (use 0 for default)

                     low and high set the low and high seek frequency range in MHz


Input/Output options:

  -I, --get-input    query the video input [VIDIOC_G_INPUT]

  -i, --set-input=<num>

                     set the video input to <num> [VIDIOC_S_INPUT]

  -N, --list-outputs display video outputs [VIDIOC_ENUMOUTPUT]

  -n, --list-inputs  display video inputs [VIDIOC_ENUMINPUT]

  -O, --get-output   query the video output [VIDIOC_G_OUTPUT]

  -o, --set-output=<num>

                     set the video output to <num> [VIDIOC_S_OUTPUT]

  --set-audio-output=<num>

                     set the audio output to <num> [VIDIOC_S_AUDOUT]

  --get-audio-input  query the audio input [VIDIOC_G_AUDIO]

  --set-audio-input=<num>

                     set the audio input to <num> [VIDIOC_S_AUDIO]

  --get-audio-output query the audio output [VIDIOC_G_AUDOUT]

  --set-audio-output=<num>

                     set the audio output to <num> [VIDIOC_S_AUDOUT]

  --list-audio-outputs

                     display audio outputs [VIDIOC_ENUMAUDOUT]

  --list-audio-inputs

                     display audio inputs [VIDIOC_ENUMAUDIO]


Standards/Timings options:

  --list-standards   display supported video standards [VIDIOC_ENUMSTD]

  -S, --get-standard

                     query the video standard [VIDIOC_G_STD]

  -s, --set-standard=<num>

                     set the video standard to <num> [VIDIOC_S_STD]

                     <num> a numerical v4l2_std value, or one of:

                     pal or pal-X (X = B/G/H/N/Nc/I/D/K/M/60) (V4L2_STD_PAL)

                     ntsc or ntsc-X (X = M/J/K) (V4L2_STD_NTSC)

                     secam or secam-X (X = B/G/H/D/K/L/Lc) (V4L2_STD_SECAM)

  --get-detected-standard

                     display detected input video standard [VIDIOC_QUERYSTD]

  --list-dv-timings  list supp. standard dv timings [VIDIOC_ENUM_DV_TIMINGS]

  --set-dv-bt-timings

                     query: use the output of VIDIOC_QUERY_DV_TIMINGS

                     index=<index>: use the index as provided by --list-dv-timings

                     or give a fully specified timings:

                     width=<width>,height=<height>,interlaced=<0/1>,

                     polarities=<polarities mask>,pixelclock=<pixelclock Hz>,

                     hfp=<horizontal front porch>,hs=<horizontal sync>,

                     hbp=<horizontal back porch>,vfp=<vertical front porch>,

                     vs=<vertical sync>,vbp=<vertical back porch>,

                     il_vfp=<vertical front porch for bottom field>,

                     il_vs=<vertical sync for bottom field>,

                     il_vbp=<vertical back porch for bottom field>,

                     set the digital video timings according to the BT 656/1120

                     standard [VIDIOC_S_DV_TIMINGS]

  --get-dv-timings   get the digital video timings in use [VIDIOC_G_DV_TIMINGS]

  --query-dv-timings query the detected dv timings [VIDIOC_QUERY_DV_TIMINGS]

  --get-dv-timings-cap

                     get the dv timings capabilities [VIDIOC_DV_TIMINGS_CAP]


Video Capture Formats options:

  --list-formats     display supported video formats [VIDIOC_ENUM_FMT]

  --list-formats-mplane

                     display supported video multi-planar formats

                     [VIDIOC_ENUM_FMT]

  --list-formats-ext display supported video formats including frame sizes

                     and intervals

  --list-formats-ext-mplane

                     display supported video multi-planar formats including

                     frame sizes and intervals

  --list-framesizes=<f>

                     list supported framesizes for pixelformat <f>

                     [VIDIOC_ENUM_FRAMESIZES]

                     pixelformat is the fourcc value as a string

  --list-frameintervals=width=<w>,height=<h>,pixelformat=<f>

                     list supported frame intervals for pixelformat <f> and

                     the given width and height [VIDIOC_ENUM_FRAMEINTERVALS]

                     pixelformat is the fourcc value as a string

  -V, --get-fmt-video

                     query the video capture format [VIDIOC_G_FMT]

  -v, --set-fmt-video=width=<w>,height=<h>,pixelformat=<f>

                     set the video capture format [VIDIOC_S_FMT]

                     pixelformat is either the format index as reported by

                     --list-formats, or the fourcc value as a string

  --try-fmt-video=width=<w>,height=<h>,pixelformat=<f>

                     try the video capture format [VIDIOC_TRY_FMT]

                     pixelformat is either the format index as reported by

                     --list-formats, or the fourcc value as a string

  --get-fmt-video-mplane

                     query the video capture format through the multi-planar API

                     [VIDIOC_G_FMT]

  --set-fmt-video-mplane

  --try-fmt-video-mplane=width=<w>,height=<h>,pixelformat=<f>

                     set/try the video capture format using the multi-planar API

                     [VIDIOC_S/TRY_FMT]

                     pixelformat is either the format index as reported by

                     --list-formats-mplane, or the fourcc value as a string


Video Output Formats options:

  --list-formats-out display supported video output formats [VIDIOC_ENUM_FMT]

  --get-fmt-video-out

                     query the video output format [VIDIOC_G_FMT]

  --set-fmt-video-out

  --try-fmt-video-out=width=<w>,height=<h>,pixelformat=<f>

                     set/try the video output format [VIDIOC_TRY_FMT]

                     pixelformat is either the format index as reported by

                     --list-formats-out, or the fourcc value as a string

  --list-formats-out-mplane

                     display supported video output multi-planar formats

                     [VIDIOC_ENUM_FMT]

  --get-fmt-video-out-mplane

                     query the video output format using the multi-planar API

                     [VIDIOC_G_FMT]

  --set-fmt-video-out-mplane

  --try-fmt-video-out-mplane=width=<w>,height=<h>,pixelformat=<f>

                     set/try the video output format with the multi-planar API

                     [VIDIOC_S/TRY_FMT]

                     pixelformat is either the format index as reported by

                     --list-formats-out-mplane, or the fourcc value as a string


Video Overlay options:

  --list-formats-overlay

                     display supported overlay formats [VIDIOC_ENUM_FMT]

  --overlay=<on>     turn overlay on (1) or off (0) (VIDIOC_OVERLAY)

  --get-fmt-overlay  query the video overlay format [VIDIOC_G_FMT]

  --get-fmt-output-overlay

                     query the video output overlay format [VIDIOC_G_FMT]

  --set-fmt-overlay

  --try-fmt-overlay

  --set-fmt-output-overlay

  --try-fmt-output-overlay=chromakey=<key>,global_alpha=<alpha>,

                           top=<t>,left=<l>,width=<w>,height=<h>,field=<f>

                     set/try the video or video output overlay format

                     [VIDIOC_S/TRY_FMT], <f> can be one of:

                     any, none, top, bottom, interlaced, seq_tb, seq_bt,

                     alternate, interlaced_tb, interlaced_bt

  --get-fbuf         query the overlay framebuffer data [VIDIOC_G_FBUF]

  --set-fbuf=chromakey=<b>,global_alpha=<b>,local_alpha=<b>,local_inv_alpha=<b>

                     set the overlay framebuffer [VIDIOC_S_FBUF]

                     b = 0 or 1


VBI Formats options:

  --get-sliced-vbi-cap

                     query the sliced VBI capture capabilities

                     [VIDIOC_G_SLICED_VBI_CAP]

  --get-sliced-vbi-out-cap

                     query the sliced VBI output capabilities

                     [VIDIOC_G_SLICED_VBI_CAP]

  -B, --get-fmt-sliced-vbi

                     query the sliced VBI capture format [VIDIOC_G_FMT]

  --get-fmt-sliced-vbi-out

                     query the sliced VBI output format [VIDIOC_G_FMT]

  -b, --set-fmt-sliced-vbi

  --try-fmt-sliced-vbi

  --set-fmt-sliced-vbi-out

  --try-fmt-sliced-vbi-out=<mode>

                     set/try the sliced VBI capture/output format to <mode>

                     [VIDIOC_S/TRY_FMT], <mode> is a comma separated list of:

                     off:      turn off sliced VBI (cannot be combined with

                               other modes)

                     teletext: teletext (PAL/SECAM)

                     cc:       closed caption (NTSC)

                     wss:      widescreen signal (PAL/SECAM)

                     vps:      VPS (PAL/SECAM)

  --get-fmt-vbi      query the VBI capture format [VIDIOC_G_FMT]

  --get-fmt-vbi-out  query the VBI output format [VIDIOC_G_FMT]


Selection/Cropping options:

  --get-cropcap      query the crop capabilities [VIDIOC_CROPCAP]

  --get-crop         query the video capture crop window [VIDIOC_G_CROP]

  --set-crop=top=<x>,left=<y>,width=<w>,height=<h>

                     set the video capture crop window [VIDIOC_S_CROP]

  --get-cropcap-output

                     query crop capabilities for video output [VIDIOC_CROPCAP]

  --get-crop-output  query the video output crop window [VIDIOC_G_CROP]

  --set-crop-output=top=<x>,left=<y>,width=<w>,height=<h>

                     set the video output crop window [VIDIOC_S_CROP]

  --get-cropcap-overlay

                     query crop capabilities for video overlay [VIDIOC_CROPCAP]

  --get-crop-overlay query the video overlay crop window [VIDIOC_G_CROP]

  --set-crop-overlay=top=<x>,left=<y>,width=<w>,height=<h>

                     set the video overlay crop window [VIDIOC_S_CROP]

  --get-cropcap-output-overlay

                     query the crop capabilities for video output overlays

                     [VIDIOC_CROPCAP]

  --get-crop-output-overlay

                     query the video output overlay crop window [VIDIOC_G_CROP]

  --set-crop-output-overlay=top=<x>,left=<y>,width=<w>,height=<h>

                     set the video output overlay crop window [VIDIOC_S_CROP]

  --get-selection=target=<target>

                     query the video capture selection rectangle [VIDIOC_G_SELECTION]

                     See --set-selection command for the valid <target> values.

  --set-selection=target=<target>,flags=<flags>,top=<x>,left=<y>,width=<w>,height=<h>

                     set the video capture selection rectangle [VIDIOC_S_SELECTION]

                     target=crop|crop_bounds|crop_default|compose|compose_bounds|

                            compose_default|compose_padded

                     flags=le|ge

  --get-selection-output=target=<target>

                     query the video output selection rectangle [VIDIOC_G_SELECTION]

                     See --set-selection command for the valid <target> values.

  --set-selection-output=target=<target>,flags=<flags>,top=<x>,left=<y>,width=<w>,height=<h>

                     set the video output selection rectangle [VIDIOC_S_SELECTION]

                     See --set-selection command for the arguments.


Miscellaneous options:

  --wait-for-event=<event>

                     wait for an event [VIDIOC_DQEVENT]

                     <event> is the event number or one of:

                     eos, vsync, ctrl=<id>, frame_sync

                     where <id> is the name of the control

  --poll-for-event=<event>

                     poll for an event [VIDIOC_DQEVENT]

                     see --wait-for-event for possible events

  -P, --get-parm     display video parameters [VIDIOC_G_PARM]

  -p, --set-parm=<fps>

                     set video framerate in <fps> [VIDIOC_S_PARM]

  --get-output-parm  display output video parameters [VIDIOC_G_PARM]

  --set-output-parm=<fps>

                     set output video framerate in <fps> [VIDIOC_S_PARM]

  --get-jpeg-comp    query the JPEG compression [VIDIOC_G_JPEGCOMP]

  --set-jpeg-comp=quality=<q>,markers=<markers>,comment=<c>,app<n>=<a>

                     set the JPEG compression [VIDIOC_S_JPEGCOMP]

                     <n> is the app segment: 0-9/a-f, <a> is the actual string.

                     <markers> is a colon separated list of:

                     dht:      Define Huffman Tables

                     dqt:      Define Quantization Tables

                     dri:      Define Restart Interval

  --encoder-cmd=cmd=<cmd>,flags=<flags>

                     Send a command to the encoder [VIDIOC_ENCODER_CMD]

                     cmd=start|stop|pause|resume

                     flags=stop_at_gop_end

  --try-encoder-cmd=cmd=<cmd>,flags=<flags>

                     Try an encoder command [VIDIOC_TRY_ENCODER_CMD]

                     See --encoder-cmd for the arguments.

  --decoder-cmd=cmd=<cmd>,flags=<flags>,stop_pts=<pts>,start_speed=<speed>,

                     start_format=<none|gop>

                     Send a command to the decoder [VIDIOC_DECODER_CMD]

                     cmd=start|stop|pause|resume

                     flags=start_mute_audio|pause_to_black|stop_to_black|

                           stop_immediately

  --try-decoder-cmd=cmd=<cmd>,flags=<flags>

                     Try a decoder command [VIDIOC_TRY_DECODER_CMD]

                     See --decoder-cmd for the arguments.


Video Streaming options:

  --stream-count=<count>

                     stream <count> buffers. The default is to keep streaming

                     forever. This count does not include the number of initial

                     skipped buffers as is passed by --stream-skip.

  --stream-skip=<count>

                     skip the first <count> buffers. The default is 0.

  --stream-to=<file> stream to this file. The default is to discard the

                     data. If <file> is '-', then the data is written to stdout

                     and the --silent option is turned on automatically.

  --stream-poll      use non-blocking mode and select() to stream.

  --stream-mmap=<count>

                     capture video using mmap() [VIDIOC_(D)QBUF]

                     count: the number of buffers to allocate. The default is 3.

  --stream-user=<count>

                     capture video using user pointers [VIDIOC_(D)QBUF]

                     count: the number of buffers to allocate. The default is 3.

  --stream-from=<file> stream from this file. The default is to generate a pattern.

                     If <file> is '-', then the data is read from stdin.

  --stream-loop      loop when the end of the file we are streaming from is reached.

                     The default is to stop.

  --stream-pattern=<count>

                     choose output pattern. The default is 0.

  --stream-out-mmap=<count>

                     output video using mmap() [VIDIOC_(D)QBUF]

                     count: the number of buffers to allocate. The default is 3.

  --stream-out-user=<count>

                     output video using user pointers [VIDIOC_(D)QBUF]

                     count: the number of buffers to allocate. The default is 3.

  --list-buffers     list all video buffers [VIDIOC_QUERYBUF]

  --list-buffers-out list all video output buffers [VIDIOC_QUERYBUF]

  --list-buffers-vbi list all VBI buffers [VIDIOC_QUERYBUF]

  --list-buffers-vbi-out

                     list all VBI output buffers [VIDIOC_QUERYBUF]

  --list-buffers-sliced-vbi

                     list all sliced VBI buffers [VIDIOC_QUERYBUF]

  --list-buffers-sliced-vbi-out

                     list all sliced VBI output buffers [VIDIOC_QUERYBUF]


$ v4l2-ctl --list-devices

mmal service 16.1 (platform:bcm2835-v4l2):

        /dev/video0


$ v4l2-ctl -D

Driver Info (not using libv4l2):

        Driver name   : bm2835 mmal

        Card type     : mmal service 16.1

        Bus info      : platform:bcm2835-v4l2

        Driver version: 4.1.6

        Capabilities  : 0x85200005

                Video Capture

                Video Overlay

                Read/Write

                Streaming

                Device Capabilities

        Device Caps   : 0x05200005

                Video Capture

                Video Overlay

                Read/Write

                Streaming


$ v4l2-ctl --get-fmt-video

Format Video Capture:

        Width/Height  : 1920/1088

        Pixel Format  : 'H264'

        Field         : None

        Bytes per Line: 0

        Size Image    : 2088960

        Colorspace    : Broadcast NTSC/PAL (SMPTE170M/ITU601)

        Custom Info   : feedcafe


$ v4l2-ctl --list-formats

ioctl: VIDIOC_ENUM_FMT

        Index       : 0

        Type        : Video Capture

        Pixel Format: 'YU12'

        Name        : 4:2:0, planar, YUV


        Index       : 1

        Type        : Video Capture

        Pixel Format: 'YUYV'

        Name        : 4:2:2, packed, YUYV


        Index       : 2

        Type        : Video Capture

        Pixel Format: 'RGB3'

        Name        : RGB24 (LE)


        Index       : 3

        Type        : Video Capture

        Pixel Format: 'JPEG' (compressed)

        Name        : JPEG


        Index       : 4

        Type        : Video Capture

        Pixel Format: 'H264' (compressed)

        Name        : H264


        Index       : 5

        Type        : Video Capture

        Pixel Format: 'MJPG' (compressed)

        Name        : MJPEG


        Index       : 6

        Type        : Video Capture

        Pixel Format: 'YVYU'

        Name        : 4:2:2, packed, YVYU


        Index       : 7

        Type        : Video Capture

        Pixel Format: 'VYUY'

        Name        : 4:2:2, packed, VYUY


        Index       : 8

        Type        : Video Capture

        Pixel Format: 'UYVY'

        Name        : 4:2:2, packed, UYVY


        Index       : 9

        Type        : Video Capture

        Pixel Format: 'NV12'

        Name        : 4:2:0, planar, NV12


        Index       : 10

        Type        : Video Capture

        Pixel Format: 'BGR3'

        Name        : RGB24 (BE)


        Index       : 11

        Type        : Video Capture

        Pixel Format: 'YV12'

        Name        : 4:2:0, planar, YVU


        Index       : 12

        Type        : Video Capture

        Pixel Format: 'NV21'

        Name        : 4:2:0, planar, NV21


        Index       : 13

        Type        : Video Capture

        Pixel Format: 'BGR4'

        Name        : RGB32 (BE)


$ v4l2-ctl -L


User Controls


                     brightness (int)    : min=0 max=100 step=1 default=50 value=50 flags=slider

                       contrast (int)    : min=-100 max=100 step=1 default=0 value=0 flags=slider

                     saturation (int)    : min=-100 max=100 step=1 default=0 value=0 flags=slider

                    red_balance (int)    : min=1 max=7999 step=1 default=1000 value=1000 flags=slider

                   blue_balance (int)    : min=1 max=7999 step=1 default=1000 value=1000 flags=slider

                horizontal_flip (bool)   : default=0 value=0

                  vertical_flip (bool)   : default=0 value=0

           power_line_frequency (menu)   : min=0 max=3 default=1 value=1

                                0: Disabled

                                1: 50 Hz

                                2: 60 Hz

                                3: Auto

                      sharpness (int)    : min=-100 max=100 step=1 default=0 value=0 flags=slider

                  color_effects (menu)   : min=0 max=15 default=0 value=0

                                0: None

                                1: Black & White

                                2: Sepia

                                3: Negative

                                4: Emboss

                                5: Sketch

                                6: Sky Blue

                                7: Grass Green

                                8: Skin Whiten

                                9: Vivid

                                10: Aqua

                                11: Art Freeze

                                12: Silhouette

                                13: Solarization

                                14: Antique

                                15: Set Cb/Cr

                         rotate (int)    : min=0 max=360 step=90 default=0 value=0

             color_effects_cbcr (int)    : min=0 max=65535 step=1 default=32896 value=32896


Codec Controls


             video_bitrate_mode (menu)   : min=0 max=1 default=0 value=0 flags=update

                                0: Variable Bitrate

                                1: Constant Bitrate

                  video_bitrate (int)    : min=25000 max=25000000 step=25000 default=10000000 value=10000000

         repeat_sequence_header (bool)   : default=0 value=0

            h264_i_frame_period (int)    : min=0 max=2147483647 step=1 default=60 value=60

                     h264_level (menu)   : min=0 max=11 default=11 value=11

                                0: 1

                                1: 1b

                                2: 1.1

                                3: 1.2

                                4: 1.3

                                5: 2

                                6: 2.1

                                7: 2.2

                                8: 3

                                9: 3.1

                                10: 3.2

                                11: 4

                   h264_profile (menu)   : min=0 max=4 default=4 value=4

                                0: Baseline

                                1: Constrained Baseline

                                2: Main

                                4: High


Camera Controls


                  auto_exposure (menu)   : min=0 max=3 default=0 value=0

                                0: Auto Mode

                                1: Manual Mode

         exposure_time_absolute (int)    : min=1 max=10000 step=1 default=1000 value=1000

     exposure_dynamic_framerate (bool)   : default=0 value=0

             auto_exposure_bias (intmenu): min=0 max=24 default=12 value=12

                                0: -4000 (0xfffffffffffff060)

                                1: -3667 (0xfffffffffffff1ad)

                                2: -3333 (0xfffffffffffff2fb)

                                3: -3000 (0xfffffffffffff448)

                                4: -2667 (0xfffffffffffff595)

                                5: -2333 (0xfffffffffffff6e3)

                                6: -2000 (0xfffffffffffff830)

                                7: -1667 (0xfffffffffffff97d)

                                8: -1333 (0xfffffffffffffacb)

                                9: -1000 (0xfffffffffffffc18)

                                10: -667 (0xfffffffffffffd65)

                                11: -333 (0xfffffffffffffeb3)

                                12: 0 (0x0)

                                13: 333 (0x14d)

                                14: 667 (0x29b)

                                15: 1000 (0x3e8)

                                16: 1333 (0x535)

                                17: 1667 (0x683)

                                18: 2000 (0x7d0)

                                19: 2333 (0x91d)

                                20: 2667 (0xa6b)

                                21: 3000 (0xbb8)

                                22: 3333 (0xd05)

                                23: 3667 (0xe53)

                                24: 4000 (0xfa0)

      white_balance_auto_preset (menu)   : min=0 max=9 default=1 value=1

                                0: Manual

                                1: Auto

                                2: Incandescent

                                3: Fluorescent

                                4: Fluorescent H

                                5: Horizon

                                6: Daylight

                                7: Flash

                                8: Cloudy

                                9: Shade

            image_stabilization (bool)   : default=0 value=0

                iso_sensitivity (intmenu): min=0 max=4 default=0 value=0

                                0: 0 (0x0)

                                1: 100 (0x64)

                                2: 200 (0xc8)

                                3: 400 (0x190)

                                4: 800 (0x320)

         exposure_metering_mode (menu)   : min=0 max=2 default=0 value=0

                                0: Average

                                1: Center Weighted

                                2: Spot

                     scene_mode (menu)   : min=0 max=13 default=0 value=0

                                0: None

                                8: Night

                                11: Sports


JPEG Compression Controls


            compression_quality (int)    : min=1 max=100 step=1 default=30 value=30


$ v4l2-ctl --get-priority

Priority: 2


$ v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=4


2015/08/09 - [개소리 왈왈/라즈베리 파이(rpi)] - 라즈베리 파이 csi v4l


'embeded > raspberry pi' 카테고리의 다른 글

opencv 템플릿 매칭 / wiring pi PWM ing..  (0) 2015.10.05
webiopi - rpi IoT  (2) 2015.10.01
라즈베리 파이 2 + usb webcam + servo 2ch  (2) 2015.09.28
라즈베리 파이 PWM 데이터 시트  (0) 2015.09.28
wiring pi PWM / c 코드  (0) 2015.09.28
Posted by 구차니
Programming/openMP2015. 9. 30. 15:16

openCV 2.4.6 부터 Use openMP 옵션이 추가된 기분?

[링크 : https://iamsrijon.wordpress.com/./how-to-compile-opencv-to-utilize-multiple-core-processor-in-linux/]

[링크 : http://answers.opencv.org/question/20955/enabling-openmp-while-building-opencv-libraries/]


결국은. 또 다시 크로스 컴파일이거나...

빌드의 시간인가!?!??



물론.. opencv2가 아닌 opencv에서도 수작업으로 병렬화는 가능한듯

[링크 : https://huseyincakir.wordpress.com/2009/11/05/using-openmp-with-opencv/]


openCV2 2.4.0 에서도 무언가 테스트는 했는데 코드가 없어서 아쉽네..

[링크 : http://museguy.tistory.com/16]



2.4.6

switched all the remaining parallel loops from TBB-only tbb::parallel_for() to universal cv::parallel_for_() with many possible backends (MS Concurrency, Apple's GDC, OpenMP, Intel TBB etc.)


2.4.3

Added universal parallel_for implementation using various backends: TBB (cross-platform: http://threadingbuildingblocks.org), OpenMP (cross-platform: http://en.wikipedia.org/wiki/OpenMP), Grand Central Dispatch (iOS/MacOSX: http://en.wikipedia.org/wiki/Grand_Central_Dispatch), Concurrency (Visual Studio 2010 or later: http://msdn.microsoft.com/en-us/library/dd492418.aspx), C= (http://www.hoopoesnest.com/cstripes/cstripes-details.htm). Many exiting parallel OpenCV algorithms have been converted to the new primitive. Therefore, you can enjoy performance improvements even without having to install TBB and ship it with OpenCV-based applications.


[링크 : http://code.opencv.org/projects/opencv/wiki/ChangeLog]

'Programming > openMP' 카테고리의 다른 글

openmp 관련 정리글(win32)  (0) 2015.10.08
openmp 테스트 on rpi  (0) 2015.10.06
openMP affinity 관련..  (0) 2015.07.23
openMP parallel for private  (4) 2013.12.12
openMP private copyin copyprivate firstprivate lastprivate  (0) 2013.11.28
Posted by 구차니
Programming/C Win32 MFC2015. 9. 30. 15:00

그냥 콘솔창에서도 사용이 가능해 보이니 돌려볼까..


[링크 : http://linuxpoison.blogspot.kr/2010/06/cppcheck-tool-for-static-c-c-code.html]

[링크 : http://cppcheck.sourceforge.net/]

[링크 : http://cppcheck.sourceforge.net/demo/]


우분투에서는 cppcheck 라는 이름으로 있군..

[링크 : http://packages.ubuntu.com/precise/devel/cppcheck]


$ sudo apt-get install cppcheck

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following extra packages will be installed:

  libtinyxml2.6.2

The following NEW packages will be installed:

  cppcheck libtinyxml2.6.2

0 upgraded, 2 newly installed, 0 to remove and 81 not upgraded.

Need to get 604 kB of archives.

After this operation, 1,466 kB of additional disk space will be used.

Do you want to continue [Y/n]?

Get:1 http://archive.ubuntu.com/ubuntu/ precise/universe libtinyxml2.6.2 amd64 2                                      .6.2-1build1 [35.3 kB]

Get:2 http://archive.ubuntu.com/ubuntu/ precise/universe cppcheck amd64 1.52-1 [                                      569 kB]

Fetched 604 kB in 2s (225 kB/s)

Selecting previously unselected package libtinyxml2.6.2.

(Reading database ... 213921 files and directories currently installed.)

Unpacking libtinyxml2.6.2 (from .../libtinyxml2.6.2_2.6.2-1build1_amd64.deb) ...

Selecting previously unselected package cppcheck.

Unpacking cppcheck (from .../cppcheck_1.52-1_amd64.deb) ...

Processing triggers for man-db ...

Setting up libtinyxml2.6.2 (2.6.2-1build1) ...

Setting up cppcheck (1.52-1) ...

Processing triggers for libc-bin ...

ldconfig deferred processing now taking place 


Example usage:

  # Recursively check the current folder. Print the progress on the screen and

    write errors to a file:

    cppcheck . 2> err.txt

  # Recursively check ../myproject/ and don't print progress:

    cppcheck --quiet ../myproject/

  # Check only files one.cpp and two.cpp and give all information there is:

    cppcheck -v -s one.cpp two.cpp

  # Check f.cpp and search include files from inc1/ and inc2/:

    cppcheck -I inc1/ -I inc2/ f.cpp


For more information:

    http://cppcheck.sf.net/manual.pdf


-s를 써보라고 예제가 써있어서 해봤더니 style 체크.. 하지만 deprecated라 경고가 뜬다.

    -s, --style          Deprecated, please use '--enable=style' instead

    -v, --verbose        Output more detailed error information.
    -j <jobs>            Start [jobs] threads to do the checking simultaneously.

의외로 경고 뿜뿜을 안해서 실망.. 복잡한 코드를 돌려봐야 하려나?

암튼. make 처럼 -j 옵션을 지원한다.

'Programming > C Win32 MFC' 카테고리의 다른 글

"\n" 의 cpu 점유율?  (0) 2015.10.12
rand()와 RAND_MAX  (0) 2015.10.05
void형 포인터 ++  (0) 2015.07.14
가변인자를 다시 넘겨주기  (2) 2015.07.07
printf 가변인자의 비밀?  (0) 2015.06.18
Posted by 구차니
Programming/openCV2015. 9. 30. 13:42

3.0.0... 세상은 날 기다려 주지 않는구만 -_-


[링크 : http://opencv.org/downloads.html]


라즈베리 파이에서 사용중인 2.4.1은.. 2012년 6월 버전인가? ㄷㄷㄷ

[링크 : https://github.com/Itseez/opencv/tree/2.4.1]



June, 2015

These are changes since 3.0 rc1.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Over 200 bugs reported at http://code.opencv.org/projects/opencv/issues have been resolved/closed. It includes many fixes in docs, build scripts, python wrappers, core, imgproc, photo, features2d, objdetect, contrib modules, as well as some performance improvements etc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Added pthreads-based backend for cv::parallel_for_. It means that all the parallel processing should be available out-of-the-box on any POSIX-compatible OS, including QNX and such. You are welcome to try it out.


Improved compatibility with OpenCV 2.4:

2.4.11 now includes “opencv2/core.hpp” and other such headers in addition to standard “opencv2/core/core.hpp”.

smart pointers (Ptr<>) can now be created in both 2.4 and 3.0 style (new ClassName(params) vs makePtr(params))

trained and stored stat models from opencv_ml 2.4 can now be loaded and used by opencv_ml 3.0 as-is.

the 2.4=>3.0 transition guide has been sketched: http://docs.opencv.org/master/db/dfa/tutorial_transition_guide.html


[링크 : https://github.com/Itseez/opencv/wiki/ChangeLog]


2.4 -> 3.0 가이드

[링크 : http://docs.opencv.org/master/db/dfa/tutorial_transition_guide.html]

'Programming > openCV' 카테고리의 다른 글

opencv neon 최적화  (0) 2015.10.01
openCV 템플릿 매칭 예제 실행  (0) 2015.10.01
opencv 템플릿 매칭 관련  (0) 2015.09.28
openCV 에피폴라 기하 관련 내용  (0) 2015.09.28
opencv highgui trackbar  (0) 2015.09.27
Posted by 구차니

타임라인에 대해서 쭈욱 나오는데 귀찮으니 패스~


종족을 나눠서 선택하는게 아니라

미션별로 종족을 골라서 진행 할 수 있네? 오홍?


다음편이라 그런지 확실히 미션 설명등에서

좀더 자유로워진 카메라 앵글을 통해 전장을 보여준다.


종족 선택.. 가장 왼쪽부터 끝내자 ㅋㅋ


아쉬운건.. 전편에는 미션목록이 쭈욱 보였는데

우측 상단에 하나하나 봐야 한다는 정도? 대신 클릭하면 목표지점이 보인다.


시작부터 맵이 크네 ㄷㄷ


자원 재생기 달았더니 커졌.... ㄷㄷㄷ


첫판부터 실험급 무기를 만들수 있네 ㅋㅋㅋ



아오 저 콜로서스 -_-



바글바글..

한번에 보내지 꼭 4마리씩 보내서 우리편 킬수를 올려주는 좋은(?)  AEON


방어막 이펙트가 더 정교해진건가?


ㄷㄷㄷ 콜러서스 2마리 ㄷㄷㄷ


적 대장인가? 드럽게 크고 세다 ㄷㄷ


아무튼 귀차니즘(!) 으로 거점방어 5개 곡사포 5개 에 T3 실드 해놓은거에 녹아내렸...


음.. 교환비가 안나와서 아쉽네


Posted by 구차니
Programming/openCV2015. 9. 28. 23:43

약어정리


SIFT(Scale Invariant Feature Transform)

HOG(Histogram of Oriented Gradient)

Haar

Ferns

LBP(Local Binary Pattern)

MCT(Modified Census Transform)


[링크 : http://darkpgmr.tistory.com/116]


camshift

meanshift

[링크 : http://darkpgmr.tistory.com/111]

opencv

[링크 : http://t9t9.com/37] matchtemplate()


opencv 2

[링크 : http://docs.opencv.org/modules/imgproc/doc/object_detection.html]  matchTemplate

[링크 : http://docs.opencv.org/doc/tutorials/imgproc/histograms/template_matching/template_matching.html] <<

[링크 : http://docs.opencv.org/modules/core/doc/basic_structures.html#mat-copyto]

    [링크 : http://webnautes.tistory.com/584] Mat 클래스 / copyto() clone() 메소드

[링크 : http://thinkpiece.tistory.com/246] SIFT 기반

[링크 : http://thinkpiece.tistory.com/244] haar 기반



$ sudo find / -name haarcascade*

/usr/share/opencv/haarcascades

/usr/share/opencv/haarcascades/haarcascade_frontalface_default.xml

/usr/share/opencv/haarcascades/haarcascade_mcs_leftear.xml

/usr/share/opencv/haarcascades/haarcascade_fullbody.xml

/usr/share/opencv/haarcascades/haarcascade_frontalface_alt.xml

/usr/share/opencv/haarcascades/haarcascade_righteye_2splits.xml

/usr/share/opencv/haarcascades/haarcascade_mcs_eyepair_big.xml

/usr/share/opencv/haarcascades/haarcascade_mcs_mouth.xml

/usr/share/opencv/haarcascades/haarcascade_lefteye_2splits.xml

/usr/share/opencv/haarcascades/haarcascade_mcs_lefteye.xml

/usr/share/opencv/haarcascades/haarcascade_profileface.xml

/usr/share/opencv/haarcascades/haarcascade_mcs_nose.xml

/usr/share/opencv/haarcascades/haarcascade_eye_tree_eyeglasses.xml

/usr/share/opencv/haarcascades/haarcascade_mcs_righteye.xml

/usr/share/opencv/haarcascades/haarcascade_mcs_upperbody.xml

/usr/share/opencv/haarcascades/haarcascade_mcs_rightear.xml

/usr/share/opencv/haarcascades/haarcascade_eye.xml

/usr/share/opencv/haarcascades/haarcascade_frontalface_alt2.xml

/usr/share/opencv/haarcascades/haarcascade_upperbody.xml

/usr/share/opencv/haarcascades/haarcascade_mcs_eyepair_small.xml

/usr/share/opencv/haarcascades/haarcascade_frontalface_alt_tree.xml

/usr/share/opencv/haarcascades/haarcascade_lowerbody.xml



'Programming > openCV' 카테고리의 다른 글

openCV 템플릿 매칭 예제 실행  (0) 2015.10.01
opencv 버전들  (0) 2015.09.30
openCV 에피폴라 기하 관련 내용  (0) 2015.09.28
opencv highgui trackbar  (0) 2015.09.27
opencv2 마우스 이벤트 / 클릭 위치  (0) 2015.09.25
Posted by 구차니
Programming/openCV2015. 9. 28. 22:44

동영상에서 실시간으로 연산이 되려나 모르겠네...

그것도 라즈베리로.. 흐음...


SIFT랑 무슨 차이인지 좀 찾아 봐야 할 듯..


[링크 : http://docs.opencv.org/master/da/de9/tutorial_py_epipolar_geometry.html]

'Programming > openCV' 카테고리의 다른 글

opencv 버전들  (0) 2015.09.30
opencv 템플릿 매칭 관련  (0) 2015.09.28
opencv highgui trackbar  (0) 2015.09.27
opencv2 마우스 이벤트 / 클릭 위치  (0) 2015.09.25
opencv2.. VideoCapture 클래스..  (0) 2015.09.25
Posted by 구차니
embeded/raspberry pi2015. 9. 28. 12:57

라즈베리 파이 2에는 PWM 2채널이 사용이 가능해서

2채널 Servo와

2채널 USB webcam(v4l)을 통해서 비디오를 받아 서보로 제어하도록 해봄



$ g++ cv.cpp -lopencv_core -lopencv_video -lopencv_highgui -lwiringPi 


$ cat cv.cpp

#include <opencv2/core/core.hpp>

#include <opencv2/highgui/highgui.hpp>

#include <iostream>


#include <wiringPi.h>


#define MIN_POS 30

#define MAX_POS 110


using namespace cv;

using namespace std;


void init_wiringpi()

{

        if(wiringPiSetup() == -1) exit(0);


        pinMode(1, PWM_OUTPUT);

        pwmSetMode(PWM_MODE_MS);

//      pwmSetRange(1024);

//      pwmSetClock(400);


        pinMode(23, PWM_OUTPUT);

        pwmSetMode(PWM_MODE_MS);

        pwmSetRange(1024);

        pwmSetClock(400);


        pwmWrite(1,     MIN_POS + (MAX_POS - MIN_POS) / 2);

        pwmWrite(23,    MIN_POS + (MAX_POS - MIN_POS) / 2);

}


void setPWM_1(int val)

{

        pwmWrite(23, val);

}


void setPWM_2(int val)

{

        pwmWrite(1, val);

}



void on_trackbar_1(int pos, void *ptr)

{

        int val = MIN_POS + pos * (MAX_POS - MIN_POS) / 100;

        setPWM_1(val);


        cout << "pos 1 [" << pos << ":" << val << "]" << endl;

}


void on_trackbar_2(int pos, void *ptr)

{

        int val = MIN_POS + pos * (MAX_POS - MIN_POS) / 100;

        setPWM_2(val);


        cout << "pos 2 [" << pos << ":" << val << "]" << endl;

}


void on_trackbar_3(int pos, void *ptr)

{

        int val = MIN_POS + pos * (MAX_POS - MIN_POS) / 100;

//      setPWM_1(val);

//      setPWM_2(val);


        setTrackbarPos("track 1", "cam 1", pos);

        setTrackbarPos("track 2", "cam 2", pos);


        cout << "pos 3 [" << pos << ":" << val << "]" << endl;

}


int main(int argc, char** argv)

{

        // opencv 2 style

        VideoCapture cap(0);

        int pos[2];


        init_wiringpi();


        if(!cap.isOpened())

        {

                cout << "No camera detected" << endl;

                return -1;

        }

        else

        {

                cout << "In capture ..." << endl;

                cap.set(CV_CAP_PROP_FRAME_WIDTH, 320);

                cap.set(CV_CAP_PROP_FRAME_HEIGHT, 240);

        }


        VideoCapture cap2(1);

        if(!cap2.isOpened())

        {

                cout << "No camera detected" << endl;

                return -1;

        }

        else

        {

                cout << "In capture ..." << endl;

                cap2.set(CV_CAP_PROP_FRAME_WIDTH, 320);

                cap2.set(CV_CAP_PROP_FRAME_HEIGHT, 240);

        }


        namedWindow("cam 1", WINDOW_AUTOSIZE );

        namedWindow("cam 2", WINDOW_AUTOSIZE );

        namedWindow("control", WINDOW_AUTOSIZE );


        createTrackbar("track 1", "cam 1", &pos[0], 100, on_trackbar_1 );

        createTrackbar("track 2", "cam 2", &pos[1], 100, on_trackbar_2 );

        createTrackbar("track 3", "control", &pos[0], 100, on_trackbar_3 );


        setTrackbarPos("track 1", "cam 1", 50);

        setTrackbarPos("track 2", "cam 2", 50);

        setTrackbarPos("track 3", "control", 50);


        for(;;)

        {

                Mat frame;

                if(!cap.read(frame)) break;

                imshow("cam 1", frame);


                if(!cap2.read(frame)) break;

                imshow("cam 2", frame);


                if(waitKey(30) >= 0) break;

        }


        return 0;

} 


이제...

다음 목표는 오른쪽 카메라 중앙을 ROI 로 설정하여

왼쪽의 카메라와 같은 곳을 바라보도록 서보를 제어하는 것!

'embeded > raspberry pi' 카테고리의 다른 글

webiopi - rpi IoT  (2) 2015.10.01
라즈베리 파이 v4l2-ctl 관련  (0) 2015.10.01
라즈베리 파이 PWM 데이터 시트  (0) 2015.09.28
wiring pi PWM / c 코드  (0) 2015.09.28
뻘짓은 하긴 했는데... (카메라 + 서보)*2  (0) 2015.09.24
Posted by 구차니
embeded/raspberry pi2015. 9. 28. 12:56

pwm 클럭은 채널 1/2에 동일하게 들어가는 듯?


데이터 시트 141p

PWM clock source and frequency is controlled in CPRMAN. 


데이터 시트 138p

채널은 2개 이지만 연결 가능한 GPIO는 여러개로 보인다.

 GPIO가 여러개 라고 해도 동시에 활성화 가능한건 2채널이려나?


+

40번 이후 부터는 compute module에서나 쓸수 있을테고

라즈베리 파이 2에서는

좌/우 로 2개씩 총 4개의 핀이지만 2개의 채널이니까 12,13번 핀을 나란히 써주는 것도 무난 할 듯?

 +-----+-----+---------+------+---+---Pi 2---+---+------+---------+-----+-----+

 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |

 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+

 |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |

 |   2 |   8 |   SDA.1 |   IN | 1 |  3 || 4  |   |      | 5V      |     |     |

 |   3 |   9 |   SCL.1 |   IN | 1 |  5 || 6  |   |      | 0v      |     |     |

 |   4 |   7 | GPIO. 7 |   IN | 1 |  7 || 8  | 1 | ALT0 | TxD     | 15  | 14  |

 |     |     |      0v |      |   |  9 || 10 | 1 | ALT0 | RxD     | 16  | 15  |

 |  17 |   0 | GPIO. 0 |   IN | 0 | 11 || 12 | 0 | IN   | GPIO. 1 | 1   | 18  |

 |  27 |   2 | GPIO. 2 |   IN | 0 | 13 || 14 |   |      | 0v      |     |     |

 |  22 |   3 | GPIO. 3 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO. 4 | 4   | 23  |

 |     |     |    3.3v |      |   | 17 || 18 | 0 | IN   | GPIO. 5 | 5   | 24  |

 |  10 |  12 |    MOSI |   IN | 0 | 19 || 20 |   |      | 0v      |     |     |

 |   9 |  13 |    MISO |   IN | 0 | 21 || 22 | 0 | IN   | GPIO. 6 | 6   | 25  |

 |  11 |  14 |    SCLK |   IN | 0 | 23 || 24 | 1 | IN   | CE0     | 10  | 8   |

 |     |     |      0v |      |   | 25 || 26 | 1 | IN   | CE1     | 11  | 7   |

 |   0 |  30 |   SDA.0 |   IN | 1 | 27 || 28 | 1 | IN   | SCL.0   | 31  | 1   |

 |   5 |  21 | GPIO.21 |   IN | 1 | 29 || 30 |   |      | 0v      |     |     |

 |   6 |  22 | GPIO.22 |   IN | 1 | 31 || 32 | 0 | IN   | GPIO.26 | 26  | 12  |

 |  13 |  23 | GPIO.23 |   IN | 0 | 33 || 34 |   |      | 0v      |     |     |

 |  19 |  24 | GPIO.24 |   IN | 0 | 35 || 36 | 0 | IN   | GPIO.27 | 27  | 16  |

 |  26 |  25 | GPIO.25 |   IN | 0 | 37 || 38 | 0 | IN   | GPIO.28 | 28  | 20  |

 |     |     |      0v |      |   | 39 || 40 | 0 | IN   | GPIO.29 | 29  | 21  |

 +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+

 | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |

 +-----+-----+---------+------+---+---Pi 2---+---+------+---------+-----+-----+



+


클럭관련해서는 PWM 쪽이 아닌 상위에서 넣어준다.

[링크 : http://www.farnell.com/datasheets/1521578.pdf]



---


wiring pi 상으로는 ABC 정렬도 아닌거 같고..

그냥 초기화 해야 하는 순서대로

Mode / Range / Clock 순인것 같다.

PWM Control


PWM can not be controlled when running in Sys mode.

  • pwmSetMode (int mode) ;

The PWM generator can run in 2 modes – “balanced” and “mark:space”. The mark:space mode is traditional, however the default mode in the Pi is “balanced”. You can switch modes by supplying the parameter: PWM_MODE_BAL or PWM_MODE_MS.

  • pwmSetRange (unsigned int range) ;

This sets the range register in the PWM generator. The default is 1024.

  • pwmSetClock (int divisor) ;

This sets the divisor for the PWM clock.

To understand more about the PWM system, you’ll need to read the Broadcom ARM peripherals manual.

[링크 : https://projects.drogon.net/raspberry-pi/wiringpi/functions/] 


Posted by 구차니
embeded/raspberry pi2015. 9. 28. 08:29


void pinMode (int pin, int mode) ;

This sets the mode of a pin to either INPUT, OUTPUT, or PWM_OUTPUT. Note that only wiringPi pin 1 (BCM_GPIO 18) supports PWM output.


void pwmWrite (int pin, int value) ;

Writes the value to the PWM register for the given pin. The value must be between 0 and 1024. (Again, note that only pin 1 (BCM_GPIO 18) supports PWM)


pwmSetMode (int mode) ;

The PWM generator can run in 2 modes – “balanced” and “mark:space”. The mark:space mode is traditional, however the default mode in the Pi is “balanced”. You can switch modes by supplying the parameter: PWM_MODE_BAL or PWM_MODE_MS.


pwmSetRange (unsigned int range) ;

This sets the range register in the PWM generator. The default is 1024.


pwmSetClock (int divisor) ;

This sets the divisor for the PWM clock.


[링크 : https://projects.drogon.net/raspberry-pi/wiringpi/functions/]


LED PWM 예제 - c언어 / wiring pi

[링크 : https://learn.sparkfun.com/tutorials/raspberry-gpio/c-wiringpi-example]


python / pwm 2 ch 예제

[링크 : http://electronut.in/controlling-two-servos-with-hardware-pwm-on-the-raspberry-pi-model-a/]

Posted by 구차니