scanner  2.0.0.0
Functions
Public function

Functions

void scanner_cfg_setup (scanner_cfg_t *cfg)
 Config Object Initialization function. More...
 
SCANNER_RETVAL scanner_init (scanner_t *ctx, scanner_cfg_t *cfg)
 Initialization function. More...
 
void scanner_set_sdi (scanner_t *ctx, uint8_t sdi_mode)
 Set SDI Pin function. More...
 
uint8_t scanner_get_sdo (scanner_t *ctx)
 Get SDO Pin state function. More...
 
void scanner_clock (scanner_t *ctx)
 Pulse function. More...
 
void scanner_serial_cmd (scanner_t *ctx, uint8_t cmd)
 Write function. More...
 
uint8_t scanner_serial_read_reg (scanner_t *ctx, uint8_t reg_adr)
 Read function. More...
 
void scanner_serial_write_reg (scanner_t *ctx, uint8_t reg_adr, uint8_t write_data)
 Write function. More...
 
void scanner_startup (scanner_t *ctx)
 Start function. More...
 
void scanner_read_pixel (scanner_t *ctx, uint8_t *pixel_data)
 Read pixels. More...
 

Detailed Description

Function Documentation

◆ scanner_cfg_setup()

void scanner_cfg_setup ( scanner_cfg_t cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ scanner_clock()

void scanner_clock ( scanner_t ctx)

Pulse function.

Parameters
ctxClick object.

@description Function is used to make SCK pulse.

◆ scanner_get_sdo()

uint8_t scanner_get_sdo ( scanner_t ctx)

Get SDO Pin state function.

Parameters
ctxClick object.
Returns
  • 1 : Pin high
  • 0 : Pin low

@description Function is used to get pin state.

◆ scanner_init()

SCANNER_RETVAL scanner_init ( scanner_t ctx,
scanner_cfg_t cfg 
)

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ scanner_read_pixel()

void scanner_read_pixel ( scanner_t ctx,
uint8_t *  pixel_data 
)

Read pixels.

Parameters
ctxClick object.
pixel_dataPixel buffer data.

@description Function is used to read pixel status.

Note
pixel_data should be buffer of 102 elements so that every data can be stored

◆ scanner_serial_cmd()

void scanner_serial_cmd ( scanner_t ctx,
uint8_t  cmd 
)

Write function.

Parameters
ctxClick object.
cmdWrite cmd.

@description Function is used to write command to the device.

◆ scanner_serial_read_reg()

uint8_t scanner_serial_read_reg ( scanner_t ctx,
uint8_t  reg_adr 
)

Read function.

Parameters
ctxClick object.
reg_adrRegister address.
Returns
  • Returns read data.

@description Function is used to read from the device.

◆ scanner_serial_write_reg()

void scanner_serial_write_reg ( scanner_t ctx,
uint8_t  reg_adr,
uint8_t  write_data 
)

Write function.

Parameters
ctxClick object.
reg_adrRegister address.
write_dataData to be written.

@description Function is used to write to the device.

◆ scanner_set_sdi()

void scanner_set_sdi ( scanner_t ctx,
uint8_t  sdi_mode 
)

Set SDI Pin function.

Parameters
ctxClick object.
sdi_modeDefines state of the pin.
  • 1 : Pin high
  • 0 : Pin low

@description Function is used to maipulate the state of the SDI pin.

◆ scanner_startup()

void scanner_startup ( scanner_t ctx)

Start function.

Parameters
ctxClick object.

@description Function is used to start up the linear array sensor.

Note
It is necessary to use this function in the application initialization stage.