Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F103861857
sbcp_common.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Mar 5, 04:04
Size
2 KB
Mime Type
text/x-c
Expires
Fri, Mar 7, 04:04 (1 d, 8 h)
Engine
blob
Format
Raw Data
Handle
24666040
Attached To
R6616 sbcp-uc
sbcp_common.h
View Options
/*
File: sbcp_common.h
Author: tuleu
Created on May 22, 2012, 1:53 PM
*/
#ifndef SBCP_UC_SBCP_COMMON_H_
#define SBCP_UC_SBCP_COMMON_H_
#include "common.h"
#define SBCP_FRAME_SIZE 4
#define SBCP_PACKET_SIZE 128
/**
* class of an sbcp device
* \ingroup sbcp_m
*/
typedef
uint8_t
sbcp_class
;
/**
* ID of a SBCP device
* \ingroup sbcp_m
*/
typedef
uint8_t
sbcp_id
;
/**
* Firmware version of an SBCP device
* \ingroup sbcp_m
*/
typedef
uint16_t
sbcp_fw_version
;
/**
* Payload size type of a \ref sbcp_packet_m
* \ingroup sbcp_m
*/
typedef
uint8_t
sbcp_payload_size
;
/**
* Standard register of any SBCP device
* \ingroup sbcp_register_m
*/
typedef
enum
sbcp_std_registers
{
SBCP_REG_FW
=
0x00
,
//!< SBCP_REG_FW Firmware code
SBCP_REG_CLASS
=
0x01
,
//!< SBCP_REG_CLASS Class of the device
SBCP_REG_ID
=
0x02
,
//!< SBCP_REG_ID ID of the device
SBCP_SPECIFIC_REG_START
=
0x03
//!< SBCP_REG_SPECIFIC_REG_START First available specific register
}
sbcp_std_registers
;
typedef
enum
sbcp_std_instructions
{
SBCP_INST_GET_FIRMWARE
=
0x00
,
SBCP_INST_GET_REGISTERS
=
0x01
,
SBCP_INST_SET_REGISTERS
=
0x02
,
SBCP_INST_UNLOCK_REGISTER
=
0x03
,
SBCP_INST_DEVICE_SPECIFIC_START
=
0x04
,
SBCP_INST_LOW_LATENCY_INSTRUCTION
=
0xff
}
sbcp_std_instructions
;
typedef
enum
sbcp_error_flags
{
SBCP_NO_ERROR
=
0x00
,
SBCP_COMMUNICATION_ERROR
=
0x80
,
SBCP_APPLICATION_ERROR_MASK
=
0x7f
}
sbcp_error_flags
;
typedef
enum
sbcp_com_error
{
SBCP_CERR_CS_INCORRECT
=
0x80
,
SBCP_CERR_BUS_TIMEOUT
=
0x81
,
SBCP_CERR_FRAME_ERROR
=
0x82
,
SBCP_CERR_UNKNOWN_INSTRUCTION
=
0x83
,
SBCP_CERR_BUS_FRAME_ERROR
=
0x84
,
SBCP_CERR_HOST_TIMEOUT
=
0x85
,
SBCP_CERR_HOST_FRAME_ERROR
=
0x86
,
SBCP_CERR_SLAVE_TIMEOUT
=
0x87
,
SBCP_CERR_SLAVE_FRAME_ERROR
=
0x88
,
SBCP_CERR_UNEXPECTED_SIZE
=
0x89
,
SBCP_CERR_REG_NOT_READABLE
=
0x8a
,
SBCP_CERR_REG_NOT_WRITABLE
=
0x8b
,
SBCP_CERR_REG_PROTECTED
=
0x8c
,
SBCP_CERR_UNIMPLEMENTED_INSTRUCTION
=
0x8d
}
sbcp_com_error
;
typedef
uint8_t
sbcp_error
;
typedef
enum
sbcp_packet_definition
{
SBCP_HEADER_POS
=
0
,
SBCP_CLASS_POS
=
1
,
SBCP_ID_POS
=
2
,
SBCP_PAYLOAD_SIZE_POS
=
3
,
SBCP_INSTRUCTION_POS
=
4
,
SBCP_PAYLOAD_START_POS
=
5
,
SBCP_HEADER_SIZE
=
6
}
sbcp_packet_definition
;
#define SBCP_HEADER_VALUE 0xff
#endif
// SBCP_UC_SBCP_COMMON_H_
Event Timeline
Log In to Comment