Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
Beam Positoning Monitor - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Beam Positoning Monitor - Software
Commits
f4e41d54
Commit
f4e41d54
authored
Jan 12, 2015
by
Lucas Russo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hal/sm_io/protocols/ops/*: add BSMP protocol
parent
12cac8a1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
560 additions
and
1 deletion
+560
-1
ops.mk
hal/sm_io/protocols/ops/ops.mk
+2
-1
sm_pr_bsmp.c
hal/sm_io/protocols/ops/sm_pr_bsmp.c
+472
-0
sm_pr_bsmp.h
hal/sm_io/protocols/ops/sm_pr_bsmp.h
+69
-0
sm_pr_bsmp_defaults.h
hal/sm_io/protocols/ops/sm_pr_bsmp_defaults.h
+17
-0
No files found.
hal/sm_io/protocols/ops/ops.mk
View file @
f4e41d54
sm_io_protocols_ops_DIR = hal/sm_io/protocols/ops
sm_io_protocols_ops_OBJS = $(sm_io_protocols_ops_DIR)/sm_pr_spi.o \
$(sm_io_protocols_ops_DIR)/sm_pr_i2c.o
$(sm_io_protocols_ops_DIR)/sm_pr_i2c.o \
$(sm_io_protocols_ops_DIR)/sm_pr_bsmp.o
# $(sm_io_protocols_ops_DIR)/sm_pr_bypass.o \
# $(sm_io_protocols_ops_DIR)/sm_pr_1w.o \
# $(sm_io_protocols_ops_DIR)/sm_pr_gpio.o
...
...
hal/sm_io/protocols/ops/sm_pr_bsmp.c
0 → 100644
View file @
f4e41d54
This diff is collapsed.
Click to expand it.
hal/sm_io/protocols/ops/sm_pr_bsmp.h
0 → 100644
View file @
f4e41d54
/*
* Copyright (C) 2014 LNLS (www.lnls.br)
* Author: Lucas Russo <lucas.russo@lnls.br>
*
* Released according to the GNU LGPL, version 3 or any later version.
*/
#ifndef _SM_PR_BSMP_H_
#define _SM_PR_BSMP_H_
#include <bsmp/client.h>
#include "sm_pr.h"
#include "sm_pr_err.h"
#if defined( __GNUC__)
#define PACKED __attribute__ ((packed))
#else
#error "Unsupported compiler?"
#endif
#define SMPR_PROTO_BSMP(self) ((smpr_proto_bsmp_t *) self->proto_handler)
#define SMPR_PROTO_BSMP_CLIENT(self) (SMPR_PROTO_BSMP(self)->client)
/* BSMP glue structure. Needed to overcome the need of global variables */
struct
_smpr_proto_glue_bsmp_t
{
smio_t
*
parent
;
};
typedef
struct
_smpr_proto_glue_bsmp_t
smpr_proto_glue_bsmp_t
;
/* For use by llio_t general structure */
extern
const
smpr_proto_ops_t
smpr_proto_ops_bsmp
;
/* Device endpoint */
struct
_smpr_proto_bsmp_t
{
uint32_t
base
;
/* Core base address */
bsmp_client_t
*
client
;
/* BSMP client instance */
struct
bsmp_func_info_list
*
funcs_list
;
/* BSMP function handler */
struct
bsmp_var_info_list
*
vars_list
;
/* BSMP variables handler */
struct
bsmp_curve_info_list
*
curves_list
;
/* BSMP curves handler */
/* Unused */
struct
bsmp_group_list
*
groups_list
;
/* BSMP groups handler */
};
/* Opaque smpr_proto_bsmp structure */
typedef
struct
_smpr_proto_bsmp_t
smpr_proto_bsmp_t
;
/***************** Our methods *****************/
/* Creates a new instance of the Endpoint*/
smpr_proto_bsmp_t
*
smpr_proto_bsmp_new
(
uint32_t
base
);
/* Destroy an instance of the Endpoint */
smpr_err_e
smpr_proto_bsmp_destroy
(
smpr_proto_bsmp_t
**
self_p
);
/***************** SMPR proto BSMP methods ************************************/
/* Read/Write to RFFE vars by ID */
smpr_err_e
smpr_bsmp_read_var_by_id
(
smpr_t
*
self
,
uint32_t
id
,
uint8_t
*
data
,
size_t
size
);
smpr_err_e
smpr_bsmp_write_var_by_id
(
smpr_t
*
self
,
uint32_t
id
,
uint8_t
*
data
,
size_t
size
);
/* Call RFFE functions by ID */
smpr_err_e
smpr_bsmp_func_exec_by_id
(
smpr_t
*
self
,
uint32_t
id
,
uint8_t
*
write_data
,
size_t
write_size
,
uint8_t
*
read_data
,
size_t
read_size
);
/* Read RFFE curves by ID */
smpr_err_e
smpr_bsmp_read_curve_by_id
(
smpr_t
*
self
,
uint32_t
id
,
uint8_t
*
read_data
,
size_t
size
,
size_t
*
valid_bytes
);
#endif
hal/sm_io/protocols/ops/sm_pr_bsmp_defaults.h
0 → 100644
View file @
f4e41d54
/*
* Copyright (C) 2014 LNLS (www.lnls.br)
* Author: Lucas Russo <lucas.russo@lnls.br>
*
* Released according to the GNU LGPL, version 3 or any later version.
*/
#ifndef _SM_PR_I2C_DEFAULTS_H_
#define _SM_PR_I2C_DEFAULTS_H_
#define SM_PR_I2C_DFLT_SYS_FREQ 100000000
/* 100 MHz */
#define SM_PR_I2C_DFLT_I2C_FREQ 100000
/* 100 KHz */
#define SM_PR_I2C_DFLT_I2C_CONFIG 0x0
/* Nothing for now */
#define SM_PR_I2C_DFLT_I2C_SLEEP_USECS 10000
/* 10 ms sleep between read/writes */
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment