Commit e5835cfb authored by Lucas Russo's avatar Lucas Russo

embedded-sw/*: add simple regs definitions

parent d7bfa3cf
......@@ -145,8 +145,8 @@ fmc150_t *fmc150;
int fmc150_init(void)
{
if (fmc150_devl->devices){
//if (BASE_GPIO){
// get first gpio device found
//if (BASE_FMC150){
// get first fmc150 device found
fmc150 = (fmc150_t *)fmc150_devl->devices->base;//BASE_FMC150;
return 0;
}
......@@ -231,6 +231,8 @@ static int fmc150_spi_busy_loop()
return 0;
}
// TODO: implement a register structure and associate permissions
// (RO, RW, WO)
int init_cdce72010()
{
int i;
......@@ -238,7 +240,7 @@ int init_cdce72010()
/* Write regs to cdce72010 statically */
// Do not write the last register, as it is Read-only
for(i = 0; i < CDCE72010_NUMREGS-1; ++i){
for(i = 0; i < CDCE72010_NUMREGS; ++i){
if(fmc150_spi_busy_loop() < 0){
dbg_print("init_cdce72010: max SPI tries excceded!\n");
return -1;
......
/*
* Copyright (C) 2012 LNLS (www.lnls.br)
* Author: Lucas Russo <lucas.russo@lnls.br>
*
* Released according to the GNU GPL, version 2 or any later version.
*/
#ifndef _REGS_H_
#define _REGS_H_
#define READ_ONLY 0x1
#define WRITE_ONLY 0x2
#define READ_WRITE (READ_ONLY | WRITE_ONLY)
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment