Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
Production Test Suite
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
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
Production Test Suite
Commits
31ef596d
Commit
31ef596d
authored
Jul 11, 2013
by
Matthieu Cattin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fmc_adc: make the wishbone base addresses ready for multi-module.
parent
87ee725f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
13 deletions
+14
-13
fmc_adc.py
test/fmcadc100m14b4cha/python/fmc_adc.py
+14
-13
No files found.
test/fmcadc100m14b4cha/python/fmc_adc.py
View file @
31ef596d
...
...
@@ -75,19 +75,19 @@ class FmcAdc100mOperationError(Exception):
class
CFmcAdc100m
:
FMC_SYS_I2C_ADDR
=
0x
3
000
FMC_SYS_I2C_ADDR
=
0x
1
000
EEPROM_ADDR
=
0x50
FMC_SPI_ADDR
=
0x
3
100
FMC_SPI_ADDR
=
0x
1
100
FMC_SPI_DIV
=
100
FMC_SPI_SS
=
{
'ADC'
:
0
,
'DAC1'
:
1
,
'DAC2'
:
2
,
'DAC3'
:
3
,
'DAC4'
:
4
}
FMC_I2C_ADDR
=
0x
3
200
FMC_I2C_ADDR
=
0x
1
200
SI570_ADDR
=
0x55
FMC_ONEWIRE_ADDR
=
0x
3
400
FMC_ONEWIRE_ADDR
=
0x
1
400
FMC_CSR_ADDR
=
0x
3
300
FMC_CSR_ADDR
=
0x
1
300
"""
...
...
@@ -202,21 +202,22 @@ class CFmcAdc100m:
return addr
"""
def
__init__
(
self
,
bus
):
def
__init__
(
self
,
bus
,
offset
=
0x4000
):
self
.
bus
=
bus
self
.
offset
=
offset
try
:
# Objects declaration
self
.
fmc_sys_i2c
=
COpenCoresI2C
(
self
.
bus
,
self
.
FMC_SYS_I2C_ADDR
,
249
)
self
.
fmc_i2c
=
COpenCoresI2C
(
self
.
bus
,
self
.
FMC_I2C_ADDR
,
249
)
self
.
fmc_sys_i2c
=
COpenCoresI2C
(
self
.
bus
,
self
.
offset
+
self
.
FMC_SYS_I2C_ADDR
,
249
)
self
.
fmc_i2c
=
COpenCoresI2C
(
self
.
bus
,
self
.
offset
+
self
.
FMC_I2C_ADDR
,
249
)
self
.
eeprom_24aa64
=
C24AA64
(
self
.
fmc_sys_i2c
,
self
.
EEPROM_ADDR
)
self
.
si570
=
CSi57x
(
self
.
fmc_i2c
,
self
.
SI570_ADDR
)
self
.
eeprom_24aa64
=
C24AA64
(
self
.
fmc_sys_i2c
,
self
.
offset
+
self
.
EEPROM_ADDR
)
self
.
si570
=
CSi57x
(
self
.
fmc_i2c
,
self
.
offset
+
self
.
SI570_ADDR
)
self
.
fmc_onewire
=
COpenCoresOneWire
(
self
.
bus
,
self
.
FMC_ONEWIRE_ADDR
,
624
,
124
)
self
.
fmc_onewire
=
COpenCoresOneWire
(
self
.
bus
,
self
.
offset
+
self
.
FMC_ONEWIRE_ADDR
,
624
,
124
)
self
.
ds18b20
=
CDS18B20
(
self
.
fmc_onewire
,
0
)
self
.
fmc_spi
=
COpenCoresSPI
(
self
.
bus
,
self
.
FMC_SPI_ADDR
,
self
.
FMC_SPI_DIV
)
self
.
fmc_spi
=
COpenCoresSPI
(
self
.
bus
,
self
.
offset
+
self
.
FMC_SPI_ADDR
,
self
.
FMC_SPI_DIV
)
self
.
adc_cfg
=
CLTC217x
(
self
.
fmc_spi
,
self
.
FMC_SPI_SS
[
'ADC'
])
self
.
dac_ch
=
[]
self
.
dac_ch
.
append
(
CMAX5442
(
self
.
fmc_spi
,
self
.
FMC_SPI_SS
[
'DAC1'
]))
...
...
@@ -224,7 +225,7 @@ class CFmcAdc100m:
self
.
dac_ch
.
append
(
CMAX5442
(
self
.
fmc_spi
,
self
.
FMC_SPI_SS
[
'DAC3'
]))
self
.
dac_ch
.
append
(
CMAX5442
(
self
.
fmc_spi
,
self
.
FMC_SPI_SS
[
'DAC4'
]))
self
.
fmc_adc_csr
=
CCSR
(
self
.
bus
,
self
.
FMC_CSR_ADDR
,
FMCADC100M_CSR
)
self
.
fmc_adc_csr
=
CCSR
(
self
.
bus
,
self
.
offset
+
self
.
FMC_CSR_ADDR
,
FMCADC100M_CSR
)
# Set channels gain to 1
self
.
fmc_adc_csr
.
set_field
(
'CH1_GAIN'
,
'VAL'
,
0x8000
)
...
...
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