mbgtools-lx  4.2.8
Low level functions used to access the hardware device

Functions

int pcps_write (PCPS_DDEV *pddev, uint8_t cmd, const void FAR *buffer, uint16_t count)
 Write data to a device. More...
 
int pcps_generic_io (PCPS_DDEV *pddev, uint8_t type, const void FAR *in_buff, uint8_t in_cnt, void FAR *out_buff, uint8_t out_cnt)
 Generic I/O function. More...
 
int pcps_read_gps (PCPS_DDEV *pddev, uint8_t data_type, void FAR *buffer, uint16_t count)
 Read a large data structure from a device. More...
 
int pcps_write_gps (PCPS_DDEV *pddev, uint8_t data_type, const void FAR *buffer, uint16_t count)
 Write a large data structure to a device. More...
 
int pcps_write (PCPS_DDEV *pddev, uint8_t cmd, const void *buffer, uint16_t count)
 Write data to a device. More...
 
int pcps_generic_io (PCPS_DDEV *pddev, uint8_t type, const void *in_buff, uint8_t in_cnt, void *out_buff, uint8_t out_cnt)
 Generic I/O function. More...
 
int pcps_read_gps (PCPS_DDEV *pddev, uint8_t data_type, void *buffer, uint16_t count)
 Read a large data structure from a device. More...
 
int pcps_write_gps (PCPS_DDEV *pddev, uint8_t data_type, const void *buffer, uint16_t count)
 Write a large data structure to a device. More...
 

Variables

PCPS_WRITE_FNC pcps_write
 Write data to a device. More...
 
PCPS_READ_FNC pcps_read_gps
 Read a large data structure from a device. More...
 
PCPS_WRITE_FNC pcps_write_gps
 Write a large data structure to a device. More...
 

Detailed Description

Function Documentation

◆ pcps_generic_io() [1/2]

int pcps_generic_io ( PCPS_DDEV pddev,
uint8_t  type,
const void *  in_buff,
uint8_t  in_cnt,
void *  out_buff,
uint8_t  out_cnt 
)

Generic I/O function.

Parameters
[in]pddevPointer to the device structure
[in]typeThe type of data to be read/written, see PCPS_CMD_CODES
[in]in_buffA buffer with data to be written according to the type code
[in]in_cntThe number of bytes to be written according to the type code
[out]out_buffA buffer with data to be read according to the type code
[in]out_cntThe number of bytes to be read according to the type code
Returns
MBG_SUCCESS on success, MBG_ERR_TIMEOUT if device didn't respond in time, MBG_ERR_NBYTES if the number of parameter bytes did not match the number of data bytes expected by the device, or one of the other MBG_RETURN_CODES
See also
Low level functions used to access the hardware device

◆ pcps_generic_io() [2/2]

int pcps_generic_io ( PCPS_DDEV pddev,
uint8_t  type,
const void FAR in_buff,
uint8_t  in_cnt,
void FAR out_buff,
uint8_t  out_cnt 
)

Generic I/O function.

Parameters
[in]pddevPointer to the device structure
[in]typeThe type of data to be read/written, see PCPS_CMD_CODES
[in]in_buffA buffer with data to be written according to the type code
[in]in_cntThe number of bytes to be written according to the type code
[out]out_buffA buffer with data to be read according to the type code
[in]out_cntThe number of bytes to be read according to the type code
Returns
MBG_SUCCESS on success, MBG_ERR_TIMEOUT if device didn't respond in time, MBG_ERR_NBYTES if the number of parameter bytes did not match the number of data bytes expected by the device, or one of the other MBG_RETURN_CODES
See also
Low level functions used to access the hardware device

Definition at line 3045 of file pcpsdrvr.c.

References _fmemcpy, _mbg_kdd_msg_0, _mbg_kdd_msg_3, _mbg_kdd_msg_5, _pcps_read, _pcps_read_var, _pcps_write_byte, FAR, FP_FMT, MBG_ERR_NBYTES, MBG_LOG_DEBUG, mbg_rc_is_error, mbg_rc_is_success, PCPS_FIFO_SIZE, PCPS_GENERIC_IO, and report_ret_val().

Referenced by ioctl_switch().

◆ pcps_read_gps() [1/2]

int pcps_read_gps ( PCPS_DDEV pddev,
uint8_t  data_type,
void *  buffer,
uint16_t  count 
)

Read a large data structure from a device.

