Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
86
Issues
86
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
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
White Rabbit Switch - Software
Commits
706b0a02
Commit
706b0a02
authored
Oct 15, 2014
by
Adam Wujek
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
userspace/libwr: remove files sfp.c and sfp.h, since not used
parent
2fd05d3f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
116 deletions
+0
-116
sfp.c
userspace/libwr/sfp.c
+0
-56
sfp.h
userspace/libwr/sfp.h
+0
-60
No files found.
userspace/libwr/sfp.c
deleted
100644 → 0
View file @
2fd05d3f
#include "sfp.h"
#define MUX_ADDR(sel) ((0xE << 3) | (sel & 0x7))
static
const
pio_pin_t
mux_sda
=
{
PIOB
,
0
,
PIO_MODE_GPIO
,
PIO_OUT_1
};
static
const
pio_pin_t
mux_scl
=
{
PIOB
,
1
,
PIO_MODE_GPIO
,
PIO_OUT_1
};
struct
i2c_bus_t
*
mux_bus
;
struct
wr_i2c_mux
sfp_mux
=
{
.
address
=
{
MUX_ADDR
(
0
),
MUX_ADDR
(
1
)
},
.
reset
=
{
.
port
=
PIOD
,
.
pin
=
12
,
.
mode
=
PIO_MODE_GPIO
,
.
dir
=
PIO_OUT_1
}
};
struct
i2c_bus_t
*
sfp_bus0
;
struct
i2c_bus_t
*
sfp_bus1
;
struct
pca9554d
wr_sfp_gpio
[]
=
{
{
/* 0 */
},
{
/* 1 */
},
{
/* 2 */
},
{
/* 3 */
},
{
/* 4 */
},
{
/* 5 */
},
{
/* 6 */
},
{
/* 7 */
},
{
/* 8 */
},
};
struct
wr_sfp_module
[
18
]
void
sfp_init
(
void
)
{
/* Create a bit-banged i2c for the muxes */
mux_bus
=
i2c_cpu_bb_new_bus
(
&
mux_scl
,
&
mux_sda
);
/* Set the bus to be used for the mux control */
sfp_mux
.
bus
=
mux_bus
;
}
userspace/libwr/sfp.h
deleted
100644 → 0
View file @
2fd05d3f
#ifndef SFP_H
#define SFP_H
/* This structure describes the pair of PCA9548A chip used as muxes for i2c */
struct
wr_i2c_mux
{
/* I2C bus */
struct
i2c_bus
*
bus
;
/* I2C addresses of the two PCA9548 chips */
int
address
[
2
];
/* Reset pin */
struct
pio_pin_t
reset
;
};
int
wr_i2c_mux_set_channel
(
struct
wr_i2c_mux
*
,
int
);
/* This structure describes a single PCA9554D chip */
struct
pca9554d
{
/* The i2c bus used for access */
struct
i2c_bus_t
*
bus
;
/* The address of this PCA9554D (set by A0,A1,A2 pins) */
int
address
;
int
(
*
init
)(
struct
pca9554d
*
);
int
(
*
exit
)(
struct
pca9554d
*
);
};
int
pca9554d_get_input_reg
(
struct
pca9554d
*
);
int
pca9554d_set_output_reg
(
struct
pca9554d
*
);
int
pca9554d_set_polarity_reg
(
struct
pca9554d
*
);
int
pca9554d_set_config_reg
(
struct
pca9554d
*
);
#define GPIO_BITS_LOWER 0
#define GPIO_BITS_UPPER 1
#define WRLINK_LED_LINK(m) \
(1 << (((m->bits_type == GPIO_BITS_LOWER) ? 0 : 2) + 4*m->bits_type))
#define WRLINK_LED_WRMODE(m) \
(1 << (((m->bits_type == GPIO_BITS_LOWER) ? 1 : 0) + 4*m->bits_type))
#define WRLINK_LED_SYNCED(m) \
(1 << (((m->bits_type == GPIO_BITS_LOWER) ? 3 : 1) + 4*m->bits_type))
#define SFP_TX_DISABLE(m) \
(1 << (((m->bits_type == GPIO_BITS_LOWER) ? 2 : 3) + 4*m->bits_type))
struct
wr_sfp_module
{
/*
* The PCA9554D associated with this device. Use a pointer here
* as a single PCA9554D controls the pins for two SFP modules
* each.
*/
struct
pca9554d
*
gpio_ctl
;
/* One of PCA9554_BITS_LOWER or PCA9554_BITS_UPPER */
int
bits_type
;
/* The PCA9548 chip for accessing this SFP module */
struct
wr_i2c_mux
*
mux
;
/*
* The channel for writing to control register of the
* PCA9548 chips.
*/
int
channel
;
};
#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