LibDriver PMW3901MB
Loading...
Searching...
No Matches
pmw3901mb basic driver function

pmw3901mb basic driver modules More...

Collaboration diagram for pmw3901mb basic driver function:

Data Structures

struct  pmw3901mb_motion_s
 pmw3901mb motion structure definition More...
struct  pmw3901mb_handle_s
 pmw3901mb handle structure definition More...
struct  pmw3901mb_info_s
 pmw3901mb information structure definition More...

Typedefs

typedef struct pmw3901mb_motion_s pmw3901mb_motion_t
 pmw3901mb motion structure definition
typedef struct pmw3901mb_handle_s pmw3901mb_handle_t
 pmw3901mb handle structure definition
typedef struct pmw3901mb_info_s pmw3901mb_info_t
 pmw3901mb information structure definition

Functions

uint8_t pmw3901mb_info (pmw3901mb_info_t *info)
 get chip's information
uint8_t pmw3901mb_init (pmw3901mb_handle_t *handle)
 initialize the chip
uint8_t pmw3901mb_deinit (pmw3901mb_handle_t *handle)
 close the chip
uint8_t pmw3901mb_power_up (pmw3901mb_handle_t *handle)
 power up the chip
uint8_t pmw3901mb_shutdown (pmw3901mb_handle_t *handle)
 shutdown the chip
uint8_t pmw3901mb_reset (pmw3901mb_handle_t *handle)
 reset the chip
uint8_t pmw3901mb_set_optimum_performance (pmw3901mb_handle_t *handle)
 set the optimum performance
uint8_t pmw3901mb_burst_read (pmw3901mb_handle_t *handle, pmw3901mb_motion_t *motion)
 burst read data
uint8_t pmw3901mb_delta_raw_to_delta_cm (pmw3901mb_handle_t *handle, int16_t raw, float height_m, float *cm)
 convert the delta raw to the delta cm
uint8_t pmw3901mb_start_frame_capture (pmw3901mb_handle_t *handle)
 start frame capture
uint8_t pmw3901mb_stop_frame_capture (pmw3901mb_handle_t *handle)
 stop frame capture
uint8_t pmw3901mb_get_frame (pmw3901mb_handle_t *handle, uint8_t frame[35][35])
 get the frame
uint8_t pmw3901mb_get_product_id (pmw3901mb_handle_t *handle, uint8_t *id)
 get the product id
uint8_t pmw3901mb_get_inverse_product_id (pmw3901mb_handle_t *handle, uint8_t *id)
 get the inverse product id
uint8_t pmw3901mb_get_revision_id (pmw3901mb_handle_t *handle, uint8_t *id)
 get the revision id
uint8_t pmw3901mb_get_motion (pmw3901mb_handle_t *handle, uint8_t *motion)
 get the motion
uint8_t pmw3901mb_set_motion (pmw3901mb_handle_t *handle, uint8_t motion)
 set the motion
uint8_t pmw3901mb_get_delta_x (pmw3901mb_handle_t *handle, int16_t *delta)
 get the delta x
uint8_t pmw3901mb_get_delta_y (pmw3901mb_handle_t *handle, int16_t *delta)
 get the delta y
uint8_t pmw3901mb_get_motion_burst (pmw3901mb_handle_t *handle, uint8_t *burst, uint8_t len)
 get the motion burst
uint8_t pmw3901mb_get_squal (pmw3901mb_handle_t *handle, uint8_t *squal)
 get the surface quality
uint8_t pmw3901mb_get_raw_data_sum (pmw3901mb_handle_t *handle, uint8_t *sum)
 get the average raw data value
uint8_t pmw3901mb_get_max_raw_data (pmw3901mb_handle_t *handle, uint8_t *max)
 get the maximum raw data value
uint8_t pmw3901mb_get_min_raw_data (pmw3901mb_handle_t *handle, uint8_t *min)
 get the minimum raw data value
uint8_t pmw3901mb_get_shutter (pmw3901mb_handle_t *handle, uint16_t *shutter)
 get the shutter
uint8_t pmw3901mb_get_observation (pmw3901mb_handle_t *handle, uint8_t *observation)
 get the observation
uint8_t pmw3901mb_set_observation (pmw3901mb_handle_t *handle, uint8_t observation)
 set the observation