Read data structures which exceed PCPS_FIFO_SIZE bytes. This can't be handled in a single read cycle, and due to limitations of the device's microprocessor the execution time can be up to 20 milliseconds, depending on the device type. This has been introduced with the first GPS devices but is now in fact also used with non-GPS devices.

Parameters
[in]pddevPointer to the device structure
[in]data_typeThe code assigned to the data type, see PC_GPS_CMD_CODES
[out]bufferA buffer with data to be read according to the data_type
[in]countThe number of bytes to be read according to the data_type
Returns
MBG_SUCCESS on success, MBG_ERR_TIMEOUT if device didn't respond in time, MBG_ERR_INV_TYPE if the device didn_t recognize the data type, MBG_ERR_NBYTES if the number of parameter bytes did not match the number of data bytes expected by the device, or one of the other MBG_RETURN_CODES
See also
Low level functions used to access the hardware device

◆ pcps_read_gps() [2/2]

int pcps_read_gps ( PCPS_DDEV pddev,
uint8_t  data_type,
void FAR buffer,
uint16_t  count 
)

Read a large data structure from a device.

Read data structures which exceed PCPS_FIFO_SIZE bytes. This can't be handled in a single read cycle, and due to limitations of the device's microprocessor the execution time can be up to 20 milliseconds, depending on the device type. This has been introduced with the first GPS devices but is now in fact also used with non-GPS devices.

Parameters
[in]pddevPointer to the device structure
[in]data_typeThe code assigned to the data type, see PC_GPS_CMD_CODES
[out]bufferA buffer with data to be read according to the data_type
[in]countThe number of bytes to be read according to the data_type
Returns
MBG_SUCCESS on success, MBG_ERR_TIMEOUT if device didn't respond in time, MBG_ERR_INV_TYPE if the device didn_t recognize the data type, MBG_ERR_NBYTES if the number of parameter bytes did not match the number of data bytes expected by the device, or one of the other MBG_RETURN_CODES
See also
Low level functions used to access the hardware device

Definition at line 3407 of file pcpsdrvr.c.

References _mbg_kdd_msg_3, _pcps_ddev_is_usb, FAR, MBG_LOG_DEBUG, mbg_rc_is_error, MBG_SUCCESS, PCPS_FIFO_SIZE, pcps_read_gps_block(), and report_ret_val().

◆ pcps_write() [1/2]

int pcps_write ( PCPS_DDEV pddev,
uint8_t  cmd,
const void *  buffer,
uint16_t  count 
)

Write data to a device.

Parameters
[in]pddevPointer to the device structure
[in]cmdThe command code for the board, see PCPS_CMD_CODES
[in]bufferA buffer with data to be written according to the cmd code
[in]countThe number of bytes to be written according to the cmd code
Returns
MBG_SUCCESS on success, MBG_ERR_TIMEOUT if device didn't respond in time, MBG_ERR_NBYTES if the number of parameter bytes did not match the number of data bytes expected by the device, or one of the other MBG_RETURN_CODES
See also
Low level functions used to access the hardware device

◆ pcps_write() [2/2]

int pcps_write ( PCPS_DDEV pddev,
uint8_t  cmd,
const void FAR buffer,
uint16_t  count 
)

Write data to a device.

Parameters
[in]pddevPointer to the device structure
[in]cmdThe command code for the board, see PCPS_CMD_CODES
[in]bufferA buffer with data to be written according to the cmd code
[in]countThe number of bytes to be written according to the cmd code
Returns
MBG_SUCCESS on success, MBG_ERR_TIMEOUT if device didn't respond in time, MBG_ERR_NBYTES if the number of parameter bytes did not match the number of data bytes expected by the device, or one of the other MBG_RETURN_CODES
See also
Low level functions used to access the hardware device

Definition at line 2947 of file pcpsdrvr.c.

References _mbg_kdd_msg_2, _mbg_kdd_msg_4, _pcps_ddev_is_usb, _pcps_read_var, _pcps_write_byte, FAR, MBG_ERR_NBYTES, MBG_LOG_DEBUG, mbg_rc_is_error, mbg_rc_is_success, and report_ret_val().

◆ pcps_write_gps() [1/2]

int pcps_write_gps ( PCPS_DDEV pddev,
uint8_t  data_type,
const void *  buffer,
uint16_t  count 
)

Write a large data structure to a device.

This has been introduced with the first GPS devices but is now in fact also used with non-GPS devices.

