2014-02-02 16:48:18 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2014 INRIA
|
|
|
|
*
|
2014-07-31 20:15:03 +02:00
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
* directory for more details.
|
2014-02-02 16:48:18 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @ingroup cc430
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* @brief cc430 flashrom driver
|
|
|
|
*
|
|
|
|
* @author Kévin Roussel <Kevin.Roussel@inria.fr>
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2013-12-16 09:57:30 +01:00
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdint.h>
|
2013-12-19 10:22:44 +01:00
|
|
|
#include "cpu.h"
|
|
|
|
#include "irq.h"
|
2013-12-16 09:57:30 +01:00
|
|
|
|
|
|
|
static uint8_t prepare(void);
|
|
|
|
static void finish(uint8_t istate);
|
|
|
|
static inline void busy_wait(void);
|
|
|
|
|
|
|
|
/*---------------------------------------------------------------------------*/
|
|
|
|
uint8_t flashrom_erase(uint8_t *addr)
|
|
|
|
{
|
2014-02-02 16:48:18 +01:00
|
|
|
// TODO implement this function
|
2013-12-16 09:57:30 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
/*---------------------------------------------------------------------------*/
|
2014-06-25 20:50:43 +02:00
|
|
|
uint8_t flashrom_write(uint8_t *dst, const uint8_t *src, size_t size)
|
2013-12-16 09:57:30 +01:00
|
|
|
{
|
|
|
|
// TODO implement this function
|
2014-06-25 20:50:43 +02:00
|
|
|
return 0;
|
2013-12-16 09:57:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*---------------------------------------------------------------------------*/
|
|
|
|
static uint8_t prepare(void)
|
|
|
|
{
|
|
|
|
// TODO implement this function
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
/*---------------------------------------------------------------------------*/
|
|
|
|
void finish(uint8_t istate)
|
|
|
|
{
|
|
|
|
// TODO implement this function
|
|
|
|
}
|
|
|
|
/*---------------------------------------------------------------------------*/
|
|
|
|
static inline void busy_wait(void)
|
|
|
|
{
|
|
|
|
/* Wait for BUSY = 0, not needed unless run from RAM */
|
|
|
|
while (FCTL3 & 0x0001) {
|
|
|
|
nop();
|
|
|
|
}
|
|
|
|
}
|