uint8_t pmw3901mb_get_raw_data_grab (pmw3901mb_handle_t *handle, uint8_t *grab, uint16_t len)
 get the raw data grab
uint8_t pmw3901mb_set_raw_data_grab (pmw3901mb_handle_t *handle, uint8_t *grab, uint16_t len)
 set the raw data grab
uint8_t pmw3901mb_get_raw_data_grab_status (pmw3901mb_handle_t *handle, uint8_t *status)
 get the raw data grab status

Detailed Description

pmw3901mb basic driver modules

Typedef Documentation

◆ pmw3901mb_handle_t

pmw3901mb handle structure definition

◆ pmw3901mb_info_t

pmw3901mb information structure definition

◆ pmw3901mb_motion_t

pmw3901mb motion structure definition

Function Documentation

◆ pmw3901mb_burst_read()

uint8_t pmw3901mb_burst_read ( pmw3901mb_handle_t * handle,
pmw3901mb_motion_t * motion )

burst read data

Parameters
[in]*handlepointer to a pmw3901mb handle structure
[out]*motionpointer to a motion structure
Returns
status code
  • 0 success
  • 1 burst read failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 398 of file driver_pmw3901mb.c.

◆ pmw3901mb_deinit()

uint8_t pmw3901mb_deinit ( pmw3901mb_handle_t * handle)

close the chip

Parameters
[in]*handlepointer to a pmw3901mb handle structure
Returns
status code
  • 0 success
  • 1 spi or gpio deinit failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 power down failed
Note
none

Definition at line 257 of file driver_pmw3901mb.c.

◆ pmw3901mb_delta_raw_to_delta_cm()

uint8_t pmw3901mb_delta_raw_to_delta_cm ( pmw3901mb_handle_t * handle,
int16_t raw,
float height_m,
float * cm )

convert the delta raw to the delta cm

Parameters
[in]*handlepointer to a pmw3901mb handle structure
[in]rawdelta raw
[in]height_mheight(m)
[out]*cmpointer to a cm buffer
Returns
status code
  • 0 success
  • 1 delta raw to delta cm failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2402 of file driver_pmw3901mb.c.

◆ pmw3901mb_get_delta_x()

uint8_t pmw3901mb_get_delta_x ( pmw3901mb_handle_t * handle,
int16_t * delta )

get the delta x

Parameters
[in]*handlepointer to a pmw3901mb handle structure
[out]*deltapointer to a delta buffer
Returns
status code
  • 0 success
  • 1 get delta x failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1903 of file driver_pmw3901mb.c.

◆ pmw3901mb_get_delta_y()

uint8_t pmw3901mb_get_delta_y ( pmw3901mb_handle_t * handle,
int16_t * delta )

get the delta y

Parameters
[in]*handlepointer to a pmw3901mb handle structure
[out]*deltapointer to a delta buffer
Returns
status code
  • 0 success
  • 1 get delta y failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1948 of file driver_pmw3901mb.c.

◆ pmw3901mb_get_frame()

uint8_t pmw3901mb_get_frame ( pmw3901mb_handle_t * handle,
uint8_t frame[35][35] )

get the frame

Parameters
[in]*handlepointer to a pmw3901mb handle structure
[out]**framepointer to a frame buffer
Returns
status code
  • 0 success
  • 1 get frame failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
0 1 2 ... 32 33 34 (byte) . . . ... . . . . . . ... . . . . . . ... . . . 1190 1191 1192 ... 1222 1223 1224

Definition at line 668 of file driver_pmw3901mb.c.

◆ pmw3901mb_get_inverse_product_id()

uint8_t pmw3901mb_get_inverse_product_id ( pmw3901mb_handle_t * handle,
uint8_t * id )

get the inverse product id

Parameters
[in]*handlepointer to a pmw3901mb handle structure
[out]*idpointer to an id buffer
Returns
status code
  • 0 success
  • 1 get inverse product id failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1691 of file driver_pmw3901mb.c.

◆ pmw3901mb_get_max_raw_data()

uint8_t pmw3901mb_get_max_raw_data ( pmw3901mb_handle_t * handle,
uint8_t * max )

get the maximum raw data value

Parameters
[in]*handlepointer to a pmw3901mb handle structure
[out]*maxpointer to a max buffer
Returns
status code
  • 0 success
  • 1 get max raw data failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2099 of file driver_pmw3901mb.c.

