From 7e1e72e29349a8248901d4d4f466d1c9b556344d Mon Sep 17 00:00:00 2001 From: NĂ©lio Laranjeiro Date: Thu, 13 Mar 2008 00:35:33 +0100 Subject: Flash module... Still a problem with the write array... --- digital/avr/modules/flash/flash.h | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'digital/avr/modules/flash/flash.h') diff --git a/digital/avr/modules/flash/flash.h b/digital/avr/modules/flash/flash.h index 5ff4e8ce..39fd366c 100644 --- a/digital/avr/modules/flash/flash.h +++ b/digital/avr/modules/flash/flash.h @@ -94,10 +94,28 @@ void flash_send_command (uint8_t cmd); /** Poll the busy bit in the Software Status Register of the flash memory. - * \return the busy bit state. + * \return the status register. */ uint8_t -flash_is_busy (void); +flash_read_status (void); + +/** Poll the busy bit in the Software Status Register of the flash memory. + * \return the busy bit state. + */ +extern inline uint8_t +flash_is_busy (void) +{ + return flash_read_status () & 0x1; +} + +/** Return the AAI status flag of the register. + * \return the AAI status. + */ +extern inline uint8_t +flash_status_aai (void) +{ + return flash_read_status () >> 6; +} /** Write in the flash byte provided in parameter. * \param data the buffer to store the data. -- cgit v1.2.3