mirror of
git://projects.qi-hardware.com/f32xbase.git
synced 2025-04-21 12:27:27 +03:00
Support different targets. (Openmoko GTA01/02 with Dbgv3, soon c2ben.)
- f32x/Makefile: added support for building for different targets (for now, just TARGET=om) - f32x/c2-drv.h: interface for C2 drivers - f32x/c2-om.c: updated title - f32x/c2-om.c: renamed all c2_* to om_* and made them "static" - f32x/c2-om.c (c2_om): driver operations - f32x/c2.c: call driver operations - f32x/c2.h: moved protocol constants to c2-drv.h
This commit is contained in:
33
f32x/c2-om.c
33
f32x/c2-om.c
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* f32x/c2.c - Basic C2 messages
|
||||
* f32x/c2-om.c - Basic C2 messages, driver for Openmoko GTA01/GTA02+DebugV3
|
||||
*
|
||||
* Written 2008 by Werner Almesberger
|
||||
* Copyright 2008 Werner Almesberger
|
||||
* Written 2008, 2010 by Werner Almesberger
|
||||
* Copyright 2008, 2010 Werner Almesberger
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include "gpio.h"
|
||||
#include "c2.h"
|
||||
#include "c2-drv.h"
|
||||
|
||||
|
||||
/*
|
||||
@@ -64,7 +64,7 @@ static uint32_t c2_recv(int bits)
|
||||
/* ----- C2 Register read/write -------------------------------------------- */
|
||||
|
||||
|
||||
void c2_addr_write(uint8_t addr)
|
||||
static void om_addr_write(uint8_t addr)
|
||||
{
|
||||
c2_pulse();
|
||||
gpio_output(C2D);
|
||||
@@ -75,7 +75,7 @@ void c2_addr_write(uint8_t addr)
|
||||
}
|
||||
|
||||
|
||||
uint8_t c2_addr_read(void)
|
||||
static uint8_t om_addr_read(void)
|
||||
{
|
||||
c2_pulse();
|
||||
gpio_output(C2D);
|
||||
@@ -86,7 +86,7 @@ uint8_t c2_addr_read(void)
|
||||
}
|
||||
|
||||
|
||||
void c2_data_write(uint32_t data, int bytes)
|
||||
static void om_data_write(uint32_t data, int bytes)
|
||||
{
|
||||
c2_pulse();
|
||||
gpio_output(C2D);
|
||||
@@ -99,7 +99,7 @@ void c2_data_write(uint32_t data, int bytes)
|
||||
}
|
||||
|
||||
|
||||
uint32_t c2_data_read(int bytes)
|
||||
static uint32_t om_data_read(int bytes)
|
||||
{
|
||||
c2_pulse();
|
||||
gpio_output(C2D);
|
||||
@@ -115,7 +115,7 @@ uint32_t c2_data_read(int bytes)
|
||||
/* ----- C2 initialization ------------------------------------------------- */
|
||||
|
||||
|
||||
void c2_init(void)
|
||||
static void om_init(void)
|
||||
{
|
||||
gpio_init();
|
||||
gpio_input(C2D);
|
||||
@@ -127,7 +127,7 @@ void c2_init(void)
|
||||
}
|
||||
|
||||
|
||||
void c2_reset(void)
|
||||
static void om_reset(void)
|
||||
{
|
||||
gpio_input(C2D);
|
||||
gpio_low(C2CK);
|
||||
@@ -136,3 +136,16 @@ void c2_reset(void)
|
||||
gpio_output(C2CK);
|
||||
gpio_high(C2CK);
|
||||
}
|
||||
|
||||
|
||||
/* ----- Operations -------------------------------------------------------- */
|
||||
|
||||
|
||||
struct c2_ops c2_om = {
|
||||
.init = om_init,
|
||||
.reset = om_reset,
|
||||
.addr_write = om_addr_write,
|
||||
.addr_read = om_addr_read,
|
||||
.data_write = om_data_write,
|
||||
.data_read = om_data_read,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user