◆ pmw3901mb_get_min_raw_data()

uint8_t pmw3901mb_get_min_raw_data ( pmw3901mb_handle_t * handle,
uint8_t * min )

get the minimum raw data value

Parameters
[in]*handlepointer to a pmw3901mb handle structure
[out]*minpointer to a min buffer
Returns
status code
  • 0 success
  • 1 get min raw data failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2134 of file driver_pmw3901mb.c.

◆ pmw3901mb_get_motion()

uint8_t pmw3901mb_get_motion ( pmw3901mb_handle_t * handle,
uint8_t * motion )

get the motion

Parameters
[in]*handlepointer to a pmw3901mb handle structure
[out]*motionpointer to a motion buffer
Returns
status code
  • 0 success
  • 1 get motion failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1833 of file driver_pmw3901mb.c.

◆ pmw3901mb_get_motion_burst()

uint8_t pmw3901mb_get_motion_burst ( pmw3901mb_handle_t * handle,
uint8_t * burst,
uint8_t len )

get the motion burst

Parameters
[in]*handlepointer to a pmw3901mb handle structure
[out]*burstpointer to a burst buffer
[in]lenburst length
Returns
status code
  • 0 success
  • 1 get motion burst failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1994 of file driver_pmw3901mb.c.

◆ pmw3901mb_get_observation()

uint8_t pmw3901mb_get_observation ( pmw3901mb_handle_t * handle,
uint8_t * observation )

get the observation

Parameters
[in]*handlepointer to a pmw3901mb handle structure
[out]*observationpointer to an observation buffer
Returns
status code
  • 0 success
  • 1 get observation failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2214 of file driver_pmw3901mb.c.

◆ pmw3901mb_get_product_id()

uint8_t pmw3901mb_get_product_id ( pmw3901mb_handle_t * handle,
uint8_t * id )

get the product id

Parameters
[in]*handlepointer to a pmw3901mb handle structure
[out]*idpointer to an id buffer
Returns
status code
  • 0 success
  • 1 get product id failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1656 of file driver_pmw3901mb.c.

◆ pmw3901mb_get_raw_data_grab()

uint8_t pmw3901mb_get_raw_data_grab ( pmw3901mb_handle_t * handle,
uint8_t * grab,
uint16_t len )

get the raw data grab

Parameters
[in]*handlepointer to a pmw3901mb handle structure
[out]*grabpointer to a grab buffer
[in]lengrab length
Returns
status code
  • 0 success
  • 1 get raw data grab failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2286 of file driver_pmw3901mb.c.

◆ pmw3901mb_get_raw_data_grab_status()

uint8_t pmw3901mb_get_raw_data_grab_status ( pmw3901mb_handle_t * handle,
uint8_t * status )

get the raw data grab status

Parameters
[in]*handlepointer to a pmw3901mb handle structure
[out]*statuspointer to a status buffer
Returns
status code
  • 0 success
  • 1 get raw data grab status failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2365 of file driver_pmw3901mb.c.

◆ pmw3901mb_get_raw_data_sum()

uint8_t pmw3901mb_get_raw_data_sum ( pmw3901mb_handle_t * handle,
uint8_t * sum )

get the average raw data value

Parameters
[in]*handlepointer to a pmw3901mb handle structure
[out]*sumpointer to a sum buffer
Returns
status code
  • 0 success
  • 1 get raw data sum failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2064 of file driver_pmw3901mb.c.

◆ pmw3901mb_get_revision_id()

uint8_t pmw3901mb_get_revision_id ( pmw3901mb_handle_t * handle,
uint8_t * id )

get the revision id

Parameters
[in]*handlepointer to a pmw3901mb handle structure
[out]*idpointer to an id buffer
Returns
status code
  • 0 success
  • 1 get revision id failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1726 of file driver_pmw3901mb.c.

◆ pmw3901mb_get_shutter()

uint8_t pmw3901mb_get_shutter ( pmw3901mb_handle_t * handle,
uint16_t * shutter )

get the shutter

Parameters
[in]*handlepointer to a pmw3901mb handle structure
[out]*shutterpointer to a shutter buffer
Returns
status code
  • 0 success
  • 1 get shutter failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2169 of file driver_pmw3901mb.c.

◆ pmw3901mb_get_squal()

uint8_t pmw3901mb_get_squal ( pmw3901mb_handle_t * handle,
uint8_t * squal )

get the surface quality

Parameters
[in]*handlepointer to a pmw3901mb handle structure
[out]*squalpointer to a surface quality buffer
Returns
status code
  • 0 success
  • 1 get squal failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2029 of file driver_pmw3901mb.c.

◆ pmw3901mb_info()

uint8_t pmw3901mb_info ( pmw3901mb_info_t * info)

get chip's information

Parameters
[out]*infopointer to a pmw3901mb info structure
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 2480 of file driver_pmw3901mb.c.

◆ pmw3901mb_init()

uint8_t pmw3901mb_init ( pmw3901mb_handle_t * handle)

initialize the chip

Parameters
[in]*handlepointer to a pmw3901mb handle structure
Returns
status code
  • 0 success
  • 1 spi or gpio initialization failed
  • 2 handle is NULL
  • 3 linked functions is NULL
  • 4 id is invalid
  • 5 reset failed
Note
none

Definition at line 133 of file driver_pmw3901mb.c.

◆ pmw3901mb_power_up()

uint8_t pmw3901mb_power_up ( pmw3901mb_handle_t * handle)

power up the chip

Parameters
[in]*handlepointer to a pmw3901mb handle structure
Returns
status code
  • 0 success
  • 1 power up failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 308 of file driver_pmw3901mb.c.

◆ pmw3901mb_reset()

uint8_t pmw3901mb_reset ( pmw3901mb_handle_t * handle)

reset the chip

Parameters
[in]*handlepointer to a pmw3901mb handle structure
Returns
status code
  • 0 success
  • 1 reset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1760 of file driver_pmw3901mb.c.

◆ pmw3901mb_set_motion()

uint8_t pmw3901mb_set_motion ( pmw3901mb_handle_t * handle,
uint8_t motion )

set the motion

Parameters
[in]*handlepointer to a pmw3901mb handle structure
[in]motionset motion
Returns
status code
  • 0 success
  • 1 set motion failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1868 of file driver_pmw3901mb.c.

◆ pmw3901mb_set_observation()

uint8_t pmw3901mb_set_observation ( pmw3901mb_handle_t * handle,
uint8_t observation )

set the observation

Parameters
[in]*handlepointer to a pmw3901mb handle structure
[in]observationinput observation
Returns
status code
  • 0 success
  • 1 set observation failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2250 of file driver_pmw3901mb.c.

◆ pmw3901mb_set_optimum_performance()

uint8_t pmw3901mb_set_optimum_performance ( pmw3901mb_handle_t * handle)

set the optimum performance

Parameters
[in]*handlepointer to a pmw3901mb handle structure
Returns
status code
  • 0 success
  • 1 set optimum performance failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 815 of file driver_pmw3901mb.c.

◆ pmw3901mb_set_raw_data_grab()

uint8_t pmw3901mb_set_raw_data_grab ( pmw3901mb_handle_t * handle,
uint8_t * grab,
uint16_t len )

set the raw data grab

Parameters
[in]*handlepointer to a pmw3901mb handle structure
[in]*grabpointer to a raw data grab buffer
[in]lengrab length
Returns
status code
  • 0 success
  • 1 set raw data grab failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 2326 of file driver_pmw3901mb.c.

◆ pmw3901mb_shutdown()

uint8_t pmw3901mb_shutdown ( pmw3901mb_handle_t * handle)

shutdown the chip

Parameters
[in]*handlepointer to a pmw3901mb handle structure
Returns
status code
  • 0 success
  • 1 shutdown failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1796 of file driver_pmw3901mb.c.

◆ pmw3901mb_start_frame_capture()

uint8_t pmw3901mb_start_frame_capture ( pmw3901mb_handle_t * handle)

start frame capture

Parameters
[in]*handlepointer to a pmw3901mb handle structure
Returns
status code
  • 0 success
  • 1 start frame capture failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 455 of file driver_pmw3901mb.c.

◆ pmw3901mb_stop_frame_capture()

uint8_t pmw3901mb_stop_frame_capture ( pmw3901mb_handle_t * handle)

stop frame capture

Parameters
[in]*handlepointer to a pmw3901mb handle structure
Returns
status code
  • 0 success
  • 1 stop frame capture failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 555 of file driver_pmw3901mb.c.