Parameters
[in]pddevPointer to the device structure
[in]data_typeThe code assigned to the data type, see PC_GPS_CMD_CODES
[in]bufferA buffer with data to be written according to the data_type
[in]countThe number of bytes to be written according to the data_type
Returns
MBG_SUCCESS on success, MBG_ERR_TIMEOUT if device didn't respond in time, MBG_ERR_NBYTES if the number of parameter bytes did not match the number of data bytes expected by the device, or one of the other MBG_RETURN_CODES
See also
Low level functions used to access the hardware device

◆ pcps_write_gps() [2/2]

int pcps_write_gps ( PCPS_DDEV pddev,
uint8_t  data_type,
const void FAR buffer,
uint16_t  count 
)

Write a large data structure to a device.

This has been introduced with the first GPS devices but is now in fact also used with non-GPS devices.

Parameters
[in]pddevPointer to the device structure
[in]data_typeThe code assigned to the data type, see PC_GPS_CMD_CODES
[in]bufferA buffer with data to be written according to the data_type
[in]countThe number of bytes to be written according to the data_type
Returns
MBG_SUCCESS on success, MBG_ERR_TIMEOUT if device didn't respond in time, MBG_ERR_NBYTES if the number of parameter bytes did not match the number of data bytes expected by the device, or one of the other MBG_RETURN_CODES
See also
Low level functions used to access the hardware device

Definition at line 3494 of file pcpsdrvr.c.

References _mbg_kdd_msg_1, _mbg_kdd_msg_2, _mbg_kdd_msg_3, _pcps_ddev_is_usb, _pcps_read_var, _pcps_write_byte, FAR, MBG_LOG_DEBUG, mbg_rc_is_error, mbg_rc_is_success, PCPS_DDEV_s::n_bytes, pcps_check_gps_data_size(), pcps_init_gps_transfer(), PCPS_WRITE_GPS_DATA, report_ret_val(), and PCPS_DDEV_s::size_n_bytes.

Variable Documentation

◆ pcps_read_gps

int pcps_read_gps

Read a large data structure from a device.

Read data structures which exceed PCPS_FIFO_SIZE bytes. This can't be handled in a single read cycle, and due to limitations of the device's microprocessor the execution time can be up to 20 milliseconds, depending on the device type. This has been introduced with the first GPS devices but is now in fact also used with non-GPS devices.

Parameters
[in]pddevPointer to the device structure
[in]data_typeThe code assigned to the data type, see PC_GPS_CMD_CODES
[out]bufferA buffer with data to be read according to the data_type
[in]countThe number of bytes to be read according to the data_type
Returns
MBG_SUCCESS on success, MBG_ERR_TIMEOUT if device didn't respond in time, MBG_ERR_INV_TYPE if the device didn_t recognize the data type, MBG_ERR_NBYTES if the number of parameter bytes did not match the number of data bytes expected by the device, or one of the other MBG_RETURN_CODES
See also
Low level functions used to access the hardware device

Definition at line 3468 of file pcpsdrvr.c.

Referenced by ioctl_switch(), and pcps_read_gps_block().

◆ pcps_write

int pcps_write

Write data to a device.

Parameters
[in]pddevPointer to the device structure
[in]cmdThe command code for the board, see PCPS_CMD_CODES
[in]bufferA buffer with data to be written according to the cmd code
[in]countThe number of bytes to be written according to the cmd code
Returns
MBG_SUCCESS on success, MBG_ERR_TIMEOUT if device didn't respond in time, MBG_ERR_NBYTES if the number of parameter bytes did not match the number of data bytes expected by the device, or one of the other MBG_RETURN_CODES
See also
Low level functions used to access the hardware device

Definition at line 3020 of file pcpsdrvr.c.

Referenced by ioctl_switch().

◆ pcps_write_gps

int pcps_write_gps

Write a large data structure to a device.

This has been introduced with the first GPS devices but is now in fact also used with non-GPS devices.

Parameters
[in]pddevPointer to the device structure
[in]data_typeThe code assigned to the data type, see PC_GPS_CMD_CODES
[in]bufferA buffer with data to be written according to the data_type
[in]countThe number of bytes to be written according to the data_type
Returns
MBG_SUCCESS on success, MBG_ERR_TIMEOUT if device didn't respond in time, MBG_ERR_NBYTES if the number of parameter bytes did not match the number of data bytes expected by the device, or one of the other MBG_RETURN_CODES
See also
Low level functions used to access the hardware device

Definition at line 3573 of file pcpsdrvr.c.

Referenced by ioctl_switch().